OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
_Astra1DDynamic Class Reference

#include <Astra1DDynamic.h>

Inheritance diagram for _Astra1DDynamic:
Inheritance graph
Collaboration diagram for _Astra1DDynamic:
Collaboration graph

Public Member Functions

virtual ~_Astra1DDynamic ()
 
virtual bool getFieldstrength (const Vector_t &R, Vector_t &E, Vector_t &B) const
 
virtual bool getFieldDerivative (const Vector_t &R, Vector_t &E, Vector_t &B, const DiffDirection &dir) const
 
virtual void getFieldDimensions (double &zBegin, double &zEnd) const
 
virtual void getFieldDimensions (double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const
 
virtual void swap ()
 
virtual void getInfo (Inform *)
 
virtual double getFrequency () const
 
virtual void setFrequency (double freq)
 
virtual void getOnaxisEz (std::vector< std::pair< double, double > > &F)
 
virtual bool isInside (const Vector_t &r) const
 
virtual void setEdgeConstants (const double &bendAngle, const double &entranceAngle, const double &exitAngle)
 
virtual void setFieldLength (const double &)
 
virtual void get1DProfile1EngeCoeffs (std::vector< double > &engeCoeffsEntry, std::vector< double > &engeCoeffsExit)
 
virtual void get1DProfile1EntranceParam (double &entranceParameter1, double &entranceParameter2, double &entranceParameter3)
 
virtual void get1DProfile1ExitParam (double &exitParameter1, double &exitParameter2, double &exitParameter3)
 
virtual double getFieldGap ()
 
virtual void setFieldGap (double gap)
 
MapType getType ()
 
template<class T >
bool interpretLine (std::ifstream &in, T &value, const bool &file_length_known)
 

Static Public Member Functions

static Fieldmap getFieldmap (std::string Filename, bool fast=false)
 
static std::vector< std::string > getListFieldmapNames ()
 
static void deleteFieldmap (std::string Filename)
 
static void clearDictionary ()
 
static MapType readHeader (std::string Filename)
 
static void readMap (std::string Filename)
 
static void freeMap (std::string Filename)
 
static std::string typeset_msg (const std::string &msg, const std::string &title)
 

Protected Member Functions

void getLine (std::ifstream &in, std::string &buffer)
 
template<class S >
bool interpretLine (std::ifstream &in, S &value, const bool &file_length_known=true)
 
template<class S , class T >
bool interpretLine (std::ifstream &in, S &value1, T &value2, const bool &file_length_known=true)
 
template<class S , class T , class U >
bool interpretLine (std::ifstream &in, S &value1, T &value2, U &value3, const bool &file_length_known=true)
 
template<class S , class T , class U , class V >
bool interpretLine (std::ifstream &in, S &value1, T &value2, U &value3, V &value4, const bool &file_length_known=true)
 
template<class S >
bool interpretLine (std::ifstream &in, S &value1, S &value2, S &value3, S &value4, S &value5, S &value6, const bool &file_length_known=true)
 
bool interpreteEOF (std::ifstream &in)
 
void interpretWarning (const std::ios_base::iostate &state, const bool &read_all, const std::string &error_msg, const std::string &found)
 
void missingValuesWarning ()
 
void exceedingValuesWarning ()
 
void disableFieldmapWarning ()
 
void noFieldmapWarning ()
 
void lowResolutionWarning (double squareError, double maxError)
 
void checkMap (unsigned int accuracy, std::pair< double, double > fieldDimensions, double deltaZ, const std::vector< double > &fourierCoefficients, gsl_spline *splineCoefficients, gsl_interp_accel *splineAccelerator)
 
void checkMap (unsigned int accuracy, double length, const std::vector< double > &zSampling, const std::vector< double > &fourierCoefficients, gsl_spline *splineCoefficients, gsl_interp_accel *splineAccelerator)
 
void write3DField (unsigned int nx, unsigned int ny, unsigned int nz, const std::pair< double, double > &xrange, const std::pair< double, double > &yrange, const std::pair< double, double > &zrange, const std::vector< Vector_t > &ef, const std::vector< Vector_t > &bf)
 

Static Protected Member Functions

static void getLine (std::ifstream &in, int &lines_read, std::string &buffer)
 

Protected Attributes

MapType Type
 
std::string Filename_m
 
int lines_read_m
 
bool normalize_m
 

Private Member Functions

 _Astra1DDynamic (const std::string &filename)
 
virtual void readMap ()
 
virtual void freeMap ()
 

Static Private Member Functions

static Astra1DDynamic create (const std::string &filename)
 

Private Attributes

double *__restrict__ FourCoefs_m
 
double frequency_m
 
double xlrep_m
 
double zbegin_m
 
double zend_m
 
double length_m
 
int accuracy_m
 
int num_gridpz_m
 

Static Private Attributes

static char buffer_m [256]
 
static std::string alpha_numeric
 
static std::map< std::string, FieldmapDescriptionFieldmapDictionary = std::map<std::string, _Fieldmap::FieldmapDescription>()
 

Friends

class _Fieldmap
 

Detailed Description

Definition at line 6 of file Astra1DDynamic.h.

Constructor & Destructor Documentation

◆ ~_Astra1DDynamic()

_Astra1DDynamic::~_Astra1DDynamic ( )
virtual

Definition at line 88 of file Astra1DDynamic.cpp.

References freeMap().

Here is the call graph for this function:

◆ _Astra1DDynamic()

_Astra1DDynamic::_Astra1DDynamic ( const std::string &  filename)
private

Member Function Documentation

◆ checkMap() [1/2]

void _Fieldmap::checkMap ( unsigned int  accuracy,
double  length,
const std::vector< double > &  zSampling,
const std::vector< double > &  fourierCoefficients,
gsl_spline *  splineCoefficients,
gsl_interp_accel *  splineAccelerator 
)
protectedinherited

◆ checkMap() [2/2]

void _Fieldmap::checkMap ( unsigned int  accuracy,
std::pair< double, double >  fieldDimensions,
double  deltaZ,
const std::vector< double > &  fourierCoefficients,
gsl_spline *  splineCoefficients,
gsl_interp_accel *  splineAccelerator 
)
protectedinherited

◆ clearDictionary()

void _Fieldmap::clearDictionary ( )
staticinherited

Definition at line 274 of file Fieldmap.cpp.

References _Fieldmap::FieldmapDictionary.

Referenced by opalMain(), and run_opal().

◆ create()

Astra1DDynamic _Astra1DDynamic::create ( const std::string &  filename)
staticprivate

Definition at line 92 of file Astra1DDynamic.cpp.

References _Astra1DDynamic().

Referenced by _Fieldmap::getFieldmap().

Here is the call graph for this function:

◆ deleteFieldmap()

void _Fieldmap::deleteFieldmap ( std::string  Filename)
staticinherited

Definition at line 270 of file Fieldmap.cpp.

References _Fieldmap::freeMap().

Here is the call graph for this function:

◆ disableFieldmapWarning()

◆ exceedingValuesWarning()

void _Fieldmap::exceedingValuesWarning ( )
protectedinherited

Definition at line 600 of file Fieldmap.cpp.

References _Fieldmap::Filename_m, and _Fieldmap::lines_read_m.

Referenced by _Fieldmap::interpreteEOF().

◆ freeMap() [1/2]

void _Astra1DDynamic::freeMap ( )
privatevirtual

Implements _Fieldmap.

Definition at line 181 of file Astra1DDynamic.cpp.

References FourCoefs_m.

Referenced by ~_Astra1DDynamic().

◆ freeMap() [2/2]

void _Fieldmap::freeMap ( std::string  Filename)
staticinherited

Definition at line 431 of file Fieldmap.cpp.

References _Fieldmap::FieldmapDictionary.

◆ get1DProfile1EngeCoeffs()

void _Fieldmap::get1DProfile1EngeCoeffs ( std::vector< double > &  engeCoeffsEntry,
std::vector< double > &  engeCoeffsExit 
)
virtualinherited

Reimplemented in _FM1DProfile1.

Definition at line 709 of file Fieldmap.cpp.

◆ get1DProfile1EntranceParam()

void _Fieldmap::get1DProfile1EntranceParam ( double &  entranceParameter1,
double &  entranceParameter2,
double &  entranceParameter3 
)
virtualinherited

Reimplemented in _FM1DProfile1.

Definition at line 714 of file Fieldmap.cpp.

◆ get1DProfile1ExitParam()

void _Fieldmap::get1DProfile1ExitParam ( double &  exitParameter1,
double &  exitParameter2,
double &  exitParameter3 
)
virtualinherited

Reimplemented in _FM1DProfile1.

Definition at line 720 of file Fieldmap.cpp.

◆ getFieldDerivative()

bool _Astra1DDynamic::getFieldDerivative ( const Vector_t R,
Vector_t E,
Vector_t B,
const DiffDirection dir 
) const
virtual

Implements _Fieldmap.

Definition at line 229 of file Astra1DDynamic.cpp.

References accuracy_m, cos(), FourCoefs_m, length_m, Hypervolume::n, Physics::pi, Attrib::Distribution::R, sin(), Physics::two_pi, and zbegin_m.

Here is the call graph for this function:

◆ getFieldDimensions() [1/2]

void _Astra1DDynamic::getFieldDimensions ( double &  xIni,
double &  xFinal,
double &  yIni,
double &  yFinal,
double &  zIni,
double &  zFinal 
) const
virtual

Implements _Fieldmap.

Definition at line 247 of file Astra1DDynamic.cpp.

◆ getFieldDimensions() [2/2]

void _Astra1DDynamic::getFieldDimensions ( double &  zBegin,
double &  zEnd 
) const
virtual

Implements _Fieldmap.

Definition at line 242 of file Astra1DDynamic.cpp.

References zbegin_m, and zend_m.

◆ getFieldGap()

double _Fieldmap::getFieldGap ( )
virtualinherited

Reimplemented in _FM1DProfile1.

Definition at line 726 of file Fieldmap.cpp.

◆ getFieldmap()

◆ getFieldstrength()

bool _Astra1DDynamic::getFieldstrength ( const Vector_t R,
Vector_t E,
Vector_t B 
) const
virtual

Implements _Fieldmap.

Definition at line 188 of file Astra1DDynamic.cpp.

References accuracy_m, Physics::c, cos(), FourCoefs_m, length_m, Hypervolume::n, Physics::pi, Attrib::Distribution::R, sin(), Physics::two_pi, xlrep_m, and zbegin_m.

Here is the call graph for this function:

◆ getFrequency()

double _Astra1DDynamic::getFrequency ( ) const
virtual

Implements _Fieldmap.

Definition at line 256 of file Astra1DDynamic.cpp.

References frequency_m.

◆ getInfo()

void _Astra1DDynamic::getInfo ( Inform msg)
virtual

Implements _Fieldmap.

Definition at line 252 of file Astra1DDynamic.cpp.

References endl(), _Fieldmap::Filename_m, zbegin_m, and zend_m.

Here is the call graph for this function:

◆ getLine() [1/2]

void _Fieldmap::getLine ( std::ifstream &  in,
int &  lines_read,
std::string &  buffer 
)
staticprotectedinherited

Definition at line 533 of file Fieldmap.cpp.

References _Fieldmap::alpha_numeric, _Fieldmap::buffer_m, and READ_BUFFER_LENGTH.

◆ getLine() [2/2]

◆ getListFieldmapNames()

std::vector< std::string > _Fieldmap::getListFieldmapNames ( )
staticinherited

Definition at line 262 of file Fieldmap.cpp.

References _Fieldmap::FieldmapDictionary.

◆ getOnaxisEz()

void _Astra1DDynamic::getOnaxisEz ( std::vector< std::pair< double, double > > &  F)
virtual

Reimplemented from _Fieldmap.

Definition at line 264 of file Astra1DDynamic.cpp.

References abs(), _Fieldmap::Filename_m, and num_gridpz_m.

Here is the call graph for this function:

◆ getType()

MapType _Fieldmap::getType ( )
inlineinherited

Definition at line 98 of file Fieldmap.h.

References _Fieldmap::Type.

◆ interpreteEOF()

◆ interpretLine() [1/6]

template<class S >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
S &  value,
const bool &  file_length_known = true 
)
protectedinherited

