|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Implements the main time-based simulation loop for parallel tracking. More...
#include <ParallelTracker.h>
Public Types | |
| enum | { X , PX , Y , PY , T , PT } |
Public Member Functions | |
| ParallelTracker (const Beamline &bl, bool revBeam) | |
| Construct tracker with beamline only (no bunch attached here). | |
| ParallelTracker (const Beamline &bl, PartBunch_t &bunch, DataSink *ds, bool revBeam, const std::vector< unsigned long long > &maxSTEPS, double zstart, const std::vector< double > &zstop, const std::vector< double > &dt, const std::vector< std::vector< std::shared_ptr< SamplingBase > > > &emittingSamplers={}) | |
| Construct tracker with bunch, output sink, and step-size schedule. | |
| virtual | ~ParallelTracker () |
| Destructor; releases tracker resources. | |
| virtual void | visitBeamline (const Beamline &) |
| Visit the full beamline (iterates elements into OpalBeamline). Overrides DefaultVisitor. | |
| virtual void | visitComponent (const Component &) |
| Visit a generic component using the base tracker behavior. | |
| virtual void | visitConstantEFieldCavity (const ConstantEFieldCavity &) |
| Apply the algorithm to a constant E-field cavity. | |
| virtual void | visitDrift (const Drift &) |
| Apply the algorithm to a drift. | |
| virtual void | visitLaser (const Laser &) |
| Reject laser tracking until dedicated laser tracking is implemented. | |
| virtual void | visitMonitor (const Monitor &) |
| Apply the algorithm to a monitor. | |
| virtual void | visitMarker (const Marker &) |
| Apply the algorithm to a marker. | |
| virtual void | visitMultipole (const Multipole &) |
| Apply the algorithm to a multipole. | |
| virtual void | visitMultipoleT (const MultipoleT &) |
| Apply the algorithm to a multipole (templated type). | |
| virtual void | visitRBend (const RBend &) |
| Apply the algorithm to a rectangular bend. | |
| virtual void | visitRFCavity (const RFCavity &) |
| Apply the algorithm to an RF cavity. | |
| virtual void | visitSBend (const SBend &) |
| Apply the algorithm to a sector bend. | |
| virtual void | visitTravelingWave (const TravelingWave &) |
| Apply the algorithm to a traveling wave cavity. | |
| virtual void | visitSolenoid (const Solenoid &) |
| Apply the algorithm to a solenoid. | |
| virtual void | execute () |
| Run the main tracking loop until all step-size segments complete. | |
| void | kickParticles (const BorisPusher &pusher, PartBunch_t::ParticleContainer_t &pc) |
| Boris half-kick using E, B and per-particle dt on one container. | |
| void | pushParticles (const BorisPusher &pusher, PartBunch_t::ParticleContainer_t &pc) |
| Boris position push (unitless positions) on one container. | |
| void | timeIntegration1 (BorisPusher &pusher) |
| First half of the leapfrog step: push all active containers. | |
| void | timeIntegration2 (BorisPusher &pusher) |
| Second half: kick then push all active containers. | |
| void | evolveSpinTBMT () |
| Thomas-BMT spin precession across all active containers that store Pol. Must be called after external + space-charge fields have been accumulated and before the momentum kick (so E, B at the particle are the lab-frame fields the particle sees during this step). | |
| void | computeSpaceChargeFields (unsigned long long step) |
| Self-fields in beam frame (primary container); optional binary repartition. | |
| void | computeExternalFields (OrbitThreader &oth) |
| Apply external fields from elements intersecting each active container. | |
| void | emitFromEmissionSources (double t, double dt) |
| Emit macroparticles from configured samplers per container. | |
| size_t | applyGlobalProcesses (double dt) |
| Apply global processes and return the global number of particles marked invalid. | |
| void | resetFields () |
| Zero E and B on all active particle containers. | |
| void | changeDT () |
| Set bunch dt from StepSizeConfig and copy to all container dt views. | |
| void | setTime () |
| Reset per-particle dt views to the current global bunch dt. | |
| size_t | markBackwardParticlesAtSourcePlane () |
| Mark particles moving backward behind an active source/cathode plane. | |
| PartBunch_t & | getBunch () const |
| Return the currently attached borrowed bunch. | |
| void | addToBunch (const OpalParticle &) |
| Add particle to bunch. | |
| virtual void | setNumBunch (short) |
| set total number of tracked bunches | |
| virtual short | getNumBunch () |
| get total number of tracked bunches | |
| void | visitFlaggedElmPtr (const FlaggedElmPtr &) override |
| Apply the algorithm to a FlaggedElmPtr. | |
| void | visitRing (const Ring &) override |
| Apply the algorithm to a Ring. | |
| void | visitScalingFFAMagnet (const ScalingFFAMagnet &spiral) override |
| Apply the algorithm to a scaling FFA magnet. | |
| void | visitVerticalFFAMagnet (const VerticalFFAMagnet &) override |
| Apply the algorithm to a vertical FFA magnet. | |
| void | visitVariableRFCavity (const VariableRFCavity &) override |
| Apply the algorithm to a variable RF cavity. | |
| void | visitProbe (const Probe &prob) override |
| Apply the algorithm to a Probe. | |
Public Attributes | |
| FieldList | cavities_m |
| const Beamline & | itsBeamline_m |
Protected Attributes | |
| PartBunch_t * | itsBunch_m |
| The bunch of particles to be tracked. Borrowed; lifetime is managed by TrackRun. | |
| const Beamline & | itsLine |
| bool | back_beam |
| bool | back_track |
| bool | back_path |
| double | flip_B |
| double | flip_s |
Private Member Functions | |
| void | updateReference (const BorisPusher &pusher) |
| Update reference trajectories and lab/reference coordinate transforms. | |
| void | updateReferenceParticles (const BorisPusher &pusher) |
| Advance reference positions/momenta through the beamline for one step. | |
| void | updateRefToLabCSTrafo () |
| Refresh each container's reference-to-lab transform from current state. | |
| void | writePhaseSpace (const long long step, bool psDump, bool statDump) |
| Write phase space and/or statistics when flags request it. | |
| void | dumpStats (long long step, bool psDump, bool statDump) |
| Log per-container stats and trigger dumps according to dump flags. | |
| void | prepareSections () |
| Accept beamline visitor, prepare sections, compute and save 3D lattice. | |
| void | selectDT () |
| Set global bunch dt to dtCurrentTrack_m. | |
| void | setOptionalVariables () |
| Load REPARTFREQ and related options from input. | |
| bool | hasEndOfLineReached (const BoundingBox &globalBoundingBox) |
| Whether tracking should stop at end-of-line (global reduction). | |
| void | doBinaryRepartition () |
| Trigger binary repartition for the field solver if configured. | |
| size_t | deleteInvalidParticles (bool activeOnly, Inform &m, const std::string &reason) |
| Delete particles marked invalid by the central per-container mask. | |
| void | activateEmittingContainers (double t) |
| Force-activate containers whose emitting samplers have not yet finished. | |
| void | computeInitialBounds (Vector_t< double, 3 > &rmin, Vector_t< double, 3 > &rmax) |
| Union of per-container spatial bounds over MPI. | |
| void | printInitialContainerRefs (Inform &m) const |
| Log reference state for each container at track start. | |
| void | findStartPositions (const BorisPusher &pusher) |
| Integrate references in time until path length reaches zstart_m. | |
| void | autophaseCavities (const BorisPusher &pusher) |
| Autophase TRAVELINGWAVE and RFCAVITY elements along the reference orbit. | |
| void | updateRFElement (std::string elName, double maxPhi) |
| Set stored RF phase on the named cavity or traveling-wave element. | |
| void | printRFPhases () |
| Print RF phases (debug/diagnostic hook). | |
| void | saveCavityPhases () |
| Persist cavity phases to the data sink. | |
| void | restoreCavityPhases () |
| Restore cavity phases from a prior track or restart. | |
| virtual void | applyDefault (const ElementBase &) |
Private Attributes | |
| DataSink * | itsDataSink_m |
| Borrowed beam statistics and phase-space output sink. | |
| OpalBeamline | itsOpalBeamline_m |
| Cloned field elements and coordinate transforms. | |
| bool | globalEOL_m |
| End-of-line flag (e.g. orbit threader out of bounds). | |
| double | zstart_m |
| Path-length start position for the track (m). | |
| StepSizeConfig | stepSizes_m |
| double | dtCurrentTrack_m |
| Global \(\Delta t\) for the current track segment. | |
| unsigned long long | repartFreq_m |
| Space-charge repartition period (steps); 0 disables it. | |
| std::vector< std::vector< std::shared_ptr< SamplingBase > > > | emittingSamplers_m |
| Per-container emitters. | |
| IpplTimings::TimerRef | timeIntegrationTimer1_m |
| IpplTimings::TimerRef | timeIntegrationTimer2_m |
| IpplTimings::TimerRef | fieldEvaluationTimer_m |
| IpplTimings::TimerRef | WakeFieldTimer_m |
| IpplTimings::TimerRef | PluginElemTimer_m |
| IpplTimings::TimerRef | BinRepartTimer_m |
| IpplTimings::TimerRef | OrbThreader_m |
| bool | local_flip |
Implements the main time-based simulation loop for parallel tracking.
Definition at line 71 of file ParallelTracker.h.
|
inherited |
| Enumerator | |
|---|---|
| X | |
| PX | |
| Y | |
| PY | |
| T | |
| PT | |
Definition at line 36 of file AbstractTracker.h.
|
explicit |
Construct tracker with beamline only (no bunch attached here).
Construct tracker from a beamline only (see class constructor overload).
| bl | Beamline definition. |
| revBeam | If true, reversed beam direction (s = C to 0); OPAL-T parallel tracking is forward-only; revTrack is not used. |
Definition at line 70 of file ParallelTracker.cpp.
|
explicit |
Construct tracker with bunch, output sink, and step-size schedule.
Construct tracker with bunch, data sink, z-segments, and optional emitters.
| bl | Beamline definition. |
| bunch | Borrowed particle bunch (multi-container). |
| ds | Borrowed data sink for statistics and dumps. |
| revBeam | Reversed beam flag (see single-argument constructor). |
| maxSTEPS | Max integration steps per z-segment (parallel to zstop/dt). |
| zstart | Starting path length (m). |
| zstop | Stop path length per segment (m). |
| dt | Time step per segment (s). |
| emittingSamplers | Optional per-container samplers for emitParticles(t, dt). |
Definition at line 88 of file ParallelTracker.cpp.
References StepSizeConfig::push_back(), StepSizeConfig::resetIterator(), StepSizeConfig::sortAscendingZStop(), and stepSizes_m.
|
virtual |
Destructor; releases tracker resources.
Destructor; releases tracker resources.
Definition at line 117 of file ParallelTracker.cpp.
|
private |
Force-activate containers whose emitting samplers have not yet finished.
Force-activate containers whose emitting samplers have not yet finished.
Definition at line 1150 of file ParallelTracker.cpp.
References emittingSamplers_m, Tracker::itsBunch_m, and PartBunch< T, Dim >::setPcActive().
Referenced by execute().
|
inherited |
|
privatevirtualinherited |
Definition at line 113 of file DefaultVisitor.cpp.
Referenced by DefaultVisitor::visitComponent(), DefaultVisitor::visitConstantEFieldCavity(), DefaultVisitor::visitDrift(), DefaultVisitor::visitLaser(), DefaultVisitor::visitMarker(), DefaultVisitor::visitMonitor(), DefaultVisitor::visitMultipole(), DefaultVisitor::visitMultipoleT(), DefaultVisitor::visitProbe(), DefaultVisitor::visitRBend(), DefaultVisitor::visitRFCavity(), DefaultVisitor::visitRing(), DefaultVisitor::visitSBend(), DefaultVisitor::visitScalingFFAMagnet(), DefaultVisitor::visitSolenoid(), DefaultVisitor::visitTravelingWave(), DefaultVisitor::visitVariableRFCavity(), and DefaultVisitor::visitVerticalFFAMagnet().
| size_t ParallelTracker::applyGlobalProcesses | ( | double | dt | ) |
Apply global processes and return the global number of particles marked invalid.
Definition at line 837 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getGlobalTrackStep(), and Tracker::itsBunch_m.
Referenced by execute().
|
private |
Autophase TRAVELINGWAVE and RFCAVITY elements along the reference orbit.
Autophase TRAVELINGWAVE and RFCAVITY elements along the reference orbit.
Definition at line 1693 of file ParallelTracker.cpp.
References Physics::c, RFCavity::getAutophaseVeto(), PartBunch< T, Dim >::getdT(), OpalBeamline::getElements(), CavityAutophaser::getPhaseAtMaxEnergy(), PartBunch< T, Dim >::getReference(), PartBunch< T, Dim >::getT(), Tracker::itsBunch_m, itsOpalBeamline_m, BorisPusher::push(), RFCAVITY, OpalBeamline::rotateToLocalCS(), OpalBeamline::transformToLocalCS(), and TRAVELINGWAVE.
Referenced by findStartPositions().
| void ParallelTracker::changeDT | ( | ) |
Set bunch dt from StepSizeConfig and copy to all container dt views.
Set bunch dt from StepSizeConfig and copy to all container dt views.
Definition at line 1135 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getdT(), Tracker::itsBunch_m, and selectDT().
Referenced by execute(), and findStartPositions().
| void ParallelTracker::computeExternalFields | ( | OrbitThreader & | oth | ) |
Apply external fields from elements intersecting each active container.
Apply external fields from elements intersecting each active container.
| oth | Orbit threader for element queries. |
Definition at line 717 of file ParallelTracker.cpp.
References fieldEvaluationTimer_m, OpalBeamline::getCSTrafoLab2Local(), OpalBeamline::getMisalignment(), globalEOL_m, gmsg, CoordinateSystemTrafo::inverted(), PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, itsOpalBeamline_m, and OrbitThreader::query().
Referenced by execute().
|
private |
Union of per-container spatial bounds over MPI.
Union of per-container spatial bounds over MPI.
| [out] | rmin | Corner of the axis-aligned bounding box (min). |
| [out] | rmax | Corner of the axis-aligned bounding box (max). |
Definition at line 1175 of file ParallelTracker.cpp.
References Tracker::itsBunch_m.
Referenced by execute().
| void ParallelTracker::computeSpaceChargeFields | ( | unsigned long long | step | ) |
Self-fields in beam frame (primary container); optional binary repartition.
Self-fields in beam frame (primary container); optional binary repartition.
| step | Global step index (used for repartition cadence). |
Definition at line 636 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::bunchUpdate(), PartBunch< T, Dim >::calcBeamParameters(), PartBunch< T, Dim >::computeSelfFields(), Quaternion::conjugate(), doBinaryRepartition(), dot(), getQuaternion(), gmsg, PartBunch< T, Dim >::hasFieldSolver(), CoordinateSystemTrafo::inverted(), Tracker::itsBunch_m, PartBunch< T, Dim >::R(), repartFreq_m, CoordinateSystemTrafo::rotateBunchTo(), and CoordinateSystemTrafo::transformBunchTo().
Referenced by execute().
|
private |
Delete particles marked invalid by the central per-container mask.
Definition at line 860 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::isPcActive(), and Tracker::itsBunch_m.
Referenced by execute().
|
private |
Trigger binary repartition for the field solver if configured.
Trigger binary repartition for the field solver if configured.
Definition at line 1164 of file ParallelTracker.cpp.
Referenced by computeSpaceChargeFields().
|
private |
Log per-container stats and trigger dumps according to dump flags.
Log per-container stats and trigger dumps according to dump flags.
| step | Current integration step index. |
| psDump | Forwarded to writePhaseSpace when logging occurs. |
| statDump | Forwarded to writePhaseSpace when logging occurs. |
Definition at line 1424 of file ParallelTracker.cpp.
References Util::getEnergyString(), PartBunch< T, Dim >::getGlobalTrackStep(), Util::getLengthString(), PartBunch< T, Dim >::getT(), Util::getTimeString(), PartBunch< T, Dim >::getTotalNumAllContainers(), gmsg, Tracker::itsBunch_m, Options::stepInfoFreq, OPALTimer::Timer::time(), PartBunch< T, Dim >::updateMoments(), and writePhaseSpace().
Referenced by execute().
| void ParallelTracker::emitFromEmissionSources | ( | double | t, |
| double | dt | ||
| ) |
Emit macroparticles from configured samplers per container.
Emit macroparticles from configured samplers per container.
| t | Bunch time (s). |
| dt | Global time step (s). |
Definition at line 784 of file ParallelTracker.cpp.
References emittingSamplers_m, OpalBeamline::getCSTrafoLab2Local(), CoordinateSystemTrafo::inverted(), Tracker::itsBunch_m, itsOpalBeamline_m, PartBunch< T, Dim >::pcAtZStop(), PartBunch< T, Dim >::R(), and PartBunch< T, Dim >::refreshPcActiveAfterEmit().
Referenced by execute().
| void ParallelTracker::evolveSpinTBMT | ( | ) |
Thomas-BMT spin precession across all active containers that store Pol. Must be called after external + space-charge fields have been accumulated and before the momentum kick (so E, B at the particle are the lab-frame fields the particle sees during this step).
Definition at line 1045 of file ParallelTracker.cpp.
References SpinTBMTPusher::evolve(), PartData::getAnomaly(), PartData::getM(), PartData::getQ(), PartBunch< T, Dim >::isPcActive(), and Tracker::itsBunch_m.
Referenced by execute().
|
virtual |
Run the main tracking loop until all step-size segments complete.
Run the main tracking loop until all step-size segments complete.
Reimplemented from DefaultVisitor.
Definition at line 165 of file ParallelTracker.cpp.
References OpalBeamline::activateElements(), activateEmittingContainers(), StepSizeConfig::advanceToPos(), PartBunch< T, Dim >::anyPcActive(), applyGlobalProcesses(), Options::boundpDestroy, PartBunch< T, Dim >::bunchUpdate(), Physics::c, changeDT(), computeExternalFields(), computeInitialBounds(), computeSpaceChargeFields(), deleteInvalidParticles(), dot(), dtCurrentTrack_m, dumpStats(), emitFromEmissionSources(), emittingSamplers_m, euclidean_norm(), evolveSpinTBMT(), OrbitThreader::execute(), findStartPositions(), OrbitThreader::getBoundingBox(), FieldSolver< T, Dim >::getCallCounter(), OpalBeamline::getCSTrafoLab2Local(), StepSizeConfig::getdT(), PartBunch< T, Dim >::getdT(), OpalBeamline::getElements(), PartBunch< T, Dim >::getFieldSolver(), Util::getGamma(), OpalData::getGlobalPhaseShift(), PartBunch< T, Dim >::getGlobalTrackStep(), OpalData::getInstance(), Util::getLengthString(), PartData::getM(), StepSizeConfig::getMaxSteps(), StepSizeConfig::getMinTimeStep(), StepSizeConfig::getNumSteps(), PartData::getP(), PartBunch< T, Dim >::getReference(), PartBunch< T, Dim >::getT(), Util::getTimeString(), PartBunch< T, Dim >::getTotalNumAllContainers(), StepSizeConfig::getZStop(), globalEOL_m, gmsg, PartBunch< T, Dim >::hasFieldSolver(), PartBunch< T, Dim >::incrementT(), PartBunch< T, Dim >::incTrackSteps(), CoordinateSystemTrafo::inverted(), PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, itsOpalBeamline_m, markBackwardParticlesAtSourcePlane(), OrbThreader_m, PartBunch< T, Dim >::performBunchSanityChecks(), prepareSections(), StepSizeConfig::printDirect(), printInitialContainerRefs(), Options::psDumpFreq, StepSizeConfig::reachedEnd(), resetFields(), PartBunch< T, Dim >::resetPcActive(), CoordinateSystemTrafo::rotateTo(), selectDT(), PartBunch< T, Dim >::setdT(), setOptionalVariables(), PartBunch< T, Dim >::setPcAtZStop(), PartBunch< T, Dim >::setT(), setTime(), Options::statDumpFreq, stepSizes_m, OpalBeamline::switchElementsOff(), OPALTimer::Timer::time(), timeIntegration1(), timeIntegration2(), CoordinateSystemTrafo::transformTo(), updateReference(), DumpEMFields::writeFields(), writePhaseSpace(), and zstart_m.
|
private |
Integrate references in time until path length reaches zstart_m.
Integrate references in time until path length reaches zstart_m.
Definition at line 1328 of file ParallelTracker.cpp.
References autophaseCavities(), Physics::c, changeDT(), dtCurrentTrack_m, euclidean_norm(), StepSizeConfig::getdT(), PartBunch< T, Dim >::getdT(), Util::getGamma(), PartBunch< T, Dim >::getT(), StepSizeConfig::getZStop(), Tracker::itsBunch_m, StepSizeConfig::reachedEnd(), selectDT(), PartBunch< T, Dim >::setT(), stepSizes_m, updateReferenceParticles(), and zstart_m.
Referenced by execute().
|
inherited |
Return the currently attached borrowed bunch.
Definition at line 86 of file Tracker.cpp.
References Tracker::itsBunch_m.
|
inlinevirtualinherited |
|
private |
Whether tracking should stop at end-of-line (global reduction).
Whether tracking should stop at end-of-line (global reduction).
| globalBoundingBox | Spatial bounds from the orbit threader. |
Definition at line 1508 of file ParallelTracker.cpp.
References globalEOL_m, BoundingBox::isOutside(), and Tracker::itsBunch_m.
| void ParallelTracker::kickParticles | ( | const BorisPusher & | pusher, |
| PartBunch_t::ParticleContainer_t & | pc | ||
| ) |
Boris half-kick using E, B and per-particle dt on one container.
Boris velocity kick from E and B using per-particle dt.
| pusher | Boris pusher instance. |
| pc | Non-null particle container. |
| pusher | Boris pusher. |
| pc | Non-null target particle container. |
Definition at line 1008 of file ParallelTracker.cpp.
References ParticleContainer< T, Dim >::B, ParticleContainer< T, Dim >::dt, ParticleContainer< T, Dim >::E, PartData::getM(), PartData::getQ(), ParticleContainer< T, Dim >::getReference(), BorisPusher::kick(), ParticleContainer< T, Dim >::markMomentsDirty(), and ParticleContainer< T, Dim >::P.
Referenced by timeIntegration2().
| size_t ParallelTracker::markBackwardParticlesAtSourcePlane | ( | ) |
Mark particles moving backward behind an active source/cathode plane.
Definition at line 885 of file ParallelTracker.cpp.
References OpalBeamline::getCSTrafoLab2Local(), PartBunch< T, Dim >::getFieldSolver(), CoordinateSystemTrafo::getOrigin(), CoordinateSystemTrafo::getRotationMatrix(), BinnedFieldSolver< T, Dim >::isImageChargeEnabled(), PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, itsOpalBeamline_m, and prod_vector().
Referenced by execute().
|
private |
Accept beamline visitor, prepare sections, compute and save 3D lattice.
Accept beamline visitor, prepare sections, compute and save 3D lattice.
Definition at line 1083 of file ParallelTracker.cpp.
References ElementBase::accept(), OpalBeamline::compute3DLattice(), Tracker::itsBeamline_m, itsOpalBeamline_m, OpalBeamline::prepareSections(), OpalBeamline::save3DInput(), and OpalBeamline::save3DLattice().
Referenced by execute().
|
private |
Log reference state for each container at track start.
Log reference state for each container at track start.
| m | Inform stream for log output. |
Definition at line 1220 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getTotalNumAllContainers(), and Tracker::itsBunch_m.
Referenced by execute().
|
private |
Print RF phases (debug/diagnostic hook).
| void ParallelTracker::pushParticles | ( | const BorisPusher & | pusher, |
| PartBunch_t::ParticleContainer_t & | pc | ||
| ) |
Boris position push (unitless positions) on one container.
Boris position push in unitless coordinates (per-particle dt via pusher internals).
| pusher | Boris pusher instance. |
| pc | Non-null particle container. |
| pusher | Boris pusher. |
| pc | Non-null target particle container. |
Definition at line 973 of file ParallelTracker.cpp.
References ParticleContainer< T, Dim >::markMomentsDirty(), ParticleContainer< T, Dim >::P, BorisPusher::push(), ParticleContainer< T, Dim >::switchOffUnitlessPositions(), and ParticleContainer< T, Dim >::switchToUnitlessPositions().
Referenced by timeIntegration1(), and timeIntegration2().
| void ParallelTracker::resetFields | ( | ) |
Zero E and B on all active particle containers.
Zero E and B on all active particle containers.
Definition at line 953 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::isPcActive(), and Tracker::itsBunch_m.
Referenced by execute().
|
private |
Restore cavity phases from a prior track or restart.
Restore cavity phases from a prior track or restart.
Definition at line 1678 of file ParallelTracker.cpp.
References OpalData::getFirstMaxPhases(), OpalData::getInstance(), OpalData::getLastMaxPhases(), and updateRFElement().
|
private |
Persist cavity phases to the data sink.
Persist cavity phases to the data sink.
Definition at line 1673 of file ParallelTracker.cpp.
References itsDataSink_m, and DataSink::storeCavityInformation().
|
private |
Set global bunch dt to dtCurrentTrack_m.
Set global bunch dt to dtCurrentTrack_m.
Definition at line 1107 of file ParallelTracker.cpp.
References dtCurrentTrack_m, emittingSamplers_m, PartBunch< T, Dim >::getT(), Tracker::itsBunch_m, and PartBunch< T, Dim >::setdT().
Referenced by changeDT(), execute(), and findStartPositions().
|
inlinevirtualinherited |
|
private |
Load REPARTFREQ and related options from input.
Load REPARTFREQ and related options from input.
Definition at line 1470 of file ParallelTracker.cpp.
References OpalData::find(), OpalData::getInstance(), RealVariable::getReal(), Options::repartFreq, and repartFreq_m.
Referenced by execute().
| void ParallelTracker::setTime | ( | ) |
Reset per-particle dt views to the current global bunch dt.
Reset per-particle dt views to the current global bunch dt.
Definition at line 1521 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getdT(), and Tracker::itsBunch_m.
Referenced by execute().
| void ParallelTracker::timeIntegration1 | ( | BorisPusher & | pusher | ) |
First half of the leapfrog step: push all active containers.
First half of the leapfrog step: push all active containers.
Definition at line 575 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, pushParticles(), and timeIntegrationTimer1_m.
Referenced by execute().
| void ParallelTracker::timeIntegration2 | ( | BorisPusher & | pusher | ) |
Second half: kick then push all active containers.
Second half: kick then push all active containers.
Definition at line 596 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getdT(), PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, kickParticles(), pushParticles(), and timeIntegrationTimer2_m.
Referenced by execute().
|
private |
Update reference trajectories and lab/reference coordinate transforms.
Update reference trajectories and lab/reference coordinate transforms.
Definition at line 1245 of file ParallelTracker.cpp.
References updateReferenceParticles(), and updateRefToLabCSTrafo().
Referenced by execute().
|
private |
Advance reference positions/momenta through the beamline for one step.
Advance reference positions/momenta through the beamline for one step.
Definition at line 1255 of file ParallelTracker.cpp.
References Physics::c, OpalBeamline::getCSTrafoLab2Local(), PartBunch< T, Dim >::getdT(), OpalBeamline::getElements(), PartData::getM(), PartData::getQ(), PartBunch< T, Dim >::getT(), globalEOL_m, gmsg, PartBunch< T, Dim >::isPcActive(), Tracker::itsBunch_m, itsOpalBeamline_m, BorisPusher::kick(), BorisPusher::push(), CoordinateSystemTrafo::rotateFrom(), CoordinateSystemTrafo::rotateTo(), and CoordinateSystemTrafo::transformTo().
Referenced by findStartPositions(), and updateReference().
|
private |
Refresh each container's reference-to-lab transform from current state.
Refresh each container's reference-to-lab transform from current state.
Definition at line 1309 of file ParallelTracker.cpp.
References PartBunch< T, Dim >::getdT(), PartBunch< T, Dim >::isPcActive(), and Tracker::itsBunch_m.
Referenced by updateReference().
|
private |
Set stored RF phase on the named cavity or traveling-wave element.
Set stored RF phase on the named cavity or traveling-wave element.
| elName | Element name to match. |
| maxPhi | RF phase to apply (rad). |
Definition at line 1649 of file ParallelTracker.cpp.
References OpalBeamline::getElementByType(), ElementBase::getName(), itsOpalBeamline_m, RFCAVITY, RFCavity::setAutophaseVeto(), RFCavity::setPhasem(), and TRAVELINGWAVE.
Referenced by restoreCavityPhases().
|
virtual |
Visit the full beamline (iterates elements into OpalBeamline). Overrides DefaultVisitor.
Iterate beamline elements and dispatch into OpalBeamline.
| bl | Flagged beamline whose elements are visited. |
Reimplemented from DefaultVisitor.
Definition at line 142 of file ParallelTracker.cpp.
References TBeamline< T >::iterate().
|
virtual |
Visit a generic component using the base tracker behavior.
Visit a generic component using the base tracker behavior.
Reimplemented from Tracker.
Definition at line 123 of file ParallelTracker.cpp.
References Component::getType(), LASER, and Tracker::visitComponent().
|
inlinevirtual |
Apply the algorithm to a constant E-field cavity.
Reimplemented from DefaultVisitor.
Definition at line 315 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to a drift.
Reimplemented from DefaultVisitor.
Definition at line 319 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
overridevirtualinherited |
Apply the algorithm to a FlaggedElmPtr.
Implements BeamlineVisitor.
Reimplemented in Flagger, Replacer, and RangeSelector.
Definition at line 103 of file DefaultVisitor.cpp.
References ElementBase::accept(), ElmPtr::getElement(), FlaggedElmPtr::getReflectionFlag(), and DefaultVisitor::local_flip.
Referenced by RangeSelector::handleBeamline(), RangeSelector::handleElement(), Flagger::visitFlaggedElmPtr(), and Replacer::visitFlaggedElmPtr().

