OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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, size_t maxIntegSteps, double zstop, OpalBeamline &bl)
 
void execute ()
 
IndexMap::value_t query (IndexMap::key_t::first_type step, IndexMap::key_t::second_type length)
 
std::pair< double, double > getRange (const IndexMap::value_t::value_type &element, double position) const
 
IndexMap::value_t getTouchingElements (const std::pair< double, double > &range)
 

Private Member Functions

void trackBack (double maxDrift)
 
void integrate (const IndexMap::value_t &activeSet, size_t maxSteps, 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)
 
double computeMaximalImplicitDrift ()
 

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...
 
const size_t maxIntegSteps_m
 the number of time steps to track More...
 
const double zstop_m
 final position in path length More...
 
OpalBeamlineitsOpalBeamline_m
 
IndexMap imap_m
 
unsigned int errorFlag_m
 
BorisPusher integrator_m
 
const PartDatareference_m
 
std::ofstream logger_m
 
size_t loggingFrequency_m
 
std::multimap< std::string,
elementPosition
elementRegistry_m
 

Detailed Description

Definition at line 12 of file OrbitThreader.h.

Constructor & Destructor Documentation

OrbitThreader::OrbitThreader ( const PartData ref,
const Vector_t r,
const Vector_t p,
double  s,
double  maxDiffZBunch,
double  t,
double  dT,
size_t  maxIntegSteps,
double  zstop,
OpalBeamline bl 
)

Member Function Documentation

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

Definition at line 224 of file OrbitThreader.cpp.

References ElementBase::RFCAVITY, and ElementBase::TRAVELINGWAVE.

Referenced by execute().

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

Definition at line 263 of file OrbitThreader.cpp.

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

Here is the call graph for this function:

std::pair< double, double > OrbitThreader::getRange ( const IndexMap::value_t::value_type element,
double  position 
) const
inline

Definition at line 100 of file OrbitThreader.h.

References IndexMap::getRange(), and imap_m.

Referenced by ParallelTTracker::computeParticleMatterInteraction().

Here is the call graph for this function:

IndexMap::value_t OrbitThreader::getTouchingElements ( const std::pair< double, double > &  range)
inline

Definition at line 106 of file OrbitThreader.h.

References IndexMap::getTouchingElements(), and imap_m.

Referenced by ParallelTTracker::computeParticleMatterInteraction().

Here is the call graph for this function:

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

Definition at line 334 of file OrbitThreader.cpp.

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

Referenced by execute().

Here is the call graph for this function:

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

Definition at line 94 of file OrbitThreader.h.

References imap_m, and IndexMap::query().

Referenced by ParallelSliceTracker::computeExternalFields(), and ParallelTTracker::computeExternalFields().

Here is the call graph for this function:

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

Definition at line 302 of file OrbitThreader.cpp.

References abs(), Physics::e, elementRegistry_m, euclidean_norm(), itsOpalBeamline_m, name, pathLength_m, OpalBeamline::rotateToLocalCS(), and OpalBeamline::transformToLocalCS().

Referenced by execute().

Here is the call graph for this function:

void OrbitThreader::setDesignEnergy ( FieldList allElements,
const std::set< std::string > &  visitedElements 
)
private

Definition at line 371 of file OrbitThreader.cpp.

References dot(), PartData::getM(), p_m, reference_m, ElementBase::RFCAVITY, sqrt(), and ElementBase::TRAVELINGWAVE.

Referenced by execute().

Here is the call graph for this function:

void OrbitThreader::trackBack ( double  maxDrift)
private

Definition at line 280 of file OrbitThreader.cpp.

References abs(), Physics::c, distTrackBack_m, dt_m, OpalBeamline::getElements(), integrate(), integrator_m, itsOpalBeamline_m, min(), p_m, pathLength_m, BorisPusher::push(), and r_m.

Referenced by execute().

Here is the call graph for this function:

Member Data Documentation

double OrbitThreader::distTrackBack_m
private

distance to track back before tracking forward (length of bunch but not beyond cathode)

Definition at line 45 of file OrbitThreader.h.

Referenced by OrbitThreader(), and trackBack().

double OrbitThreader::dt_m
private

the time step

Definition at line 49 of file OrbitThreader.h.

Referenced by autophaseCavities(), computeMaximalImplicitDrift(), execute(), integrate(), OrbitThreader(), and trackBack().

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

Definition at line 79 of file OrbitThreader.h.

Referenced by processElementRegister(), and registerElement().

unsigned int OrbitThreader::errorFlag_m
private

Definition at line 59 of file OrbitThreader.h.

Referenced by execute(), and integrate().

IndexMap OrbitThreader::imap_m
private

Definition at line 57 of file OrbitThreader.h.

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

BorisPusher OrbitThreader::integrator_m
private

Definition at line 61 of file OrbitThreader.h.

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

OpalBeamline& OrbitThreader::itsOpalBeamline_m
private
std::ofstream OrbitThreader::logger_m
private

Definition at line 64 of file OrbitThreader.h.

Referenced by integrate(), and OrbitThreader().

size_t OrbitThreader::loggingFrequency_m
private

Definition at line 65 of file OrbitThreader.h.

Referenced by integrate(), and OrbitThreader().

const size_t OrbitThreader::maxIntegSteps_m
private

the number of time steps to track

Definition at line 52 of file OrbitThreader.h.

Referenced by computeMaximalImplicitDrift(), and execute().

Vector_t OrbitThreader::p_m
private

momentum of reference particle

Definition at line 40 of file OrbitThreader.h.

Referenced by autophaseCavities(), computeMaximalImplicitDrift(), execute(), integrate(), setDesignEnergy(), and trackBack().

double OrbitThreader::pathLength_m
private

position of reference particle in path length

Definition at line 42 of file OrbitThreader.h.

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

Vector_t OrbitThreader::r_m
private

position of reference particle in lab coordinates

Definition at line 38 of file OrbitThreader.h.

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

const PartData& OrbitThreader::reference_m
private

Definition at line 62 of file OrbitThreader.h.

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

double OrbitThreader::time_m
private

the simulated time

Definition at line 47 of file OrbitThreader.h.

Referenced by autophaseCavities(), and integrate().

const double OrbitThreader::zstop_m
private

final position in path length

Definition at line 54 of file OrbitThreader.h.

Referenced by execute(), and integrate().


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