OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TrackRun Class Reference

#include <TrackRun.h>

Inheritance diagram for TrackRun:
Inheritance graph
[legend]
Collaboration diagram for TrackRun:
Collaboration graph
[legend]

Public Member Functions

 TrackRun ()
 Exemplar constructor.
 
virtual ~TrackRun ()
 
virtual TrackRunclone (const std::string &name)
 Make clone.
 
virtual void execute ()
 Execute the command.
 
Informprint (Inform &os) const
 
- Public Member Functions inherited from Action
virtual ~Action ()
 
virtual bool canReplaceBy (Object *object)
 Test if replacement is allowed.
 
virtual const std::string getCategory () const
 Return the object category as a string.
 
virtual bool shouldTrace () const
 Trace flag.
 
virtual bool shouldUpdate () const
 Update flag.
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
void copyAttributes (const Object &)
 Copy attributes from another object.
 
virtual AttributefindAttribute (const std::string &name)
 Find an attribute by name.
 
virtual const AttributefindAttribute (const std::string &name) const
 Find an attribute by name.
 
virtual ObjectmakeTemplate (const std::string &, TokenStream &, Statement &)
 Macro handler function.
 
virtual ObjectmakeInstance (const std::string &name, Statement &, const Parser *)
 Macro handler function.
 
virtual void parse (Statement &)
 Parse the object.
 
virtual void parseShortcut (Statement &, bool eval=true)
 Parser for single-attribute commands.
 
virtual void print (std::ostream &) const
 Print the object.
 
virtual void printValue (std::ostream &) const
 
virtual void printHelp (std::ostream &) const
 Print help.
 
virtual void replace (Object *oldObject, Object *newObject)
 Replace references.
 
virtual void update ()
 Update this object.
 
bool isBuiltin () const
 True, if [b]this[/b] is a built-in object.
 
virtual bool isShared () const
 Shared flag.
 
virtual void setShared (bool)
 Set/reset shared flag.
 
void setDirty (bool)
 Set/reset the [b]modified[/b] flag.
 
bool isDirty () const
 True, if the [b]modified[/b] flag is set.
 
void setFlag (bool)
 Flag/unflag this object, e. g. to control output of objects for.
 
bool isFlagged () const
 True, if [b]this[/b] is flagged by setFlag(true).
 
const ObjectgetBaseObject () const
 Return the object's base type object.
 
const std::string & getOpalName () const
 Return object name.
 
ObjectgetParent () const
 Return parent pointer.
 
bool isTreeMember (const Object *subTree) const
 Test for tree membership.
 
void setOpalName (const std::string &name)
 Set object name.
 
void setParent (Object *)
 Set parent object.
 
void clear ()
 Clear the occurrence counter.
 
int increment ()
 Increment and return the occurrence counter.
 
int occurrenceCount ()
 Return the occurrence counter.
 
void registerReference (Invalidator *a)
 Register a reference to this object.
 
void unregisterReference (Invalidator *a)
 Unegister a reference to this object.
 
void registerOwnership (const AttributeHandler::OwnerType &itsClass) const
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count.
 
int removeReference () const
 Decrement the reference count.
 
bool isShared () const
 Test for sharing.
 

Static Public Member Functions

static std::shared_ptr< TrackergetTracker ()
 

Private Types

enum class  RunMethod : unsigned short { NONE , PARALLELT , CYCLOTRONT , THICK }
 

Private Member Functions

 TrackRun (const TrackRun &)
 
void operator= (const TrackRun &)
 
 TrackRun (const std::string &name, TrackRun *parent)
 
void setRunMethod ()
 
std::string getRunMethodName () const
 
void setupTTracker ()
 
void setupCyclotronTracker ()
 
void setupThickTracker ()
 
void setupFieldsolver ()
 
void initPhaseSpaceSink ()
 
void initDataSink (const int &numBunch=1)
 
void setBoundaryGeometry ()
 
double setDistributionParallelT (Beam *beam)
 

Private Attributes

Distributiondist_m
 
std::vector< Distribution * > distrs_m
 
FieldSolverfieldSolver_m
 
DataSinkdataSink_m
 
H5PartWrapperphaseSpaceSink_m
 
OpalDataopalData_m
 
bool isFollowupTrack_m
 
RunMethod method_m
 
double macromass_m
 
double macrocharge_m
 

Static Private Attributes

static constexpr std::array< std::pair< RunMethod, std::string_view >, 5 > runMethodMap
 
