OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
|
Classes | |
struct | KahanAccumulation |
Functions | |
std::string | getGitRevision () |
double | erfinv (double x) |
Vector_t | 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) |
void | checkInt (double real, std::string name, double tolerance) |
bool | isAllDigits (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) |
Vector_t | getBeta (Vector_t p) |
double | getKineticEnergy (Vector_t 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 (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) |
double | angle_0to2pi (double angle) |
convert angle (in rad) to [0,2pi) range, from https://stackoverflow.com/a/29721295 More... | |
bool | angleBetweenAngles (const double angle, const double min, const double max) |
check if angle (in rad and in range [0,2pi]) is within [min, max] More... | |
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 > | |
T * | c_data (std::vector< T, A > &v) |
template<typename T , typename A > | |
T const * | c_data (std::vector< T, A > const &v) |
|
inline |
convert angle (in rad) to [0,2pi) range, from https://stackoverflow.com/a/29721295
Definition at line 199 of file Util.h.
References angle(), fmod(), and Physics::two_pi.
Referenced by TrimCoil::applyField(), and TrimCoil::setAzimuth().
|
inline |
check if angle (in rad and in range [0,2pi]) is within [min, max]
Definition at line 206 of file Util.h.
Referenced by TrimCoil::applyField(), Cyclotron::checkInitialReferenceParticle(), and ParallelCyclotronTracker::visitRing().
std::string Util::base64_decode | ( | std::string const & | encoded_string | ) |
std::string Util::base64_encode | ( | const std::string & | string_to_encode | ) |
Definition at line 384 of file Util.cpp.
Referenced by MeshGenerator::write().
std::string Util::boolToUpperString | ( | const bool & | b | ) |
Definition at line 154 of file Util.cpp.
References toUpper().
Referenced by boolVectorToUpperString(), and ParticleMatterInteraction::print().
std::string Util::boolVectorToUpperString | ( | const std::vector< bool > & | b | ) |
Definition at line 161 of file Util.cpp.
References boolToUpperString().
Referenced by ParallelCyclotronTracker::visitCyclotron().
T* Util::c_data | ( | std::vector< T, A > & | v | ) |
Definition at line 247 of file Util.h.
References Attrib::Legacy::Distribution::T.
Referenced by H5PartWrapper::copyStepData(), H5PartWrapperForPC::readStepData(), H5PartWrapperForPT::readStepData(), H5PartWrapperForPC::writeStepData(), and H5PartWrapperForPT::writeStepData().
T const* Util::c_data | ( | std::vector< T, A > const & | v | ) |
Definition at line 250 of file Util.h.
References Attrib::Legacy::Distribution::T.
void Util::checkInt | ( | double | real, |
std::string | name, | ||
double | tolerance | ||
) |
Definition at line 205 of file Util.cpp.
References abs(), and floor().
Referenced by DumpFields::buildGrid(), and DumpEMFields::buildGrid().
std::string Util::combineFilePath | ( | std::initializer_list< std::string > | ilist | ) |
Definition at line 197 of file Util.cpp.
Referenced by CSRIGFWakeFunction::apply(), CSRWakeFunction::apply(), Bend2D::calculateRefTrajectory(), _Fieldmap::checkMap(), BoundaryGeometry::computeMeshVoxelization(), _FM3DDynamic::getOnaxisEz(), Bend2D::getOutline(), CavityAutophaser::getPhaseAtMaxEnergy(), SigmaGenerator::initialize(), SigmaGenerator::match(), OrbitThreader::OrbitThreader(), LaserProfile::sampleDist(), OpalBeamline::save3DInput(), OpalBeamline::save3DLattice(), LaserProfile::saveData(), LaserProfile::saveHistogram(), IndexMap::saveSDDS(), RBend3D::trackRefParticleThrough(), SigmaGenerator::updateInitialSigma(), SigmaGenerator::updateSigma(), MeshGenerator::write(), _Fieldmap::write3DField(), DumpFields::writeFieldThis(), DumpEMFields::writeFieldThis(), FlexibleCollimator::writeHolesAndQuadtree(), SigmaGenerator::writeOrbitOutput_m(), Distribution::writeOutFileHeader(), and Cyclotron::writeOutputFieldFiles().
|
inline |
Definition at line 69 of file Util.h.
Referenced by Distribution::adjustPhaseSpace(), Distribution::createDistributionFromFile(), Distribution::createOpalT(), Distribution::setSigmaP_m(), and Distribution::shiftDistCoordinates().
std::string Util::doubleVectorToString | ( | const std::vector< double > & | v | ) |
Definition at line 176 of file Util.cpp.
References begin, end, and toString().
Referenced by ParallelCyclotronTracker::visitCyclotron().
double Util::erfinv | ( | double | x | ) |
Definition at line 57 of file Util.cpp.
References erf(), erfinv_a0, erfinv_a1, erfinv_a2, erfinv_a3, erfinv_b0, erfinv_b1, erfinv_b2, erfinv_b3, erfinv_b4, erfinv_c0, erfinv_c1, erfinv_c2, erfinv_c3, erfinv_d0, erfinv_d1, erfinv_d2, exp(), log(), and sqrt().
Referenced by SampleGaussianSequence::SampleGaussianSequence().
Definition at line 51 of file Util.h.
References getGamma().
Referenced by Source::apply(), FlexibleCollimator::apply(), Monitor::apply(), Monitor::applyToReferenceParticle(), ScatteringPhysics::computeCoulombScattering(), Monitor::driftToCorrectPositionAndSave(), and ParallelCyclotronTracker::gapCrossKick_m().
|
inline |
Definition at line 61 of file Util.h.
Referenced by Distribution::generateMatchedGauss(), RFCavity::getAutoPhaseEstimate(), RFCavity::getAutoPhaseEstimateFallback(), Distribution::setupEmissionModelAstra(), Distribution::setupEmissionModelNone(), and SigmaGenerator::SigmaGenerator().
|
inline |
Definition at line 170 of file Util.h.
References abs().
Referenced by PartBunchBase< T, Dim >::print().
|
inline |
Definition at line 147 of file Util.h.
Referenced by ParallelTTracker::dumpStats(), and PartBunchBase< T, Dim >::print().
|
inline |
Definition at line 46 of file Util.h.
Referenced by Corrector::apply(), PluginElement::changeWidth(), OrbitThreader::checkElementLengths(), DistributionMoments::computeDebyeLength(), ScatteringPhysics::computeEnergyLoss(), DistributionMoments::computeMeans(), ParallelCyclotronTracker::computeSpaceChargeFields_m(), ScatteringPhysics::copyFromBunch(), BeamStrippingPhysics::doPhysics(), ParallelTTracker::execute(), ParallelTTracker::findStartPosition(), getBeta(), getKineticEnergy(), ScatteringPhysics::push(), ParallelCyclotronTracker::push(), ScatteringPhysics::setTimeStepForLeavingParticles(), RFCavity::trackOnAxisParticle(), OrbitThreader::updateBoundingBoxWithCurrentPosition(), and ParallelTTracker::writePhaseSpace().
std::string Util::getGitRevision | ( | ) |
Definition at line 33 of file Util.cpp.
Referenced by SDDSWriter::addDefaultParameters(), FixedPisaNsga2< CrossoverOperator, MutationOperator >::dumpPopulationToJSON(), opalMain(), SDDSWriter::replaceVersionString(), StringConstant::StringConstant(), H5PartWrapperForPC::writeHeader(), H5PartWrapperForPT::writeHeader(), LossDataSink::writeHeaderH5(), Sampler::writeJsonHeader(), and AmrMultiGrid::writeSDDSHeader_m().
|
inline |
Definition at line 56 of file Util.h.
References getGamma().
Referenced by DistributionMoments::computeMeanKineticEnergy(), DistributionMoments::computeStatistics(), BeamStrippingPhysics::doPhysics(), ParallelTTracker::findStartPosition(), RFCavity::getAutoPhaseEstimateFallback(), CavityAutophaser::getPhaseAtMaxEnergy(), CavityAutophaser::guessCavityPhase(), CavityAutophaser::track(), and RFCavity::trackOnAxisParticle().
|
inline |
Definition at line 97 of file Util.h.
References abs().
Referenced by ParallelTTracker::dumpStats(), ParallelTTracker::execute(), and PartBunchBase< T, Dim >::print().
|
inline |
Vector_t Util::getTaitBryantAngles | ( | Quaternion | rotation, |
const std::string & | |||
) |
Definition at line 117 of file Util.cpp.
References atan2(), Quaternion::conjugate(), cos(), euclidean_norm(), fmod(), Quaternion::rotate(), sin(), and Physics::two_pi.
Referenced by OpalBeamline::save3DInput(), and H5PartWrapperForPT::writeStepHeader().
|
inline |
Definition at line 74 of file Util.h.
References abs().
Referenced by ParallelTTracker::dumpStats(), ParallelTTracker::execute(), and PartBunchBase< T, Dim >::print().
bool Util::isAllDigits | ( | const std::string & | str | ) |
Check if there are only digits in a string from https://stackoverflow.com/questions/19678572/how-to-validate-that-there-are-only-digits-in-a-string
Definition at line 218 of file Util.cpp.
References Physics::c.
Referenced by FieldSolver::getTagging_m().
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 240 of file Util.cpp.
References Physics::c, Physics::e, end, endl(), Hypervolume::fs, INFOMSG, level2(), IpplInfo::myNode(), name, and parameters().
Referenced by StatBaseWriter::rewindToSpos(), and Monitor::writeStatistics().
void Util::toString | ( | IteratorIn | first, |
IteratorIn | last, | ||
IteratorOut | out | ||
) |
Definition at line 288 of file Util.h.
Referenced by doubleVectorToString().
std::string Util::toStringWithThousandSep | ( | T | value, |
char | sep = '\'' |
||
) |
Definition at line 254 of file Util.h.
References abs(), floor(), log(), max(), pow(), and Attrib::Legacy::Distribution::T.
Referenced by BeamStrippingPhysics::print(), and ScatteringPhysics::print().
std::string Util::toUpper | ( | const std::string & | str | ) |
Definition at line 147 of file Util.cpp.
References Physics::c.
Referenced by _Astra1DDynamic::_Astra1DDynamic(), _Astra1DElectroStatic::_Astra1DElectroStatic(), _Astra1DMagnetoStatic::_Astra1DMagnetoStatic(), _FM2DDynamic::_FM2DDynamic(), _FM2DElectroStatic::_FM2DElectroStatic(), _FM2DMagnetoStatic::_FM2DMagnetoStatic(), _FM3DDynamic::_FM3DDynamic(), _FM3DMagnetoStatic::_FM3DMagnetoStatic(), _FM3DMagnetoStaticExtended::_FM3DMagnetoStaticExtended(), Physics::Material::addMaterial(), boolToUpperString(), OpalSimulation::cleanUp(), FieldWriter::dumpField(), Physics::Material::getMaterial(), Attributes::getString(), Attributes::getStringArray(), Bend2D::initialise(), Attributes::makePredefinedString(), Attributes::makeUpperCaseString(), opalMain(), Attributes::PredefinedString::parse(), Attributes::PredefinedString::PredefinedString(), _Astra1DElectroStatic_fast::readFileHeader(), _Astra1DMagnetoStatic_fast::readFileHeader(), _FM1DElectroStatic::readFileHeader(), _FM1DMagnetoStatic::readFileHeader(), _FM1DDynamic::readFileHeader(), _FM1DElectroStatic_fast::readFileHeader(), _FM1DMagnetoStatic_fast::readFileHeader(), _Astra1DDynamic_fast::readFileHeader(), _FM1DDynamic_fast::readFileHeader(), Attributes::setPredefinedString(), Attributes::setUpperCaseString(), and Attributes::setUpperCaseStringArray().