OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
OrbitThreader Class Reference

#include <OrbitThreader.h>

Collaboration diagram for OrbitThreader:
Collaboration graph
[legend]

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
 
OpalBeamlineitsOpalBeamline_m
 
IndexMap imap_m
 
unsigned int errorFlag_m
 
BorisPusher integrator_m
 
const PartDatareference_m
 
std::ofstream logger_m
 
size_t loggingFrequency_m
 
ElementBase::BoundingBox globalBoundingBox_m
 
std::multimap< std::string, elementPositionelementRegistry_m
 

Detailed Description

Definition at line 34 of file OrbitThreader.h.

Constructor & Destructor Documentation

◆ OrbitThreader()

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 
)

Member Function Documentation

◆ autophaseCavities()

void OrbitThreader::autophaseCavities ( const IndexMap::value_t activeSet,
const std::set< std::string > &  visitedElements 
)
private

◆ checkElementLengths()

void OrbitThreader::checkElementLengths ( const std::set< std::shared_ptr< Component >> &  elements)
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().

Here is the call graph for this function:

◆ computeBoundingBox()

void OrbitThreader::computeBoundingBox ( )
private

◆ computeDriftLengthToBoundingBox()

double OrbitThreader::computeDriftLengthToBoundingBox ( const std::set< std::shared_ptr< Component >> &  elements,
const Vector_t position,
const Vector_t direction 
) const
private

Definition at line 465 of file OrbitThreader.cpp.

References euclidean_norm(), ElementBase::BoundingBox::getPointOfIntersection(), globalBoundingBox_m, and max().

Referenced by execute(), and trackBack().

Here is the call graph for this function:

◆ containsCavity()

bool OrbitThreader::containsCavity ( const IndexMap::value_t activeSet)
private

Definition at line 275 of file OrbitThreader.cpp.

References end(), ElementBase::RFCAVITY, and ElementBase::TRAVELINGWAVE.

Referenced by execute().

Here is the call graph for this function:

◆ execute()

void OrbitThreader::execute ( )

◆ getMaxDesignEnergy()

double OrbitThreader::getMaxDesignEnergy ( const IndexMap::value_t elementSet) const
private

Definition at line 314 of file OrbitThreader.cpp.

References end(), RFCavity::getDesignEnergy(), max(), ElementBase::RFCAVITY, and ElementBase::TRAVELINGWAVE.

Here is the call graph for this function:

◆ getRange()

IndexMap::key_t OrbitThreader::getRange ( const IndexMap::value_t::value_type element,
double  position 
) const
inline

Definition at line 128 of file OrbitThreader.h.

References IndexMap::getRange(), and imap_m.

Referenced by ParallelTTracker::computeParticleMatterInteraction().

Here is the call graph for this function:

◆ getTouchingElements()

IndexMap::value_t OrbitThreader::getTouchingElements ( const IndexMap::key_t range) const
inline

Definition at line 134 of file OrbitThreader.h.

References IndexMap::getTouchingElements(), and imap_m.

Referenced by ParallelTTracker::computeParticleMatterInteraction().

Here is the call graph for this function:

◆ integrate()

void OrbitThreader::integrate ( const IndexMap::value_t activeSet,
double  maxDrift = 10.0 
)
private

◆ processElementRegister()

void OrbitThreader::processElementRegister ( )
private

Definition at line 386 of file OrbitThreader.cpp.

References ElementBase::ANY, elementRegistry_m, end(), OpalBeamline::getElementByType(), itsOpalBeamline_m, and name.

Referenced by execute().

Here is the call graph for this function:

◆ query()

IndexMap::value_t OrbitThreader::query ( IndexMap::key_t::first_type  step,
IndexMap::key_t::second_type  length 
)
inline

Definition at line 122 of file OrbitThreader.h.

References imap_m, and IndexMap::query().

Referenced by ParallelTTracker::computeExternalFields().

Here is the call graph for this function:

◆ registerElement()

void OrbitThreader::registerElement ( const IndexMap::value_t elementSet,
double  start,
const Vector_t r,
const Vector_t p 
)
private

◆ setDesignEnergy()

void OrbitThreader::setDesignEnergy ( FieldList allElements,
const std::set< std::string > &  visitedElements 
)
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().

Here is the call graph for this function:

◆ trackBack()

void OrbitThreader::trackBack ( )
private

◆ updateBoundingBoxWithCurrentPosition()

void OrbitThreader::updateBoundingBoxWithCurrentPosition ( )
private

Member Data Documentation

◆ distTrackBack_m

double OrbitThreader::distTrackBack_m
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().

◆ dt_m

double OrbitThreader::dt_m
private

◆ elementRegistry_m

std::multimap<std::string, elementPosition> OrbitThreader::elementRegistry_m
private

Definition at line 101 of file OrbitThreader.h.

Referenced by processElementRegister(), and registerElement().

◆ errorFlag_m

unsigned int OrbitThreader::errorFlag_m
private

Definition at line 79 of file OrbitThreader.h.

Referenced by execute(), and integrate().

◆ globalBoundingBox_m

ElementBase::BoundingBox OrbitThreader::globalBoundingBox_m
private

◆ imap_m

IndexMap OrbitThreader::imap_m
private

Definition at line 77 of file OrbitThreader.h.

Referenced by execute(), getRange(), getTouchingElements(), and query().

◆ integrator_m

BorisPusher OrbitThreader::integrator_m
private

Definition at line 81 of file OrbitThreader.h.

Referenced by execute(), integrate(), and trackBack().

◆ itsOpalBeamline_m

OpalBeamline& OrbitThreader::itsOpalBeamline_m
private

◆ logger_m

std::ofstream OrbitThreader::logger_m
private

Definition at line 84 of file OrbitThreader.h.

Referenced by integrate(), and OrbitThreader().

◆ loggingFrequency_m

size_t OrbitThreader::loggingFrequency_m
private

Definition at line 85 of file OrbitThreader.h.

Referenced by integrate(), and OrbitThreader().

◆ p_m

Vector_t OrbitThreader::p_m
private

◆ pathLength_m

double OrbitThreader::pathLength_m
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().

◆ r_m

Vector_t OrbitThreader::r_m
private

position of reference particle in lab coordinates

Definition at line 59 of file OrbitThreader.h.

Referenced by autophaseCavities(), execute(), integrate(), trackBack(), and updateBoundingBoxWithCurrentPosition().

◆ reference_m

const PartData& OrbitThreader::reference_m
private

Definition at line 82 of file OrbitThreader.h.

Referenced by autophaseCavities(), integrate(), and setDesignEnergy().

◆ stepSizes_m

StepSizeConfig OrbitThreader::stepSizes_m
private

final position in path length

Definition at line 73 of file OrbitThreader.h.

Referenced by checkElementLengths().

◆ time_m

double OrbitThreader::time_m
private

the simulated time

Definition at line 68 of file OrbitThreader.h.

Referenced by autophaseCavities(), and integrate().

◆ zstop_m

const double OrbitThreader::zstop_m
private

Definition at line 74 of file OrbitThreader.h.

Referenced by execute(), and integrate().


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