◆ interpretLine() [2/6]

template<class S >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
S &  value1,
S &  value2,
S &  value3,
S &  value4,
S &  value5,
S &  value6,
const bool &  file_length_known = true 
)
protectedinherited

Definition at line 141 of file Fieldmap.hpp.

References _Fieldmap::getLine(), _Fieldmap::interpretWarning(), and _Fieldmap::missingValuesWarning().

Here is the call graph for this function:

◆ interpretLine() [3/6]

template<class S , class T >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
S &  value1,
T &  value2,
const bool &  file_length_known = true 
)
protectedinherited

Definition at line 39 of file Fieldmap.hpp.

References _Fieldmap::getLine(), _Fieldmap::interpretWarning(), and _Fieldmap::missingValuesWarning().

Here is the call graph for this function:

◆ interpretLine() [4/6]

template<class S , class T , class U >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
S &  value1,
T &  value2,
U &  value3,
const bool &  file_length_known = true 
)
protectedinherited

Definition at line 70 of file Fieldmap.hpp.

References _Fieldmap::getLine(), _Fieldmap::interpretWarning(), and _Fieldmap::missingValuesWarning().

Here is the call graph for this function:

◆ interpretLine() [5/6]

template<class S , class T , class U , class V >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
S &  value1,
T &  value2,
U &  value3,
V &  value4,
const bool &  file_length_known = true 
)
protectedinherited