static std::shared_ptr< TrackeritsTracker_m = nullptr
 
static const std::string defaultDistribution
 

Additional Inherited Members

- Public Attributes inherited from Object
std::vector< AttributeitsAttr
 The object attributes.
 
- Protected Member Functions inherited from Action
 Action (int size, const char *name, const char *help)
 Constructor for exemplars.
 
 Action (const std::string &name, Action *parent)
 Constructor for cloning.
 
- Protected Member Functions inherited from Object
 Object (int size, const char *name, const char *help)
 Constructor for exemplars.
 
 Object (const std::string &name, Object *parent)
 Constructor for clones.
 
- Protected Member Functions inherited from RCObject
 RCObject ()
 Default constructor.
 
 RCObject (const RCObject &)
 Copy constructor.
 
virtual ~RCObject ()=0
 
RCObjectoperator= (const RCObject &right)
 
- Protected Attributes inherited from Object
bool builtin
 Built-in flag.
 
bool modified
 Dirty flag.
 
bool flagged
 Object flag.
 

Detailed Description

Definition at line 39 of file TrackRun.h.

Member Enumeration Documentation

◆ RunMethod

enum class TrackRun::RunMethod : unsigned short
strongprivate
Enumerator
NONE 
PARALLELT 
CYCLOTRONT 
THICK 

Definition at line 59 of file TrackRun.h.

Constructor & Destructor Documentation

◆ TrackRun() [1/3]

TrackRun::TrackRun ( )

◆ ~TrackRun()

TrackRun::~TrackRun ( )
virtual

Definition at line 148 of file TrackRun.cpp.

References phaseSpaceSink_m.

◆ TrackRun() [2/3]

TrackRun::TrackRun ( const TrackRun )
private

◆ TrackRun() [3/3]

TrackRun::TrackRun ( const std::string &  name,
TrackRun parent 
)
private

Definition at line 135 of file TrackRun.cpp.

References OpalData::getInstance(), and opalData_m.

Here is the call graph for this function:

Member Function Documentation

◆ clone()

TrackRun * TrackRun::clone ( const std::string &  name)
virtual

Make clone.

Implements Object.

Definition at line 152 of file TrackRun.cpp.

References name, and TrackRun().

Here is the call graph for this function:

◆ execute()

void TrackRun::execute ( )
virtual

◆ getRunMethodName()

std::string TrackRun::getRunMethodName ( ) const
private

Definition at line 248 of file TrackRun.cpp.

References Util::enumToString(), method_m, and runMethodMap.

Referenced by print().

Here is the call graph for this function:

◆ getTracker()

std::shared_ptr< Tracker > TrackRun::getTracker ( )
static

Definition at line 716 of file TrackRun.cpp.

References itsTracker_m.

Referenced by PyOpal::Field::get_field_value(), and PyOpal::Field::getRing().

◆ initDataSink()

void TrackRun::initDataSink ( const int &  numBunch = 1)
private

◆ initPhaseSpaceSink()

void TrackRun::initPhaseSpaceSink ( )
private

◆ operator=()

void TrackRun::operator= ( const TrackRun )
private

◆ print()

Inform & TrackRun::print ( Inform os) const

◆ setBoundaryGeometry()

void TrackRun::setBoundaryGeometry ( )
private

◆ setDistributionParallelT()

double TrackRun::setDistributionParallelT ( Beam beam)
private

◆ setRunMethod()

void TrackRun::setRunMethod ( )
private

Definition at line 239 of file TrackRun.cpp.

References Attributes::getString(), Object::itsAttr, method_m, NONE, runMethodMap, and Util::stringToEnum().

Referenced by execute().

Here is the call graph for this function:

◆ setupCyclotronTracker()

void TrackRun::setupCyclotronTracker ( )
private

getFrequency() gets RF frequency [MHz], NOT isochronous revolution frequency of particle! getCurrent() gets beamcurrent [A]

Definition at line 411 of file TrackRun.cpp.

