OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Classes | Functions
Util Namespace Reference

Classes

struct  KahanAccumulation
 

Functions

std::string getGitRevision ()
 
double erfinv (double x)
 
Vector_t getTaitBryantAngles (Quaternion rotation, const std::string &elementName)
 
std::string toUpper (const std::string &str)
 
unsigned int rewindLinesSDDS (const std::string &fileName, double maxSPos, bool checkForTime)
 rewind the SDDS file such that the spos of the last step is less or equal to maxSPos More...
 
std::string base64_encode (const std::string &string_to_encode)
 
std::string base64_decode (std::string const &encoded_string)
 
double getGamma (Vector_t p)
 
double getEnergy (Vector_t p, double mass)
 
double getP (double E, double mass)
 
std::string getTimeString (double time, unsigned int precision=3)
 
std::string getLengthString (double spos, unsigned int precision=3)
 
std::string getLengthString (Vector_t spos, unsigned int precision=3)
 
std::string getEnergyString (double energyInMeV, unsigned int precision=3)
 
std::string getChargeString (double charge, unsigned int precision=3)
 
template<typename T >
std::string toStringWithThousandSep (T value, char sep= '\'')
 

Function Documentation

std::string Util::base64_decode ( std::string const &  encoded_string)

Definition at line 344 of file Util.cpp.

std::string Util::base64_encode ( const std::string &  string_to_encode)

Definition at line 300 of file Util.cpp.

Referenced by MeshGenerator::write().

double Util::erfinv ( double  x)
std::string Util::getChargeString ( double  charge,
unsigned int  precision = 3 
)
inline

Definition at line 136 of file Util.h.

References abs().

Referenced by PartBunchBase< T, Dim >::print().

Here is the call graph for this function:

double Util::getEnergy ( Vector_t  p,
double  mass 
)
inline
std::string Util::getEnergyString ( double  energyInMeV,
unsigned int  precision = 3 
)
inline

Definition at line 113 of file Util.h.

Referenced by ParallelTTracker::dumpStats(), and PartBunchBase< T, Dim >::print().

double Util::getGamma ( Vector_t  p)
inline
std::string Util::getGitRevision ( )
std::string Util::getLengthString ( double  spos,
unsigned int  precision = 3 
)
inline

Definition at line 63 of file Util.h.

References abs().

Referenced by ParallelTTracker::dumpStats(), ParallelSliceTracker::execute(), ParallelTTracker::execute(), and PartBunchBase< T, Dim >::print().

Here is the call graph for this function:

std::string Util::getLengthString ( Vector_t  spos,
unsigned int  precision = 3 
)
inline

Definition at line 82 of file Util.h.

References abs(), and max().

Here is the call graph for this function:

double Util::getP ( double  E,
double  mass 
)
inline

Definition at line 34 of file Util.h.

References pow(), and sqrt().

Referenced by RFCavity::getAutoPhaseEstimateFallback().

Here is the call graph for this function:

Vector_t Util::getTaitBryantAngles ( Quaternion  rotation,
const std::string &  elementName 
)
std::string Util::getTimeString ( double  time,
unsigned int  precision = 3 
)
inline

Definition at line 40 of file Util.h.

References abs().

Referenced by ParallelTTracker::dumpStats(), ParallelSliceTracker::execute(), ParallelTTracker::execute(), and PartBunchBase< T, Dim >::print().

Here is the call graph for this function:

unsigned int Util::rewindLinesSDDS ( const std::string &  fileName,
double  maxSPos,
bool  checkForTime 
)

rewind the SDDS file such that the spos of the last step is less or equal to maxSPos

Definition at line 154 of file Util.cpp.

References Physics::c, Physics::e, endl(), Hypervolume::fs, INFOMSG, level2(), IpplInfo::myNode(), and name.

Referenced by StatBaseWriter::rewindToSpos(), and Monitor::writeStatistics().

Here is the call graph for this function:

template<typename T >
std::string Util::toStringWithThousandSep ( T  value,
char  sep = '\'' 
)

Definition at line 185 of file Util.h.

References abs(), floor(), log(), max(), pow(), and T.

Referenced by CollimatorPhysics::print().

Here is the call graph for this function:

std::string Util::toUpper ( const std::string &  str)

Definition at line 130 of file Util.cpp.

References Physics::c.

Referenced by Physics::Material::addMaterial(), Astra1DDynamic::Astra1DDynamic(), Astra1DElectroStatic::Astra1DElectroStatic(), Astra1DMagnetoStatic::Astra1DMagnetoStatic(), Distribution::chooseInputMomentumUnits(), OpalSimulation::cleanUp(), AmrMultiGrid::convertToEnumBaseSolver_m(), AmrMultiGrid::convertToEnumBoundary_m(), AmrMultiGrid::convertToEnumInterpolater_m(), AmrMultiGrid::convertToEnumNorm_m(), AmrMultiGrid::convertToEnumPreconditioner_m(), AmrSmoother::convertToEnumSmoother(), MueLuPreconditioner< Level >::convertToMueLuReuseOption(), MueLuBottomSolver< Level >::convertToMueLuReuseOption(), OptimizeCmd::crossoverSelection(), SampleCmd::execute(), Option::execute(), TrackRun::execute(), FM2DDynamic::FM2DDynamic(), FM2DElectroStatic::FM2DElectroStatic(), FM2DMagnetoStatic::FM2DMagnetoStatic(), FM3DDynamic::FM3DDynamic(), FM3DMagnetoStatic::FM3DMagnetoStatic(), FM3DMagnetoStaticExtended::FM3DMagnetoStaticExtended(), Physics::Material::getMaterial(), Attributes::getString(), Attributes::getStringArray(), FieldSolver::getType(), FieldSolver::hasPeriodicZ(), FieldSolver::initAmrSolver_m(), FieldSolver::initCartesianFields(), Bend2D::initialise(), OpalSample::initialize(), OpalFilter::initOpalFilter(), OpalTrimCoil::initOpalTrimCoil(), ParticleMatterInteraction::initParticleMatterInteractionHandler(), FieldSolver::initSolver(), OpalWake::initWakefunction(), OptimizeCmd::mutationSelection(), OpalTrimCoil::print(), FieldSolver::printInfo(), Astra1DElectroStatic_fast::readFileHeader(), Astra1DMagnetoStatic_fast::readFileHeader(), Astra1DDynamic_fast::readFileHeader(), FM1DElectroStatic::readFileHeader(), FM1DMagnetoStatic::readFileHeader(), FM1DDynamic::readFileHeader(), FM1DElectroStatic_fast::readFileHeader(), FM1DMagnetoStatic_fast::readFileHeader(), FM1DDynamic_fast::readFileHeader(), MultiBunchHandler::setBinning(), RFCavity::setComponentType(), Distribution::setDistType(), AmrObject::setTagging(), TrackRun::setupCyclotronTracker(), Distribution::setupEmissionModel(), TrackRun::setupFieldsolver(), and OpalMonitor::update().