|
virtual |
Reject laser tracking until dedicated laser tracking is implemented.
Reimplemented from DefaultVisitor.
Definition at line 132 of file ParallelTracker.cpp.
|
inlinevirtual |
Apply the algorithm to a marker.
Reimplemented from DefaultVisitor.
Definition at line 327 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to a monitor.
Reimplemented from DefaultVisitor.
Definition at line 323 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to a multipole.
Reimplemented from DefaultVisitor.
Definition at line 331 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to a multipole (templated type).
Reimplemented from DefaultVisitor.
Definition at line 335 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
overridevirtualinherited |
Apply the algorithm to a Probe.
Implements BeamlineVisitor.
Definition at line 95 of file DefaultVisitor.cpp.
References DefaultVisitor::applyDefault().

|
inlinevirtual |
Apply the algorithm to a rectangular bend.
Reimplemented from DefaultVisitor.
Definition at line 339 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to an RF cavity.
Reimplemented from DefaultVisitor.
Definition at line 343 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
overridevirtualinherited |
Apply the algorithm to a Ring.
Implements BeamlineVisitor.
Definition at line 79 of file DefaultVisitor.cpp.
References DefaultVisitor::applyDefault().

|
inlinevirtual |
Apply the algorithm to a sector bend.
Reimplemented from DefaultVisitor.
Definition at line 347 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
overridevirtualinherited |
Apply the algorithm to a scaling FFA magnet.
Implements BeamlineVisitor.
Definition at line 89 of file DefaultVisitor.cpp.
References DefaultVisitor::applyDefault().

