22#ifndef OPAL_ParallelTracker_HH
23#define OPAL_ParallelTracker_HH
56class ParticleMatterInteractionHandler;
138 bool revTrack,
const std::vector<unsigned long long>& maxSTEPS,
double zstart,
139 const std::vector<double>& zstop,
const std::vector<double>& dt);
191 void changeDT(
bool backTrack =
false);
239 void writePhaseSpace(
const long long step,
bool psDump,
bool statDump);
251 void selectDT(
bool backTrack =
false);
258 void dumpStats(
long long step,
bool psDump,
bool statDump);
318 KOKKOS_LAMBDA(
const size_t i) {
347 pusher.
kick(0, p, Efview(i), Bfview(i), 0, mass, charge);
367 KOKKOS_LAMBDA(
const size_t i) {
379 pusher.
push(x, Pview(i), 0);
RangePolicy< View::rank, typenameView::execution_space, PolicyArgs... >::policy_type getRangePolicy(const View &view, int shift=0)
void mult(Field &u, const double c)
void parallel_for(const std::string &name, const ExecPolicy &policy, const FunctorType &functor)
std::unique_ptr< mpi::Communicator > Comm
Interface for a single beam element.
Interface for drift space.
Interface for general multipole.
Ring describes a ring type geometry for tracking.
Sector bending magnet with an FFA-style field index and spiral end shape.
Bending magnet with an exponential dependence on field in the vertical plane.
double getMassPerParticle() const
void switchToUnitlessPositions(bool use_dt_per_particle=false)
std::shared_ptr< ParticleContainer_t > getParticleContainer()
double getChargePerParticle() const
get the macro particle charge
void switchOffUnitlessPositions(bool use_dt_per_particle=false)
std::set< std::shared_ptr< Component > > value_t
virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &bend)
Apply the algorithm to a scaling FFA.
ParallelTracker(const ParallelTracker &)
void pushParticles(const BorisPusher &pusher)
void emitParticles(long long step)
void updateRFElement(std::string elName, double maxPhi)
void changeDT(bool backTrack=false)
std::vector< int > ivector_t
IpplTimings::TimerRef BinRepartTimer_m
void restoreCavityPhases()
virtual void visitSolenoid(const Solenoid &)
Apply the algorithm to a RF cavity.
std::list< type_pair * > beamline_list
virtual void visitOffset(const Offset &)
Apply the algorithm to a offset (placement).
beamline_list FieldDimensions
void doBinaryRepartition()
void updateRefToLabCSTrafo()
void autophaseCavities(const BorisPusher &pusher)
double bega
The reference variables.
std::set< ParticleMatterInteractionHandler * > activeParticleMatterInteractionHandlers_m
IpplTimings::TimerRef WakeFieldTimer_m
bool applyPluginElements(const double dt)
IpplTimings::TimerRef OrbThreader_m
virtual void visitMultipole(const Multipole &)
Apply the algorithm to a multipole.
bool particleMatterStatus_m
virtual void visitDrift(const Drift &)
Apply the algorithm to a drift space.
virtual void execute()
Apply the algorithm to the top-level beamline.
std::vector< PluginElement * > pluginElements_m
void kickParticles(const BorisPusher &pusher)
virtual void visitMultipoleT(const MultipoleT &)
Apply the algorithm to an arbitrary multipole.
std::vector< double > dvector_t
void setOptionalVariables()
unsigned long long repartFreq_m
void transformBunch(const CoordinateSystemTrafo &trafo)
virtual void visitRing(const Ring &ring)
Apply the algorithm to a ring.
void writePhaseSpace(const long long step, bool psDump, bool statDump)
void timeIntegration2(BorisPusher &pusher)
void computeWakefield(IndexMap::value_t &elements)
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
double zstart_m
where to start
size_t numParticlesInSimulation_m
void applyFractionalStep(const BorisPusher &pusher, double tau)
std::list< Component * > myElements
void updateReference(const BorisPusher &pusher)
void updateReferenceParticle(const BorisPusher &pusher)
void buildupFieldList(double BcParameter[], ElementType elementType, Component *elptr)
IpplTimings::TimerRef timeIntegrationTimer2_m
void computeExternalFields(OrbitThreader &oth)
unsigned int emissionSteps_m
virtual void visitTravelingWave(const TravelingWave &)
Apply the algorithm to a traveling wave.
void computeSpaceChargeFields(unsigned long long step)
std::pair< ElementType, element_pair > type_pair
bool hasEndOfLineReached(const BoundingBox &globalBoundingBox)
std::pair< double[8], Component * > element_pair
WakeFunction * wakeFunction_m
void dumpStats(long long step, bool psDump, bool statDump)
void computeParticleMatterInteraction(IndexMap::value_t elements, OrbitThreader &oth)
void operator=(const ParallelTracker &)
IpplTimings::TimerRef timeIntegrationTimer1_m
IpplTimings::TimerRef PluginElemTimer_m
void selectDT(bool backTrack=false)
virtual void visitMarker(const Marker &)
Apply the algorithm to a marker.
void findStartPosition(const BorisPusher &pusher)
virtual void visitRFCavity(const RFCavity &)
Apply the algorithm to a RF cavity.
IpplTimings::TimerRef fieldEvaluationTimer_m
void timeIntegration1(BorisPusher &pusher)
StepSizeConfig stepSizes_m
stores informations where to change the time step and where to stop the simulation,...
virtual ~ParallelTracker()
OpalBeamline itsOpalBeamline_m
virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet &bend)
Apply the algorithm to a vertical FFA magnet.
PartBunch_t * itsBunch_m
The bunch of particles to be tracked.
An abstract sequence of beam line components.
void visit(const T &, BeamlineVisitor &, PartBunch_t *)
KOKKOS_INLINE_FUNCTION void kick(const Vector_t< double, 3 > &R, Vector_t< double, 3 > &P, const Vector_t< double, 3 > &Ef, const Vector_t< double, 3 > &Bf, const double &dt) const
KOKKOS_INLINE_FUNCTION void push(Vector_t< double, 3 > &R, const Vector_t< double, 3 > &P, const double &dt) const
Timing::TimerRef TimerRef