Definition at line 104 of file Fieldmap.hpp.

References _Fieldmap::getLine(), _Fieldmap::interpretWarning(), and _Fieldmap::missingValuesWarning().

Here is the call graph for this function:

◆ interpretLine() [6/6]

template<class T >
bool _Fieldmap::interpretLine ( std::ifstream &  in,
T &  value,
const bool &  file_length_known 
)
inherited

Definition at line 12 of file Fieldmap.hpp.

References _Fieldmap::getLine(), _Fieldmap::interpretWarning(), and _Fieldmap::missingValuesWarning().

Here is the call graph for this function:

◆ interpretWarning()

void _Fieldmap::interpretWarning ( const std::ios_base::iostate &  state,
const bool &  read_all,
const std::string &  error_msg,
const std::string &  found 
)
protectedinherited

Definition at line 571 of file Fieldmap.cpp.

References endl(), _Fieldmap::Filename_m, and _Fieldmap::lines_read_m.

Referenced by _Fieldmap::interpretLine().

Here is the call graph for this function:

◆ isInside()

bool _Astra1DDynamic::isInside ( const Vector_t r) const
inlinevirtual

Reimplemented from _Fieldmap.

Definition at line 45 of file Astra1DDynamic.h.

References zbegin_m, and zend_m.

◆ lowResolutionWarning()