|
inlinevirtual |
Apply the algorithm to a solenoid.
Reimplemented from DefaultVisitor.
Definition at line 355 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
inlinevirtual |
Apply the algorithm to a traveling wave cavity.
Reimplemented from DefaultVisitor.
Definition at line 351 of file ParallelTracker.h.
References Tracker::itsBunch_m, itsOpalBeamline_m, and OpalBeamline::visit().
|
overridevirtualinherited |
Apply the algorithm to a variable RF cavity.
Implements BeamlineVisitor.
Definition at line 93 of file DefaultVisitor.cpp.
References DefaultVisitor::applyDefault().

|
overridevirtualinherited |
Apply the algorithm to a vertical FFA magnet.
Implements BeamlineVisitor.
Definition at line 91 of file DefaultVisitor.cpp.
References DefaultVisitor::applyDefault().

|
private |
Write phase space and/or statistics when flags request it.
Write phase space and/or statistics when flags request it.
| step | Step index (reserved for diagnostics; may be unused in body). |
| psDump | If true, write phase-space snapshot when applicable. |
| statDump | If true, write statistics (e.g. SDDS). |
Definition at line 1533 of file ParallelTracker.cpp.
References DataSink::dumpH5(), DataSink::dumpSDDS(), PartBunch< T, Dim >::get_bounds(), PartBunch< T, Dim >::getdT(), OpalBeamline::getFieldAt(), PartBunch< T, Dim >::getT(), PartBunch< T, Dim >::getTotalNumAllContainers(), gmsg, Tracker::itsBunch_m, itsDataSink_m, itsOpalBeamline_m, and Units::Vpm2MVpm.
Referenced by dumpStats(), and execute().
|
protectedinherited |
Definition at line 110 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor(), DefaultVisitor::execute(), and Tracker::visitComponent().
|
protectedinherited |
Definition at line 112 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor().
|
protectedinherited |
Definition at line 111 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor(), DefaultVisitor::execute(), and Tracker::visitComponent().
|
private |
Definition at line 92 of file ParallelTracker.h.
|
private |
Global \(\Delta t\) for the current track segment.
Definition at line 81 of file ParallelTracker.h.
Referenced by execute(), findStartPositions(), and selectDT().
|
private |
Per-container emitters.
Definition at line 84 of file ParallelTracker.h.
Referenced by activateEmittingContainers(), emitFromEmissionSources(), execute(), and selectDT().
|
private |
Definition at line 89 of file ParallelTracker.h.
Referenced by computeExternalFields().
|
protectedinherited |
Definition at line 115 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor().
|
protectedinherited |
Definition at line 116 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor().
|
private |
End-of-line flag (e.g. orbit threader out of bounds).
Definition at line 75 of file ParallelTracker.h.
Referenced by computeExternalFields(), execute(), hasEndOfLineReached(), and updateReferenceParticles().
|
inherited |
Definition at line 115 of file Tracker.h.
Referenced by prepareSections().
|
protectedinherited |
The bunch of particles to be tracked. Borrowed; lifetime is managed by TrackRun.
Definition at line 119 of file Tracker.h.
Referenced by activateEmittingContainers(), applyGlobalProcesses(), autophaseCavities(), changeDT(), computeExternalFields(), computeInitialBounds(), computeSpaceChargeFields(), deleteInvalidParticles(), dumpStats(), emitFromEmissionSources(), evolveSpinTBMT(), execute(), findStartPositions(), Tracker::getBunch(), hasEndOfLineReached(), markBackwardParticlesAtSourcePlane(), printInitialContainerRefs(), resetFields(), selectDT(), setTime(), timeIntegration1(), timeIntegration2(), updateReferenceParticles(), updateRefToLabCSTrafo(), Tracker::visitComponent(), visitConstantEFieldCavity(), visitDrift(), visitMarker(), visitMonitor(), visitMultipole(), visitMultipoleT(), visitRBend(), visitRFCavity(), visitSBend(), visitSolenoid(), visitTravelingWave(), and writePhaseSpace().
|
private |
Borrowed beam statistics and phase-space output sink.
Definition at line 73 of file ParallelTracker.h.
Referenced by saveCavityPhases(), and writePhaseSpace().
|
protectedinherited |
Definition at line 107 of file DefaultVisitor.h.
Referenced by DefaultVisitor::execute().
|
private |
Cloned field elements and coordinate transforms.
Definition at line 74 of file ParallelTracker.h.
Referenced by autophaseCavities(), computeExternalFields(), emitFromEmissionSources(), execute(), markBackwardParticlesAtSourcePlane(), prepareSections(), updateReferenceParticles(), updateRFElement(), visitConstantEFieldCavity(), visitDrift(), visitMarker(), visitMonitor(), visitMultipole(), visitMultipoleT(), visitRBend(), visitRFCavity(), visitSBend(), visitSolenoid(), visitTravelingWave(), and writePhaseSpace().
|
privateinherited |
Definition at line 130 of file DefaultVisitor.h.
Referenced by DefaultVisitor::DefaultVisitor(), DefaultVisitor::execute(), DefaultVisitor::visitBeamline(), and DefaultVisitor::visitFlaggedElmPtr().
|
private |
Definition at line 93 of file ParallelTracker.h.
Referenced by execute().
|
private |
Definition at line 91 of file ParallelTracker.h.
|
private |
Space-charge repartition period (steps); 0 disables it.
Definition at line 82 of file ParallelTracker.h.
Referenced by computeSpaceChargeFields(), and setOptionalVariables().
|
private |
Step-size segments: z-stop, dt, and steps per segment.
Definition at line 79 of file ParallelTracker.h.
Referenced by execute(), findStartPositions(), and ParallelTracker().
|
private |
Definition at line 87 of file ParallelTracker.h.
Referenced by timeIntegration1().
|
private |
Definition at line 88 of file ParallelTracker.h.
Referenced by timeIntegration2().
|
private |
Definition at line 90 of file ParallelTracker.h.
|
private |
Path-length start position for the track (m).
Definition at line 76 of file ParallelTracker.h.
Referenced by execute(), and findStartPositions().