OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 401 of file Util.cpp.

◆ base64_encode()

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

Definition at line 359 of file Util.cpp.

Referenced by MeshGenerator::write().

◆ boolToUpperString()

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

Definition at line 150 of file Util.cpp.

References toUpper().

Referenced by boolVectorToUpperString().

Here is the call graph for this function:

◆ boolVectorToUpperString()

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

Definition at line 157 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)

◆ c_data() [2/2]

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

Definition at line 225 of file Util.h.

◆ combineFilePath()

◆ convertMomentumEVoverCToBetaGamma()

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

Definition at line 63 of file Util.h.

◆ doubleVectorToString()

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

Definition at line 172 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().

Referenced by Monitor::apply(), Monitor::apply(), Monitor::applyToReferenceParticle(), and Monitor::driftToCorrectPositionAndSave().

Here is the call graph for this function:

◆ getBetaGamma()

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

◆ getChargeString()

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

Definition at line 158 of file Util.h.

◆ getEnergyString()

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

Definition at line 135 of file Util.h.

Referenced by ParallelTracker::dumpStats(), and PartBunch< T, Dim >::print().

◆ getGamma()

◆ getGitRevision()

◆ getKineticEnergy()

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

◆ getLengthString() [1/2]

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

◆ getLengthString() [2/2]

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

Definition at line 107 of file Util.h.

◆ getTaitBryantAngles()

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

Definition at line 110 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:

◆ getTimeString()

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

Definition at line 65 of file Util.h.

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

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

References Physics::c.

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

◆ toString()

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

Definition at line 265 of file Util.h.

Referenced by doubleVectorToString().

◆ toStringWithThousandSep()

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

Definition at line 231 of file Util.h.

◆ toUpper()