void _Fieldmap::lowResolutionWarning ( double  squareError,
double  maxError 
)
protectedinherited

Definition at line 626 of file Fieldmap.cpp.

References endl(), ERRORMSG, _Fieldmap::Filename_m, OpalData::getAuxiliaryOutputDirectory(), OpalData::getInstance(), IpplInfo::myNode(), and _Fieldmap::typeset_msg().

Referenced by _Fieldmap::checkMap().

Here is the call graph for this function:

◆ missingValuesWarning()

void _Fieldmap::missingValuesWarning ( )
protectedinherited

Definition at line 590 of file Fieldmap.cpp.

References _Fieldmap::Filename_m, and _Fieldmap::lines_read_m.

Referenced by _Fieldmap::interpretLine().

◆ noFieldmapWarning()

◆ readHeader()

◆ readMap() [1/2]

void _Astra1DDynamic::readMap ( )
privatevirtual

◆ readMap() [2/2]

void _Fieldmap::readMap ( std::string  Filename)
staticinherited

Definition at line 422 of file Fieldmap.cpp.

References _Fieldmap::FieldmapDictionary.

◆ setEdgeConstants()

void _Fieldmap::setEdgeConstants ( const double &  bendAngle,
const double &  entranceAngle,
const double &  exitAngle 
)
virtualinherited

