OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <OrbitThreader.h>
Classes | |
struct | elementPosition |
struct | elementPositionComp |
Public Member Functions | |
OrbitThreader (const PartData &ref, const Vector_t &r, const Vector_t &p, double s, double maxDiffZBunch, double t, double dT, StepSizeConfig stepSizes, OpalBeamline &bl) | |
void | execute () |
IndexMap::value_t | query (IndexMap::key_t::first_type step, IndexMap::key_t::second_type length) |
IndexMap::key_t | getRange (const IndexMap::value_t::value_type &element, double position) const |
IndexMap::value_t | getTouchingElements (const IndexMap::key_t &range) const |
Private Member Functions | |
void | trackBack () |
void | integrate (const IndexMap::value_t &activeSet, double maxDrift=10.0) |
bool | containsCavity (const IndexMap::value_t &activeSet) |
void | autophaseCavities (const IndexMap::value_t &activeSet, const std::set< std::string > &visitedElements) |
double | getMaxDesignEnergy (const IndexMap::value_t &elementSet) const |
void | registerElement (const IndexMap::value_t &elementSet, double, const Vector_t &r, const Vector_t &p) |
void | processElementRegister () |
void | setDesignEnergy (FieldList &allElements, const std::set< std::string > &visitedElements) |
void | computeBoundingBox () |
void | updateBoundingBoxWithCurrentPosition () |
double | computeDriftLengthToBoundingBox (const std::set< std::shared_ptr< Component >> &elements, const Vector_t &position, const Vector_t &direction) const |
void | checkElementLengths (const std::set< std::shared_ptr< Component >> &elements) |
Private Attributes | |
Vector_t | r_m |
position of reference particle in lab coordinates More... | |
Vector_t | p_m |
momentum of reference particle More... | |
double | pathLength_m |
position of reference particle in path length More... | |
double | distTrackBack_m |
double | time_m |
the simulated time More... | |
double | dt_m |
the time step More... | |
StepSizeConfig | stepSizes_m |
final position in path length More... | |
const double | zstop_m |
OpalBeamline & | itsOpalBeamline_m |
IndexMap | imap_m |
unsigned int | errorFlag_m |
BorisPusher | integrator_m |
const PartData & | reference_m |
std::ofstream | logger_m |
size_t | loggingFrequency_m |
ElementBase::BoundingBox | globalBoundingBox_m |
std::multimap< std::string, elementPosition > | elementRegistry_m |
Definition at line 34 of file OrbitThreader.h.
OrbitThreader::OrbitThreader | ( | const PartData & | ref, |
const Vector_t & | r, | ||
const Vector_t & | p, | ||
double | s, | ||
double | maxDiffZBunch, | ||
double | t, | ||
double | dT, | ||
StepSizeConfig | stepSizes, | ||
OpalBeamline & | bl | ||
) |
Definition at line 49 of file OrbitThreader.cpp.
References abs(), Util::combineFilePath(), computeBoundingBox(), distTrackBack_m, dt_m, Physics::e, endl(), OpalData::getInstance(), logger_m, loggingFrequency_m, max(), min(), IpplInfo::myNode(), pathLength_m, and OpalData::WRITE.
|
private |
Definition at line 289 of file OrbitThreader.cpp.
References Options::autoPhase, dt_m, end(), CavityAutophaser::getPhaseAtMaxEnergy(), itsOpalBeamline_m, p_m, r_m, reference_m, ElementBase::RFCAVITY, OpalBeamline::rotateToLocalCS(), time_m, OpalBeamline::transformToLocalCS(), and ElementBase::TRAVELINGWAVE.
Referenced by execute().
|
private |
Definition at line 109 of file OrbitThreader.cpp.
References abs(), Physics::c, euclidean_norm(), StepSizeConfig::getdT(), Util::getGamma(), StepSizeConfig::getZStop(), p_m, pathLength_m, StepSizeConfig::reachedEnd(), and stepSizes_m.
Referenced by execute().
|
private |
Definition at line 439 of file OrbitThreader.cpp.
References ElementBase::ANY, end(), ElementBase::BoundingBox::getCombinedBoundingBox(), OpalBeamline::getElementByType(), globalBoundingBox_m, itsOpalBeamline_m, ElementBase::BoundingBox::lowerLeftCorner, ElementBase::MARKER, max(), updateBoundingBoxWithCurrentPosition(), and ElementBase::BoundingBox::upperRightCorner.
Referenced by OrbitThreader().
|
private |
Definition at line 465 of file OrbitThreader.cpp.
References euclidean_norm(), ElementBase::BoundingBox::getPointOfIntersection(), globalBoundingBox_m, and max().
Referenced by execute(), and trackBack().
|
private |
Definition at line 275 of file OrbitThreader.cpp.
References end(), ElementBase::RFCAVITY, and ElementBase::TRAVELINGWAVE.
Referenced by execute().
void OrbitThreader::execute | ( | ) |
Definition at line 132 of file OrbitThreader.cpp.
References IndexMap::add(), ElementBase::ANY, autophaseCavities(), Physics::c, checkElementLengths(), computeDriftLengthToBoundingBox(), containsCavity(), copysign(), dt_m, end(), endl(), EOL, errorFlag_m, EVERYTHINGFINE, OpalBeamline::getElementByType(), OpalBeamline::getElements(), gmsg, HITMATERIAL, imap_m, integrate(), integrator_m, itsOpalBeamline_m, level1(), p_m, pathLength_m, processElementRegister(), BorisPusher::push(), r_m, registerElement(), IndexMap::saveSDDS(), setDesignEnergy(), IndexMap::tidyUp(), trackBack(), updateBoundingBoxWithCurrentPosition(), and zstop_m.
Referenced by ParallelTTracker::execute().
|
private |
Definition at line 314 of file OrbitThreader.cpp.
References end(), RFCavity::getDesignEnergy(), max(), ElementBase::RFCAVITY, and ElementBase::TRAVELINGWAVE.
|
inline |
Definition at line 128 of file OrbitThreader.h.
References IndexMap::getRange(), and imap_m.
Referenced by ParallelTTracker::computeParticleMatterInteraction().
|
inline |
Definition at line 134 of file OrbitThreader.h.
References IndexMap::getTouchingElements(), and imap_m.
Referenced by ParallelTTracker::computeParticleMatterInteraction().
|
private |
Definition at line 196 of file OrbitThreader.cpp.
References abs(), Physics::c, copysign(), dot(), dt_m, Physics::e, end(), endl(), EOL, errorFlag_m, euclidean_norm(), EVERYTHINGFINE, OpalBeamline::getCSTrafoLab2Local(), OpalBeamline::getElements(), OpalData::getInstance(), PartData::getM(), HITMATERIAL, integrator_m, itsOpalBeamline_m, BorisPusher::kick(), logger_m, loggingFrequency_m, IpplInfo::myNode(), p_m, pathLength_m, BorisPusher::push(), r_m, reference_m, OpalBeamline::rotateFromLocalCS(), OpalBeamline::rotateToLocalCS(), sqrt(), time_m, OpalBeamline::transformToLocalCS(), and zstop_m.
Referenced by execute(), and trackBack().
|
private |
Definition at line 386 of file OrbitThreader.cpp.
References ElementBase::ANY, elementRegistry_m, end(), OpalBeamline::getElementByType(), itsOpalBeamline_m, and name.
Referenced by execute().
|
inline |
Definition at line 122 of file OrbitThreader.h.
References imap_m, and IndexMap::query().
Referenced by ParallelTTracker::computeExternalFields().
|
private |
Definition at line 354 of file OrbitThreader.cpp.
References abs(), Physics::e, elementRegistry_m, end(), euclidean_norm(), itsOpalBeamline_m, name, pathLength_m, Attrib::Distribution::R, OpalBeamline::rotateToLocalCS(), and OpalBeamline::transformToLocalCS().
Referenced by execute().
|
private |
Definition at line 423 of file OrbitThreader.cpp.
References dot(), end(), PartData::getM(), p_m, reference_m, ElementBase::RFCAVITY, sqrt(), and ElementBase::TRAVELINGWAVE.
Referenced by execute().
|
private |
Definition at line 331 of file OrbitThreader.cpp.
References abs(), Physics::c, computeDriftLengthToBoundingBox(), distTrackBack_m, dt_m, OpalBeamline::getElements(), integrate(), integrator_m, itsOpalBeamline_m, min(), p_m, pathLength_m, BorisPusher::push(), and r_m.
Referenced by execute().
|
private |
Definition at line 459 of file OrbitThreader.cpp.
References Physics::c, dt_m, ElementBase::BoundingBox::getBoundingBox(), ElementBase::BoundingBox::getCombinedBoundingBox(), Util::getGamma(), globalBoundingBox_m, p_m, and r_m.
Referenced by computeBoundingBox(), and execute().
|
private |
distance to track back before tracking forward (length of bunch but not beyond cathode)
Definition at line 66 of file OrbitThreader.h.
Referenced by OrbitThreader(), and trackBack().
|
private |
the time step
Definition at line 70 of file OrbitThreader.h.
Referenced by autophaseCavities(), execute(), integrate(), OrbitThreader(), trackBack(), and updateBoundingBoxWithCurrentPosition().
|
private |
Definition at line 101 of file OrbitThreader.h.
Referenced by processElementRegister(), and registerElement().
|
private |
Definition at line 79 of file OrbitThreader.h.
Referenced by execute(), and integrate().
|
private |
Definition at line 87 of file OrbitThreader.h.
Referenced by computeBoundingBox(), computeDriftLengthToBoundingBox(), and updateBoundingBoxWithCurrentPosition().
|
private |
Definition at line 77 of file OrbitThreader.h.
Referenced by execute(), getRange(), getTouchingElements(), and query().
|
private |
Definition at line 81 of file OrbitThreader.h.
Referenced by execute(), integrate(), and trackBack().
|
private |
Definition at line 76 of file OrbitThreader.h.
Referenced by autophaseCavities(), computeBoundingBox(), execute(), integrate(), processElementRegister(), registerElement(), and trackBack().
|
private |
Definition at line 84 of file OrbitThreader.h.
Referenced by integrate(), and OrbitThreader().
|
private |
Definition at line 85 of file OrbitThreader.h.
Referenced by integrate(), and OrbitThreader().
|
private |
momentum of reference particle
Definition at line 61 of file OrbitThreader.h.
Referenced by autophaseCavities(), checkElementLengths(), execute(), integrate(), setDesignEnergy(), trackBack(), and updateBoundingBoxWithCurrentPosition().
|
private |
position of reference particle in path length
Definition at line 63 of file OrbitThreader.h.
Referenced by checkElementLengths(), execute(), integrate(), OrbitThreader(), registerElement(), and trackBack().
|
private |
position of reference particle in lab coordinates
Definition at line 59 of file OrbitThreader.h.
Referenced by autophaseCavities(), execute(), integrate(), trackBack(), and updateBoundingBoxWithCurrentPosition().
|
private |
Definition at line 82 of file OrbitThreader.h.
Referenced by autophaseCavities(), integrate(), and setDesignEnergy().
|
private |
final position in path length
Definition at line 73 of file OrbitThreader.h.
Referenced by checkElementLengths().
|
private |
the simulated time
Definition at line 68 of file OrbitThreader.h.
Referenced by autophaseCavities(), and integrate().
|
private |
Definition at line 74 of file OrbitThreader.h.
Referenced by execute(), and integrate().