|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <OpalBeamline.h>

Public Member Functions | |
| OpalBeamline () | |
| OpalBeamline (const Vector_t< double, 3 > &origin, const Quaternion &rotation) | |
| ~OpalBeamline () | |
| void | activateElements () |
| std::set< std::shared_ptr< Component > > | getElements (const Vector_t< double, 3 > &x) |
| std::set< std::shared_ptr< Component > > | getElements () |
| Vector_t< double, 3 > | transformTo (const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | transformFrom (const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | rotateTo (const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | rotateFrom (const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | transformToLocalCS (const std::shared_ptr< Component > &comp, const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | transformFromLocalCS (const std::shared_ptr< Component > &comp, const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | rotateToLocalCS (const std::shared_ptr< Component > &comp, const Vector_t< double, 3 > &r) const |
| Vector_t< double, 3 > | rotateFromLocalCS (const std::shared_ptr< Component > &comp, const Vector_t< double, 3 > &r) const |
| PlacedElement | getPlacedElement (const std::shared_ptr< Component > &comp) const |
| Return the placed-element view used by the bridge stage. | |
| CoordinateSystemTrafo | getCSTrafoLab2Local (const std::shared_ptr< Component > &comp) const |
| Return the nominal rigid placement transform \(T_i\). | |
| CoordinateSystemTrafo | getCSTrafoLab2Local () const |
| CoordinateSystemTrafo | getMisalignment (const std::shared_ptr< Component > &comp) const |
| CoordinateSystemTrafo | getNominalEntryTransform (const std::shared_ptr< Component > &comp) const |
| CoordinateSystemTrafo | getNominalExitTransform (const std::shared_ptr< Component > &comp) const |
| double | getStart (const Vector_t< double, 3 > &) const |
| double | getEnd (const Vector_t< double, 3 > &) const |
| void | switchElements (const double &, const double &, const double &kineticEnergy, const bool &nomonitors=false) |
| void | switchElementsOff () |
| ParticleMatterInteractionHandler * | getParticleMatterInteractionHandler (const unsigned int &) |
| BoundaryGeometry * | getBoundaryGeometry (const unsigned int &) |
| unsigned long | getFieldAt (const unsigned int &, const Vector_t< double, 3 > &, const long &, const double &, Vector_t< double, 3 > &, Vector_t< double, 3 > &) |
| unsigned long | getFieldAt (const Vector_t< double, 3 > &, const Vector_t< double, 3 > &, const double &, Vector_t< double, 3 > &, Vector_t< double, 3 > &) |
| template<class T > | |
| void | visit (const T &, BeamlineVisitor &, PartBunch_t &) |
| void | prepareSections () |
| void | positionElementRelative (std::shared_ptr< ElementBase >) |
| void | compute3DLattice () |
| void | save3DLattice () |
| void | save3DInput () |
| void | print (Inform &) const |
| void | apply (const Vector_t< double, 3 > &R, const Vector_t< double, 3 > &, const double &t, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) |
| FieldList | getElementByType (ElementType) |
| void | swap (OpalBeamline &rhs) |
| void | merge (OpalBeamline &rhs) |
| template<> | |
| void | visit (const Marker &, BeamlineVisitor &, PartBunch_t &) |
Private Types | |
| using | PlacementAssembly = std::map< const ElementBase *, PlacedElement > |
Private Member Functions | |
| void | setNominalPlacement (const std::shared_ptr< ElementBase > &element, const CoordinateSystemTrafo &parentToBody) |
| Update the nominal rigid placement transform of one element. | |
| void | storePlacedElement (const std::shared_ptr< ElementBase > &element) |
| Refresh the beamline-owned placed-element assembly record. | |
| void | compileCompatibilityPlacement () |
| Compile legacy reference-order placement into explicit nominal poses. | |
Private Attributes | |
| FieldList | elements_m |
| PlacementAssembly | placementAssembly_m |
| bool | prepared_m |
| bool | compatibilityPlacementCompiled_m |
| CoordinateSystemTrafo | coordTransformationTo_m |
Definition at line 41 of file OpalBeamline.h.
|
private |
Definition at line 131 of file OpalBeamline.h.
| OpalBeamline::OpalBeamline | ( | ) |
Definition at line 31 of file OpalBeamline.cpp.
| OpalBeamline::OpalBeamline | ( | const Vector_t< double, 3 > & | origin, |
| const Quaternion & | rotation | ||
| ) |
Definition at line 37 of file OpalBeamline.cpp.
| OpalBeamline::~OpalBeamline | ( | ) |
Definition at line 44 of file OpalBeamline.cpp.
References elements_m.
| void OpalBeamline::activateElements | ( | ) |
Definition at line 610 of file OpalBeamline.cpp.
References elements_m.
Referenced by ParallelTracker::execute().
| void OpalBeamline::apply | ( | const Vector_t< double, 3 > & | R, |
| const Vector_t< double, 3 > & | , | ||
| const double & | t, | ||
| Vector_t< double, 3 > & | E, | ||
| Vector_t< double, 3 > & | B | ||
| ) |
|
private |
Compile legacy reference-order placement into explicit nominal poses.
This setup-stage bridge consumes the compatibility placement encoded via ELEMEDGE and converts it once into nominal rigid placement transforms \(T_i\) stored on the elements. Existing callers may still invoke compute3DLattice(), but new code should treat this as a setup conversion, not as a runtime geometry query.
Definition at line 199 of file OpalBeamline.cpp.
References compatibilityPlacementCompiled_m, Quaternion::conjugate(), coordTransformationTo_m, elements_m, euclidean_norm(), BendBase::getBendAngle(), BendBase::getChordLength(), BendBase::getDesignPath(), BendBase::getEntranceAngle(), ElementBase::getRotationAboutZ(), Options::idealized, RBEND, RBEND3D, Quaternion::rotate(), SBEND, setNominalPlacement(), and SOURCE.
Referenced by compute3DLattice(), and prepareSections().

| void OpalBeamline::compute3DLattice | ( | ) |
Definition at line 361 of file OpalBeamline.cpp.
References compileCompatibilityPlacement().
Referenced by ParallelTracker::prepareSections(), TEST_F(), TEST_F(), and TEST_F().

| BoundaryGeometry * OpalBeamline::getBoundaryGeometry | ( | const unsigned int & | ) |
|
inline |
Definition at line 244 of file OpalBeamline.h.
References coordTransformationTo_m.
Referenced by getElements(), and save3DInput().
|
inline |
Return the nominal rigid placement transform \(T_i\).
In the language of the placement note, this is the nominal rigid placement transform from the parent/reference base into the element body frame. During the bridge stage this remains identical to the legacy lab-to-local transform storage.
Definition at line 239 of file OpalBeamline.h.
References PlacedElement::getNominalBodyTransform(), and getPlacedElement().
Referenced by ParallelTracker::computeExternalFields(), ParallelTracker::emitFromEmissionSources(), ParallelTracker::execute(), OrbitThreader::integrate(), ParallelTracker::markBackwardParticlesAtSourcePlane(), TEST_F(), TEST_F(), and ParallelTracker::updateReferenceParticles().

| FieldList OpalBeamline::getElementByType | ( | ElementType | type | ) |
Definition at line 162 of file OpalBeamline.cpp.
References ANY, and elements_m.
Referenced by OrbitThreader::computeBoundingBox(), OrbitThreader::execute(), and ParallelTracker::updateRFElement().
| std::set< std::shared_ptr< Component > > OpalBeamline::getElements | ( | ) |
Get all elements in the beamline, regardless of their position.
Definition at line 62 of file OpalBeamline.cpp.
References elements_m.
Referenced by getFieldAt().
| std::set< std::shared_ptr< Component > > OpalBeamline::getElements | ( | const Vector_t< double, 3 > & | x | ) |
Definition at line 46 of file OpalBeamline.cpp.
References elements_m, getCSTrafoLab2Local(), and CoordinateSystemTrafo::transformTo().
Referenced by ParallelTracker::autophaseCavities(), OrbitThreader::execute(), ParallelTracker::execute(), OrbitThreader::integrate(), TEST_F(), TEST_F(), TEST_F(), OrbitThreader::trackBack(), and ParallelTracker::updateReferenceParticles().

| double OpalBeamline::getEnd | ( | const Vector_t< double, 3 > & | ) | const |
| unsigned long OpalBeamline::getFieldAt | ( | const unsigned int & | , |
| const Vector_t< double, 3 > & | , | ||
| const long & | , | ||
| const double & | , | ||
| Vector_t< double, 3 > & | , | ||
| Vector_t< double, 3 > & | |||
| ) |
Definition at line 70 of file OpalBeamline.cpp.
Referenced by ParallelTracker::writePhaseSpace().
| unsigned long OpalBeamline::getFieldAt | ( | const Vector_t< double, 3 > & | position, |
| const Vector_t< double, 3 > & | momentum, | ||
| const double & | t, | ||
| Vector_t< double, 3 > & | Ef, | ||
| Vector_t< double, 3 > & | Bf | ||
| ) |
Definition at line 78 of file OpalBeamline.cpp.
References getElements(), MARKER, rotateFromLocalCS(), rotateToLocalCS(), and transformToLocalCS().

|
inline |
Definition at line 248 of file OpalBeamline.h.
References PlacedElement::getMisalignment(), Misalignment::getNominalToActual(), and getPlacedElement().
Referenced by ParallelTracker::computeExternalFields(), and TEST_F().

|
inline |
Definition at line 253 of file OpalBeamline.h.
References PlacedElement::getNominalEntryTransform(), and getPlacedElement().
Referenced by save3DLattice(), and TEST_F().

|
inline |
Definition at line 258 of file OpalBeamline.h.
References PlacedElement::getNominalExitTransform(), and getPlacedElement().
Referenced by save3DLattice(), and TEST_F().

| ParticleMatterInteractionHandler * OpalBeamline::getParticleMatterInteractionHandler | ( | const unsigned int & | ) |
|
inline |
Return the placed-element view used by the bridge stage.
This is the beamline-facing access point to the geometric placement record. It keeps nominal placement, local correction, and port geometry together while the legacy runtime still stores them on ElementBase.
Definition at line 231 of file OpalBeamline.h.
References placementAssembly_m.
Referenced by getCSTrafoLab2Local(), getMisalignment(), getNominalEntryTransform(), getNominalExitTransform(), rotateFromLocalCS(), rotateToLocalCS(), save3DLattice(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), transformFromLocalCS(), and transformToLocalCS().
| double OpalBeamline::getStart | ( | const Vector_t< double, 3 > & | ) | const |
| void OpalBeamline::merge | ( | OpalBeamline & | rhs | ) |
Definition at line 155 of file OpalBeamline.cpp.
References compatibilityPlacementCompiled_m, elements_m, placementAssembly_m, and prepared_m.
| void OpalBeamline::positionElementRelative | ( | std::shared_ptr< ElementBase > | element | ) |
Definition at line 176 of file OpalBeamline.cpp.
References coordTransformationTo_m, and setNominalPlacement().
Referenced by TEST_F(), and visit().

| void OpalBeamline::prepareSections | ( | ) |
Definition at line 132 of file OpalBeamline.cpp.
References compileCompatibilityPlacement(), elements_m, prepared_m, BeamlineFieldElement::SortAsc(), and storePlacedElement().
Referenced by ParallelTracker::prepareSections(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

| void OpalBeamline::print | ( | Inform & | ) | const |
Definition at line 145 of file OpalBeamline.cpp.
Definition at line 207 of file OpalBeamline.h.
References coordTransformationTo_m, and CoordinateSystemTrafo::rotateFrom().

|
inline |
Definition at line 226 of file OpalBeamline.h.
References PlacedElement::getNominalBodyTransform(), getPlacedElement(), and CoordinateSystemTrafo::rotateFrom().
Referenced by getFieldAt(), OrbitThreader::integrate(), and TEST_F().

Definition at line 203 of file OpalBeamline.h.
References coordTransformationTo_m, and CoordinateSystemTrafo::rotateTo().

|
inline |
Definition at line 221 of file OpalBeamline.h.
References PlacedElement::getNominalBodyTransform(), getPlacedElement(), and CoordinateSystemTrafo::rotateTo().
Referenced by ParallelTracker::autophaseCavities(), OrbitThreader::autophaseCavities(), getFieldAt(), OrbitThreader::integrate(), OrbitThreader::registerElement(), and TEST_F().

| void OpalBeamline::save3DInput | ( | ) |
Definition at line 550 of file OpalBeamline.cpp.
References Util::combineFilePath(), Quaternion::conjugate(), elements_m, OpalData::getAuxiliaryOutputDirectory(), getCSTrafoLab2Local(), OpalData::getInputBasename(), OpalData::getInstance(), CoordinateSystemTrafo::getOrigin(), CoordinateSystemTrafo::getRotation(), Util::getTaitBryantAngles(), and Units::rad2deg.
Referenced by ParallelTracker::prepareSections().

| void OpalBeamline::save3DLattice | ( | ) |
Definition at line 363 of file OpalBeamline.cpp.
References MeshGenerator::add(), OpalData::APPEND, Util::combineFilePath(), DRIFT, elements_m, OpalData::getAuxiliaryOutputDirectory(), BendBase::getBendAngle(), BendBase::getDesignPath(), OpalData::getInputBasename(), OpalData::getInstance(), PlacedElement::getNominalBodyTransform(), getNominalEntryTransform(), getNominalExitTransform(), OpalData::getOpenMode(), CoordinateSystemTrafo::getOrigin(), getPlacedElement(), MeshGenerator::getTransverseSupport(), BeamlineFieldElement::order_m, Units::rad2deg, RBEND, SBEND, MeshGenerator::setDriftReference(), BeamlineFieldElement::SortAsc(), CoordinateSystemTrafo::transformFrom(), and MeshGenerator::write().
Referenced by ParallelTracker::prepareSections(), TEST_F(), TEST_F(), and TEST_F().

|
private |
Update the nominal rigid placement transform of one element.
This is the write-side bridge from the legacy beamline assembly code to the new placement vocabulary. The stored quantity is the nominal rigid placement transform \(T_i\); local survey or misalignment corrections remain on the element and are not composed here.
Definition at line 189 of file OpalBeamline.cpp.
References storePlacedElement().
Referenced by compileCompatibilityPlacement(), and positionElementRelative().

|
private |
Refresh the beamline-owned placed-element assembly record.
Beamline assembly owns a snapshot of the geometric placement records used by placement/export queries. This keeps the assembled placement model distinct from the legacy storage that still lives on ElementBase during the bridge stage.
Definition at line 195 of file OpalBeamline.cpp.
References placementAssembly_m.
Referenced by prepareSections(), and setNominalPlacement().
| void OpalBeamline::swap | ( | OpalBeamline & | rhs | ) |
Definition at line 147 of file OpalBeamline.cpp.
References compatibilityPlacementCompiled_m, coordTransformationTo_m, elements_m, placementAssembly_m, and prepared_m.
| void OpalBeamline::switchElements | ( | const double & | min, |
| const double & | max, | ||
| const double & | kineticEnergy, | ||
| const bool & | nomonitors = false |
||
| ) |
Definition at line 112 of file OpalBeamline.cpp.
References elements_m.
| void OpalBeamline::switchElementsOff | ( | ) |
Definition at line 127 of file OpalBeamline.cpp.
References elements_m.
Referenced by ParallelTracker::execute().
Definition at line 199 of file OpalBeamline.h.
References coordTransformationTo_m, and CoordinateSystemTrafo::transformFrom().

|
inline |
Definition at line 216 of file OpalBeamline.h.
References PlacedElement::getNominalBodyTransform(), getPlacedElement(), and CoordinateSystemTrafo::transformFrom().
Referenced by TEST_F().

Definition at line 195 of file OpalBeamline.h.
References coordTransformationTo_m, and CoordinateSystemTrafo::transformTo().

|
inline |
Definition at line 211 of file OpalBeamline.h.
References PlacedElement::getNominalBodyTransform(), getPlacedElement(), and CoordinateSystemTrafo::transformTo().
Referenced by ParallelTracker::autophaseCavities(), OrbitThreader::autophaseCavities(), getFieldAt(), OrbitThreader::integrate(), OrbitThreader::registerElement(), and TEST_F().

|
inline |
Definition at line 192 of file OpalBeamline.h.
|
inline |
Definition at line 174 of file OpalBeamline.h.
References compatibilityPlacementCompiled_m, elements_m, placementAssembly_m, positionElementRelative(), and prepared_m.
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), ParallelTracker::visitConstantEFieldCavity(), ParallelTracker::visitDrift(), ParallelTracker::visitMarker(), ParallelTracker::visitMonitor(), ParallelTracker::visitMultipole(), ParallelTracker::visitMultipoleT(), ParallelTracker::visitRBend(), ParallelTracker::visitRFCavity(), ParallelTracker::visitSBend(), ParallelTracker::visitSolenoid(), and ParallelTracker::visitTravelingWave().

|
private |
Definition at line 168 of file OpalBeamline.h.
Referenced by compileCompatibilityPlacement(), merge(), swap(), and visit().
|
private |
Definition at line 170 of file OpalBeamline.h.
Referenced by compileCompatibilityPlacement(), getCSTrafoLab2Local(), positionElementRelative(), rotateFrom(), rotateTo(), swap(), transformFrom(), and transformTo().
|
private |
Definition at line 165 of file OpalBeamline.h.
Referenced by activateElements(), compileCompatibilityPlacement(), getElementByType(), getElements(), getElements(), merge(), prepareSections(), save3DInput(), save3DLattice(), swap(), switchElements(), switchElementsOff(), visit(), and ~OpalBeamline().
|
private |
Definition at line 166 of file OpalBeamline.h.
Referenced by getPlacedElement(), merge(), storePlacedElement(), swap(), and visit().
|
private |
Definition at line 167 of file OpalBeamline.h.
Referenced by merge(), prepareSections(), swap(), and visit().