Reimplemented in _FM1DProfile2.

Definition at line 527 of file Fieldmap.cpp.

◆ setFieldGap()

void _Fieldmap::setFieldGap ( double  gap)
virtualinherited

Reimplemented in _FM1DProfile1.

Definition at line 730 of file Fieldmap.cpp.

◆ setFieldLength()

void _Fieldmap::setFieldLength ( const double &  )
virtualinherited

Definition at line 530 of file Fieldmap.cpp.

◆ setFrequency()

void _Astra1DDynamic::setFrequency ( double  freq)
virtual

Implements _Fieldmap.

Definition at line 260 of file Astra1DDynamic.cpp.

References frequency_m.

◆ swap()

void _Astra1DDynamic::swap ( )
virtual

Implements _Fieldmap.

Definition at line 249 of file Astra1DDynamic.cpp.

◆ typeset_msg()

◆ write3DField()

void _Fieldmap::write3DField ( unsigned int  nx,
unsigned int  ny,
unsigned int  nz,
const std::pair< double, double > &  xrange,
const std::pair< double, double > &  yrange,
const std::pair< double, double > &  zrange,
const std::vector< Vector_t > &  ef,
const std::vector< Vector_t > &  bf 
)
protectedinherited

Definition at line 734 of file Fieldmap.cpp.

References Util::combineFilePath(), endl(), _Fieldmap::Filename_m, OpalData::getAuxiliaryOutputDirectory(), OpalData::getInstance(), IpplInfo::myNode(), and PAssert.

Referenced by _FM3DDynamic::readMap().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ _Fieldmap

friend class _Fieldmap
friend

Definition at line 42 of file Astra1DDynamic.h.

Member Data Documentation

◆ accuracy_m

int _Astra1DDynamic::accuracy_m
private

Definition at line 39 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), getFieldDerivative(), getFieldstrength(), and readMap().

◆ alpha_numeric

std::string _Fieldmap::alpha_numeric
staticprivateinherited

Definition at line 183 of file Fieldmap.h.

Referenced by _Fieldmap::getLine(), and _Fieldmap::interpreteEOF().

◆ buffer_m

char _Fieldmap::buffer_m
staticprivateinherited

Definition at line 182 of file Fieldmap.h.

Referenced by _Fieldmap::getLine(), and _Fieldmap::interpreteEOF().

◆ FieldmapDictionary

std::map< std::string, _Fieldmap::FieldmapDescription > _Fieldmap::FieldmapDictionary = std::map<std::string, _Fieldmap::FieldmapDescription>()
staticprivateinherited

◆ Filename_m

std::string _Fieldmap::Filename_m
protectedinherited

Definition at line 118 of file Fieldmap.h.