References Track::block, Track::bunch, PartBunchBase< T, Dim >::calcBeamParameters(), dataSink_m, defaultDistribution, dist_m, Distribution::doRestartOpalCycl(), endl(), Physics::epsilon_0, BeamSequence::fetchLine(), fieldSolver_m, Distribution::find(), Beam::find(), H5PartWrapperForPC::getAzimuth(), Beam::getCharge(), Beam::getChargePerParticle(), Beam::getCurrent(), H5PartWrapperForPC::getElevation(), Beam::getFrequency(), Beam::getMass(), Beam::getMassPerParticle(), H5PartWrapperForPC::getMeanMomentum(), Beam::getNumberOfParticles(), Beam::getParticleName(), H5PartWrapperForPC::getPreviousH5Local(), Attributes::getReal(), H5PartWrapperForPC::getReferencePr(), H5PartWrapperForPC::getReferencePt(), H5PartWrapperForPC::getReferencePz(), H5PartWrapperForPC::getReferenceR(), H5PartWrapperForPC::getReferenceT(), H5PartWrapperForPC::getReferenceZ(), OpalData::getRestartStep(), Attributes::getString(), Attributes::getStringArray(), gmsg, initDataSink(), initPhaseSpaceSink(), OpalData::inRestartRun(), isFollowupTrack_m, Object::itsAttr, itsTracker_m, Track::localTimeSteps, macrocharge_m, macromass_m, Units::MHz2Hz, opalData_m, phaseSpaceSink_m, Physics::pi, PartBunchBase< T, Dim >::POrigin, Physics::q_e, Track::reference, REGULAR, ParallelCyclotronTracker::setBeGa(), setBoundaryGeometry(), PartBunchBase< T, Dim >::setCharge(), PartBunchBase< T, Dim >::setCouplingConstant(), PartBunchBase< T, Dim >::setDistribution(), PartBunchBase< T, Dim >::setdT(), OpalData::setInOPALCyclMode(), ParallelCyclotronTracker::setLastDumpedStep(), PartBunchBase< T, Dim >::setMass(), ParallelCyclotronTracker::setPhi(), ParallelCyclotronTracker::setPr(), ParallelCyclotronTracker::setPreviousH5Local(), ParallelCyclotronTracker::setPsi(), ParallelCyclotronTracker::setPt(), PartBunchBase< T, Dim >::setPType(), ParallelCyclotronTracker::setPz(), ParallelCyclotronTracker::setR(), PartBunchBase< T, Dim >::setStepsPerTurn(), ParallelCyclotronTracker::setTheta(), setupFieldsolver(), ParallelCyclotronTracker::setZ(), Track::timeIntegrator, and Track::use.

Referenced by execute().

◆ setupFieldsolver()

void TrackRun::setupFieldsolver ( )
private

◆ setupThickTracker()

void TrackRun::setupThickTracker ( )
private

◆ setupTTracker()

void TrackRun::setupTTracker ( )
private

Member Data Documentation

◆ dataSink_m

DataSink* TrackRun::dataSink_m
private

Definition at line 106 of file TrackRun.h.

Referenced by initDataSink(), setupCyclotronTracker(), setupThickTracker(), and setupTTracker().

◆ defaultDistribution

const std::string TrackRun::defaultDistribution
staticprivate

Definition at line 114 of file TrackRun.h.

Referenced by setDistributionParallelT(), and setupCyclotronTracker().

◆ dist_m

Distribution* TrackRun::dist_m
private

◆ distrs_m

std::vector<Distribution*> TrackRun::distrs_m
private

Definition at line 102 of file TrackRun.h.

Referenced by setDistributionParallelT().

◆ fieldSolver_m

FieldSolver* TrackRun::fieldSolver_m
private

◆ isFollowupTrack_m

bool TrackRun::isFollowupTrack_m
private

◆ itsTracker_m

std::shared_ptr< Tracker > TrackRun::itsTracker_m = nullptr
staticprivate

◆ macrocharge_m

double TrackRun::macrocharge_m
private

Definition at line 120 of file TrackRun.h.

Referenced by print(), setupCyclotronTracker(), setupThickTracker(), and setupTTracker().

◆ macromass_m

double TrackRun::macromass_m
private

Definition at line 119 of file TrackRun.h.

Referenced by print(), setupCyclotronTracker(), and setupTTracker().

◆ method_m

RunMethod TrackRun::method_m
private

Definition at line 116 of file TrackRun.h.

Referenced by execute(), getRunMethodName(), print(), and setRunMethod().

◆ opalData_m

OpalData* TrackRun::opalData_m
private

◆ phaseSpaceSink_m

H5PartWrapper* TrackRun::phaseSpaceSink_m
private

◆ runMethodMap

constexpr std::array<std::pair<RunMethod, std::string_view>, 5> TrackRun::runMethodMap
inlinestaticconstexprprivate
Initial value:

Definition at line 66 of file TrackRun.h.

Referenced by getRunMethodName(), and setRunMethod().


The documentation for this class was generated from the following files: