OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
Util Namespace Reference

Classes

struct  KahanAccumulation

Functions

std::string getGitRevision ()
double erfinv (double x)
Vector_t< double, 3 > getTaitBryantAngles (Quaternion rotation, const std::string &)
std::string toUpper (const std::string &str)
std::string boolToUpperString (const bool &b)
std::string boolVectorToUpperString (const std::vector< bool > &b)
std::string doubleVectorToString (const std::vector< double > &v)
std::string combineFilePath (std::initializer_list< std::string > ilist)
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
std::string base64_encode (const std::string &string_to_encode)
std::string base64_decode (std::string const &encoded_string)
double getGamma (ippl::Vector< double, 3 > p)
ippl::Vector< double, 3 > getBeta (ippl::Vector< double, 3 > p)
double getKineticEnergy (ippl::Vector< double, 3 > p, double mass)
double getBetaGamma (double Ekin, double mass)
double convertMomentumEVoverCToBetaGamma (double p, double mass)
std::string getTimeString (double time, unsigned int precision=3)
std::string getLengthString (double spos, unsigned int precision=3)
std::string getLengthString (ippl::Vector< double, 3 > spos, unsigned int precision=3)
std::string getEnergyString (double energyInMeV, unsigned int precision=3)
std::string getChargeString (double charge, unsigned int precision=3)
template<class IteratorIn, class IteratorOut>
void toString (IteratorIn first, IteratorIn last, IteratorOut out)
template<typename T>
std::string toStringWithThousandSep (T value, char sep='\'')
template<typename T, typename A>
Tc_data (std::vector< T, A > &v)
template<typename T, typename A>
T const * c_data (std::vector< T, A > const &v)

Function Documentation

◆ base64_decode()

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

Definition at line 411 of file Util.cpp.

◆ base64_encode()

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

Definition at line 369 of file Util.cpp.

Referenced by MeshGenerator::write().

Here is the caller graph for this function:

◆ boolToUpperString()

std::string Util::boolToUpperString ( const bool & b)

Definition at line 154 of file Util.cpp.

References toUpper().

Referenced by boolVectorToUpperString().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ boolVectorToUpperString()

std::string Util::boolVectorToUpperString ( const std::vector< bool > & b)

Definition at line 161 of file Util.cpp.

References boolToUpperString().

Here is the call graph for this function:

◆ c_data() [1/2]

template<typename T, typename A>
T * Util::c_data ( std::vector< T, A > & v)

Definition at line 225 of file Util.h.

Referenced by H5PartWrapper::copyStepData(), H5PartWrapperForPT::readStepData(), and H5PartWrapperForPT::writeStepData().

Here is the caller graph for this function:

◆ c_data() [2/2]

template<typename T, typename A>
T const * Util::c_data ( std::vector< T, A > const & v)

Definition at line 230 of file Util.h.

◆ combineFilePath()

std::string Util::combineFilePath ( std::initializer_list< std::string > ilist)

◆ convertMomentumEVoverCToBetaGamma()

double Util::convertMomentumEVoverCToBetaGamma ( double p,
double mass )
inline

Definition at line 66 of file Util.h.

◆ doubleVectorToString()

std::string Util::doubleVectorToString ( const std::vector< double > & v)

Definition at line 176 of file Util.cpp.

References toString().

Here is the call graph for this function:

◆ erfinv()

double Util::erfinv ( double x)

◆ getBeta()

ippl::Vector< double, 3 > Util::getBeta ( ippl::Vector< double, 3 > p)
inline

Definition at line 51 of file Util.h.

References getGamma().

Here is the call graph for this function:

◆ getBetaGamma()

double Util::getBetaGamma ( double Ekin,
double mass )
inline

Definition at line 59 of file Util.h.

Referenced by RFCavity::getAutoPhaseEstimate(), and RFCavity::getAutoPhaseEstimateFallback().

Here is the caller graph for this function:

◆ getChargeString()

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

Definition at line 163 of file Util.h.

◆ getEnergyString()

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

Definition at line 140 of file Util.h.

Referenced by ParallelTracker::dumpStats().

Here is the caller graph for this function:

◆ getGamma()

double Util::getGamma ( ippl::Vector< double, 3 > p)
inline

Definition at line 44 of file Util.h.

Referenced by Corrector::apply(), PluginElement::changeWidth(), OrbitThreader::checkElementLengths(), ParallelTracker::execute(), ParallelTracker::findStartPosition(), getBeta(), getKineticEnergy(), RFCavity::trackOnAxisParticle(), and OrbitThreader::updateBoundingBoxWithCurrentPosition().

Here is the caller graph for this function:

◆ getGitRevision()

std::string Util::getGitRevision ( )

Definition at line 32 of file Util.cpp.

References GIT_VERSION.

Referenced by SDDSWriter::addDefaultParameters(), main(), OPALXMAIN::printStdoutHeader(), SDDSWriter::replaceVersionString(), StringConstant::StringConstant(), H5PartWrapperForPT::writeHeader(), and LossDataSink::writeHeaderH5().

Here is the caller graph for this function:

◆ getKineticEnergy()

double Util::getKineticEnergy ( ippl::Vector< double, 3 > p,
double mass )
inline

Definition at line 55 of file Util.h.

References getGamma().

Referenced by RFCavity::getAutoPhaseEstimateFallback(), CavityAutophaser::getPhaseAtMaxEnergy(), CavityAutophaser::guessCavityPhase(), CavityAutophaser::track(), and RFCavity::trackOnAxisParticle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLengthString() [1/2]

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

Definition at line 93 of file Util.h.

Referenced by ParallelTracker::dumpStats(), and ParallelTracker::execute().

Here is the caller graph for this function:

◆ getLengthString() [2/2]

std::string Util::getLengthString ( ippl::Vector< double, 3 > spos,
unsigned int precision = 3 )
inline

Definition at line 112 of file Util.h.

◆ getTaitBryantAngles()

ippl::Vector< double, 3 > Util::getTaitBryantAngles ( Quaternion rotation,
const std::string &  )

Definition at line 114 of file Util.cpp.

References Quaternion::conjugate(), euclidean_norm(), Quaternion::rotate(), and Physics::two_pi.

Referenced by OpalBeamline::save3DInput().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTimeString()

std::string Util::getTimeString ( double time,
unsigned int precision = 3 )
inline

Definition at line 70 of file Util.h.

Referenced by ParallelTracker::dumpStats(), and ParallelTracker::execute().

Here is the caller graph for this function:

◆ rewindLinesSDDS()

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 219 of file Util.cpp.

References Physics::c, and end().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

template<class IteratorIn, class IteratorOut>
void Util::toString ( IteratorIn first,
IteratorIn last,
IteratorOut out )

Definition at line 270 of file Util.h.

Referenced by doubleVectorToString().

Here is the caller graph for this function:

◆ toStringWithThousandSep()

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

Definition at line 236 of file Util.h.

◆ toUpper()