Referenced by _Astra1DDynamic(), _Astra1DDynamic_fast::_Astra1DDynamic_fast(), _Astra1DElectroStatic::_Astra1DElectroStatic(), _Astra1DElectroStatic_fast::_Astra1DElectroStatic_fast(), _Astra1DMagnetoStatic::_Astra1DMagnetoStatic(), _Astra1DMagnetoStatic_fast::_Astra1DMagnetoStatic_fast(), _FM1DDynamic::_FM1DDynamic(), _FM1DDynamic_fast::_FM1DDynamic_fast(), _FM1DElectroStatic::_FM1DElectroStatic(), _FM1DElectroStatic_fast::_FM1DElectroStatic_fast(), _FM1DMagnetoStatic::_FM1DMagnetoStatic(), _FM1DMagnetoStatic_fast::_FM1DMagnetoStatic_fast(), _FM1DProfile1::_FM1DProfile1(), _FM1DProfile2::_FM1DProfile2(), _FM2DDynamic::_FM2DDynamic(), _FM2DElectroStatic::_FM2DElectroStatic(), _FM2DMagnetoStatic::_FM2DMagnetoStatic(), _FM3DDynamic::_FM3DDynamic(), _FM3DMagnetoStatic::_FM3DMagnetoStatic(), _FM3DMagnetoStaticExtended::_FM3DMagnetoStaticExtended(), _Fieldmap::checkMap(), _FM3DH5BlockBase::closeFile(), _Fieldmap::disableFieldmapWarning(), _Fieldmap::exceedingValuesWarning(), _FM3DH5BlockBase::getFieldInfo(), getInfo(), _Astra1DDynamic_fast::getInfo(), _Astra1DElectroStatic::getInfo(), _Astra1DElectroStatic_fast::getInfo(), _Astra1DMagnetoStatic::getInfo(), _Astra1DMagnetoStatic_fast::getInfo(), _FM1DDynamic::getInfo(), _FM1DDynamic_fast::getInfo(), _FM1DElectroStatic::getInfo(), _FM1DElectroStatic_fast::getInfo(), _FM1DMagnetoStatic::getInfo(), _FM1DMagnetoStatic_fast::getInfo(), _FM1DProfile1::getInfo(), _FM1DProfile2::getInfo(), _FM2DDynamic::getInfo(), _FM2DElectroStatic::getInfo(), _FM2DMagnetoStatic::getInfo(), _FM3DDynamic::getInfo(), _FM3DH5BlockBase::getInfo(), _FM3DMagnetoStatic::getInfo(), _FM3DMagnetoStaticExtended::getInfo(), _FM3DH5BlockBase::getNumSteps(), _FM1DDynamic::getOnaxisEz(), _FM1DDynamic_fast::getOnaxisEz(), getOnaxisEz(), _Astra1DDynamic_fast::getOnaxisEz(), _FM3DDynamic::getOnaxisEz(), _FM3DH5BlockBase::getResonanceFrequency(), _Fieldmap::interpretWarning(), _Fieldmap::lowResolutionWarning(), _Fieldmap::missingValuesWarning(), _Fieldmap::noFieldmapWarning(), _FM3DH5BlockBase::readField(), readMap(), _Astra1DDynamic_fast::readMap(), _Astra1DElectroStatic::readMap(), _Astra1DElectroStatic_fast::readMap(), _Astra1DMagnetoStatic::readMap(), _Astra1DMagnetoStatic_fast::readMap(), _FM1DDynamic::readMap(), _FM1DDynamic_fast::readMap(), _FM1DElectroStatic::readMap(), _FM1DElectroStatic_fast::readMap(), _FM1DMagnetoStatic::readMap(), _FM1DMagnetoStatic_fast::readMap(), _FM1DProfile1::readMap(), _FM1DProfile2::readMap(), _FM2DDynamic::readMap(), _FM2DElectroStatic::readMap(), _FM2DMagnetoStatic::readMap(), _FM3DDynamic::readMap(), _FM3DH5Block::readMap(), _FM3DH5Block_nonscale::readMap(), _FM3DMagnetoStatic::readMap(), _FM3DMagnetoStaticExtended::readMap(), _FM3DMagnetoStaticH5Block::readMap(), _FM3DH5BlockBase::setStep(), and _Fieldmap::write3DField().

◆ FourCoefs_m

double* __restrict__ _Astra1DDynamic::FourCoefs_m
private

Definition at line 30 of file Astra1DDynamic.h.

Referenced by freeMap(), getFieldDerivative(), getFieldstrength(), and readMap().

◆ frequency_m

double _Astra1DDynamic::frequency_m
private

Definition at line 32 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), getFrequency(), and setFrequency().

◆ length_m

double _Astra1DDynamic::length_m
private

Definition at line 37 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), getFieldDerivative(), and getFieldstrength().

◆ lines_read_m

◆ normalize_m

◆ num_gridpz_m

int _Astra1DDynamic::num_gridpz_m
private

Definition at line 40 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), getOnaxisEz(), and readMap().

◆ Type

◆ xlrep_m

double _Astra1DDynamic::xlrep_m
private

Definition at line 33 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), and getFieldstrength().

◆ zbegin_m

double _Astra1DDynamic::zbegin_m
private

◆ zend_m

double _Astra1DDynamic::zend_m
private

Definition at line 36 of file Astra1DDynamic.h.

Referenced by _Astra1DDynamic(), getFieldDimensions(), getInfo(), isInside(), and readMap().


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