OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
FM2DDynamic Class Reference

#include <FM2DDynamic.h>

Inheritance diagram for FM2DDynamic:
Inheritance graph
Collaboration diagram for FM2DDynamic:
Collaboration graph

Public Member Functions

virtual bool getFieldstrength (const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) const override
 Get the field strength at a given point.
 
virtual bool getFieldDerivative (const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B, const DiffDirection &dir) const override
 Get the field derivative with respect to a direction.
 
virtual void getFieldDimensions (double &zBegin, double &zEnd) const override
 Get the longitudinal dimensions of the field.
 
virtual void getFieldDimensions (double &xIni, double &xFinal, double &yIni, double &yFinal, double &zIni, double &zFinal) const override
 Get the full 3D bounding box of the field.
 
virtual void swap () override
 Swap coordinates.
 
virtual void getInfo (Inform *msg) override
 Print info about the field map.
 
virtual double getFrequency () const override
 Get the frequency.
 
virtual void setFrequency (double freq) override
 Set the frequency.
 
bool isInside (const Vector_t< double, 3 > &r) const override
 Checks if the given coordinate is inside the volume covered by the fieldmap.
 
void applyField (std::shared_ptr< ParticleContainer_t > pc, double) override
 Apply the FM to all the particles.
 
void applyRFField (std::shared_ptr< ParticleContainer_t > pc, double electricScale, double magneticScale, double startField, double endField)
 Apply the RF-scaled dynamic field map to all particles.
 
virtual void getOnaxisEz (std::vector< std::pair< double, double > > &F) override
 
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)
 Parses a single value of type T from a line in the stream.
 

Static Public Member Functions

template<class ViewType >
static KOKKOS_INLINE_FUNCTION void computeField (const Vector_t< double, 3 > &R, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B, const ViewType &Ez, const ViewType &Er, const ViewType &Bt, double hr_m, double hz_m, double zbegin_m, int num_gridpr_m, int num_gridpz_m)
 
static FieldmapgetFieldmap (std::string Filename, bool fast=false)
 Get a field map instance. Use this factory method to obtain a field map. It checks the cache (FieldmapDictionary) first.
 
static std::vector< std::string > getListFieldmapNames ()
 Get a list of all loaded field map names.
 
static void deleteFieldmap (std::string Filename)
 Delete a specific field map from the cache and memory.
 
static void clearDictionary ()
 Clear the entire field map cache.
 
static MapType readHeader (std::string Filename)
 Read the header of a field map file to determine its type.
 
static void readMap (std::string Filename)
 Trigger the actual reading of the field map data.
 
static void freeMap (std::string Filename)
 Decrease reference count or delete field map if unused.
 
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)
 Parses two values (types S, T) from a line.
 
template<class S , class T , class U >
bool interpretLine (std::ifstream &in, S &value1, T &value2, U &value3, const bool &file_length_known=true)
 Parses three values (types S, T, U) from a line.
 
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)
 Parses four values (types S, T, U, V) from a line.
 
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)
 Parses six values of the same type S from a line.
 
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< double, 3 > > &ef, const std::vector< Vector_t< double, 3 > > &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

 FM2DDynamic (const std::string &filename)
 
 ~FM2DDynamic ()
 
void readMap () override
 Pure virtual method to read the map data. Called by the public static readMap().
 
void freeMap () override
 Pure virtual method to free the map data.
 

Private Attributes

Kokkos::DualView< double * > FieldstrengthEz_m
 Fieldstrengths.
 
Kokkos::DualView< double * > FieldstrengthEr_m
 
Kokkos::DualView< double * > FieldstrengthBt_m
 
double frequency_m
 
double rbegin_m
 Radius Bounds.
 
double rend_m
 
double zbegin_m
 Z Bounds relative to element edge.
 
double zend_m
 
double hz_m
 Grid.
 
double hr_m
 
int num_gridpr_m
 
int num_gridpz_m
 
bool swap_m
 

Static Private Attributes

static char buffer_m [256]
 
static std::string alpha_numeric
 
static std::map< std::string, FieldmapDescriptionFieldmapDictionary
 

Friends

class Fieldmap
 

Detailed Description

Definition at line 9 of file FM2DDynamic.h.

Constructor & Destructor Documentation

◆ FM2DDynamic()

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

Parse rbegin_m, rend_m and num_gridpr_m(-1)

Parse frequency_m

Parse rbegin_m, zend_m and num_gridpz_m(-1)

Parse rbegin_m, zend_m and num_gridpz_m(-1)

Parse frequency_m

Parse rbegin_m, rend_m and num_gridpr_m(-1)

Definition at line 12 of file FM2DDynamic.cpp.

References Units::cm2m, Fieldmap::disableFieldmapWarning(), Fieldmap::Filename_m, FM2DDynamic(), frequency_m, hr_m, hz_m, Fieldmap::interpreteEOF(), Fieldmap::lines_read_m, Units::MHz2Hz, Fieldmap::noFieldmapWarning(), Fieldmap::normalize_m, num_gridpr_m, num_gridpz_m, rbegin_m, rend_m, swap_m, T2DDynamic, Util::toUpper(), Physics::two_pi, Fieldmap::Type, zbegin_m, and zend_m.

Referenced by FM2DDynamic().

Here is the call graph for this function:

◆ ~FM2DDynamic()

FM2DDynamic::~FM2DDynamic ( )
private

Definition at line 111 of file FM2DDynamic.cpp.

References freeMap(), and ~FM2DDynamic().

Referenced by ~FM2DDynamic().

Here is the call graph for this function:

Member Function Documentation

◆ applyField()

void FM2DDynamic::applyField ( std::shared_ptr< ParticleContainer_t pc,
double   
)
overridevirtual

Apply the FM to all the particles.

Parameters
pcParticle container
pcParticle container param scale Scaling factor for the field (currently not used)

Implements Fieldmap.

Definition at line 208 of file FM2DDynamic.cpp.

References applyField(), computeField(), FieldstrengthBt_m, FieldstrengthEr_m, FieldstrengthEz_m, hr_m, hz_m, num_gridpr_m, num_gridpz_m, rend_m, zbegin_m, and zend_m.

Referenced by applyField().

Here is the call graph for this function:

◆ applyRFField()

void FM2DDynamic::applyRFField ( std::shared_ptr< ParticleContainer_t pc,
double  electricScale,
double  magneticScale,
double  startField,
double  endField 
)

Apply the RF-scaled dynamic field map to all particles.

This is the device-safe path used by RFCavity. It avoids calling the virtual Fieldmap::getFieldstrength() interface inside a Kokkos kernel.

Parameters
pcParticle container.
electricScaleScale factor applied to the electric field.
magneticScaleScale factor applied to the magnetic field.
startFieldBegin of the active cavity region.
endFieldEnd of the active cavity region.

Definition at line 240 of file FM2DDynamic.cpp.

References applyRFField(), computeField(), FieldstrengthBt_m, FieldstrengthEr_m, FieldstrengthEz_m, hr_m, hz_m, num_gridpr_m, num_gridpz_m, rend_m, zbegin_m, and zend_m.

Referenced by applyRFField().

Here is the call graph for this function:

◆ 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

Definition at line 330 of file Fieldmap.cpp.

References Fieldmap::checkMap().

Referenced by Fieldmap::checkMap(), and Fieldmap::checkMap().

Here is the call graph for this function:

◆ clearDictionary()

void Fieldmap::clearDictionary ( )
staticinherited

Clear the entire field map cache.

Definition at line 160 of file Fieldmap.cpp.

References Fieldmap::clearDictionary(), and Fieldmap::FieldmapDictionary.

Referenced by Fieldmap::clearDictionary().

Here is the call graph for this function:

◆ computeField()

template<class ViewType >
static KOKKOS_INLINE_FUNCTION void FM2DDynamic::computeField ( const Vector_t< double, 3 > &  R,
Vector_t< double, 3 > &  E,
Vector_t< double, 3 > &  B,
const ViewType &  Ez,
const ViewType &  Er,
const ViewType &  Bt,
double  hr_m,
double  hz_m,
double  zbegin_m,
int  num_gridpr_m,
int  num_gridpz_m 
)
inlinestatic

Definition at line 93 of file FM2DDynamic.h.

References hr_m, hz_m, num_gridpr_m, num_gridpz_m, and zbegin_m.

Referenced by applyField(), applyRFField(), and getFieldstrength().

◆ deleteFieldmap()

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

Delete a specific field map from the cache and memory.

Parameters
FilenameThe filename of the map to delete.

Definition at line 158 of file Fieldmap.cpp.

References Fieldmap::deleteFieldmap(), and Fieldmap::freeMap().

Referenced by Fieldmap::deleteFieldmap().

Here is the call graph for this function:

◆ disableFieldmapWarning()

void Fieldmap::disableFieldmapWarning ( )
protectedinherited

◆ exceedingValuesWarning()

void Fieldmap::exceedingValuesWarning ( )
protectedinherited

Definition at line 479 of file Fieldmap.cpp.

References Fieldmap::exceedingValuesWarning(), Fieldmap::Filename_m, and Fieldmap::lines_read_m.

Referenced by Fieldmap::exceedingValuesWarning(), and Fieldmap::interpreteEOF().

Here is the call graph for this function:

◆ freeMap() [1/2]

void FM2DDynamic::freeMap ( )
overrideprivatevirtual

Pure virtual method to free the map data.

Implements Fieldmap.

Definition at line 191 of file FM2DDynamic.cpp.

References FieldstrengthBt_m, FieldstrengthEr_m, FieldstrengthEz_m, Fieldmap::Filename_m, and freeMap().

Referenced by freeMap(), and ~FM2DDynamic().

Here is the call graph for this function:

◆ freeMap() [2/2]

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

Decrease reference count or delete field map if unused.

Parameters
FilenameThe file to free.

Definition at line 311 of file Fieldmap.cpp.

References Fieldmap::FieldmapDictionary, and Fieldmap::freeMap().

Referenced by Fieldmap::freeMap(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:

◆ get1DProfile1EngeCoeffs()

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

Definition at line 590 of file Fieldmap.cpp.

References Fieldmap::get1DProfile1EngeCoeffs().

Referenced by Fieldmap::get1DProfile1EngeCoeffs().

Here is the call graph for this function:

◆ get1DProfile1EntranceParam()

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

Definition at line 593 of file Fieldmap.cpp.

References Fieldmap::get1DProfile1EntranceParam().

Referenced by Fieldmap::get1DProfile1EntranceParam().

Here is the call graph for this function:

◆ get1DProfile1ExitParam()

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

Definition at line 597 of file Fieldmap.cpp.

References Fieldmap::get1DProfile1ExitParam().

Referenced by Fieldmap::get1DProfile1ExitParam().

Here is the call graph for this function:

◆ getFieldDerivative()

bool FM2DDynamic::getFieldDerivative ( const Vector_t< double, 3 > &  R,
Vector_t< double, 3 > &  E,
Vector_t< double, 3 > &  B,
const DiffDirection dir 
) const
overridevirtual

Get the field derivative with respect to a direction.

Get the derivative of the field at position R.

Parameters
RPosition [m].
EOutput derivative of Electric field.
BOutput derivative of Magnetic field.
dirDirection of derivative (DX, DY, DZ).
Returns
true if R is outside, false otherwise.
Parameters
RPosition
EElectric Field (unused)
BDerivate of the magnetic field
Note
Not implemented yet

Implements Fieldmap.

Definition at line 311 of file FM2DDynamic.cpp.

References getFieldDerivative().

Referenced by getFieldDerivative().

Here is the call graph for this function:

◆ getFieldDimensions() [1/2]

void FM2DDynamic::getFieldDimensions ( double &  xIni,
double &  xFinal,
double &  yIni,
double &  yFinal,
double &  zIni,
double &  zFinal 
) const
overridevirtual

Get the full 3D bounding box of the field.

Parameters
xIniOutput minimum x [m].
xFinalOutput maximum x [m].
yIniOutput minimum y [m].
yFinalOutput maximum y [m].
zIniOutput minimum z [m].
zFinalOutput maximum z [m].

Implements Fieldmap.

Definition at line 322 of file FM2DDynamic.cpp.

References getFieldDimensions().

Here is the call graph for this function:

◆ getFieldDimensions() [2/2]

void FM2DDynamic::getFieldDimensions ( double &  zBegin,
double &  zEnd 
) const
overridevirtual

Get the longitudinal dimensions of the field.

Parameters
zBeginOutput start of field [m].
zEndOutput end of field [m].

Implements Fieldmap.

Definition at line 317 of file FM2DDynamic.cpp.

References getFieldDimensions(), zbegin_m, and zend_m.

Referenced by getFieldDimensions(), and getFieldDimensions().

Here is the call graph for this function:

◆ getFieldGap()

double Fieldmap::getFieldGap ( )
virtualinherited

Definition at line 600 of file Fieldmap.cpp.

References Fieldmap::getFieldGap().

Referenced by Fieldmap::getFieldGap().

Here is the call graph for this function:

◆ getFieldmap()

Fieldmap * Fieldmap::getFieldmap ( std::string  Filename,
bool  fast = false 
)
staticinherited

Get a field map instance. Use this factory method to obtain a field map. It checks the cache (FieldmapDictionary) first.

Factory method to obtain a Fieldmap instance.

Parameters
FilenameThe path to the field map file.
fastIf true, load a "fast" version if available (implementation dependent).
Returns
Pointer to the Fieldmap instance.

Checks the FieldmapDictionary cache to see if the file is already loaded. If not, it calls readHeader() to determine the map type, instantiates the corresponding subclass, and adds it to the dictionary.

Parameters
FilenameAbsolute path to the fieldmap file.
fastNot implemented. Previously attempted to load a "fast" version.
Returns
Fieldmap* Pointer to the managed fieldmap instance.

Found matching entry?

Return fieldmap pointer

Determine fieldmap type

Based on type:

  • Create new fieldmap object by parsing the fieldmap file
  • Create new FieldmapDescription object for this fieldmap
  • Insert FieldmapDescription into FieldmapDictionary
  • Return pointer to the fieldmap

Definition at line 72 of file Fieldmap.cpp.

References Fieldmap::FieldmapDictionary, Fieldmap::getFieldmap(), Fieldmap::readHeader(), T2DDynamic, T2DMagnetoStatic, TAstraDynamic, and TAstraMagnetoStatic.

Referenced by Fieldmap::getFieldmap().

Here is the call graph for this function:

◆ getFieldstrength()

bool FM2DDynamic::getFieldstrength ( const Vector_t< double, 3 > &  R,
Vector_t< double, 3 > &  E,
Vector_t< double, 3 > &  B 
) const
overridevirtual

Get the field strength at a given point.

Get the fieldstrength at position R.

Parameters
RPosition [m] relative to the field map origin.
EOutput Electric field [MV/m].
BOutput Magnetic field [T].
Returns
true if R is outside of the field map, false otherwise.
Parameters
RPosition
EElectric Field
BMagnetic Field
Returns
true if R is outside of the field map, false otherwise.

Implements Fieldmap.

Definition at line 288 of file FM2DDynamic.cpp.

References computeField(), FieldstrengthBt_m, FieldstrengthEr_m, FieldstrengthEz_m, getFieldstrength(), hr_m, hz_m, isInside(), num_gridpr_m, num_gridpz_m, and zbegin_m.

Referenced by getFieldstrength().

Here is the call graph for this function:

◆ getFrequency()

double FM2DDynamic::getFrequency ( ) const
overridevirtual

Get the frequency.

Returns
Frequency [MHz].
Note
Not implemented yet

Implements Fieldmap.

Definition at line 335 of file FM2DDynamic.cpp.

References frequency_m, and getFrequency().

Referenced by getFrequency().

Here is the call graph for this function:

◆ getInfo()

void FM2DDynamic::getInfo ( Inform *  msg)
overridevirtual

Print info about the field map.

Implements Fieldmap.

Definition at line 330 of file FM2DDynamic.cpp.

References Fieldmap::Filename_m, getInfo(), zbegin_m, and zend_m.

Referenced by getInfo().

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 414 of file Fieldmap.cpp.

References Fieldmap::alpha_numeric, Fieldmap::buffer_m, Fieldmap::getLine(), and READ_BUFFER_LENGTH.

Here is the call graph for this function:

◆ getLine() [2/2]

void Fieldmap::getLine ( std::ifstream &  in,
std::string &  buffer 
)
inlineprotectedinherited

◆ getListFieldmapNames()

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

Get a list of all loaded field map names.

Returns
Vector of filenames.

Definition at line 149 of file Fieldmap.cpp.

References Fieldmap::FieldmapDictionary, and Fieldmap::getListFieldmapNames().

Referenced by Fieldmap::getListFieldmapNames().

Here is the call graph for this function:

◆ getOnaxisEz()

void FM2DDynamic::getOnaxisEz ( std::vector< std::pair< double, double > > &  F)
overridevirtual

Reimplemented from Fieldmap.

Definition at line 339 of file FM2DDynamic.cpp.

References FieldstrengthEz_m, getOnaxisEz(), num_gridpz_m, zbegin_m, and zend_m.

Referenced by getOnaxisEz().

Here is the call graph for this function:

◆ getType()

MapType Fieldmap::getType ( )
inlineinherited

Definition at line 206 of file Fieldmap.h.

References Fieldmap::Type.

Referenced by TEST_F(), TEST_F(), TEST_F(), and TEST_F().

◆ interpreteEOF()

bool Fieldmap::interpreteEOF ( std::ifstream &  in)
protectedinherited

◆ 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

Parses six values of the same type S from a line.

See also
interpretLine<T>

Definition at line 176 of file Fieldmap.hpp.

References Fieldmap::getLine(), Fieldmap::interpretLine(), 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

Parses two values (types S, T) from a line.

See also
interpretLine<T>

Definition at line 55 of file Fieldmap.hpp.

References Fieldmap::getLine(), Fieldmap::interpretLine(), 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

Parses three values (types S, T, U) from a line.

See also
interpretLine<T>

Definition at line 92 of file Fieldmap.hpp.

References Fieldmap::getLine(), Fieldmap::interpretLine(), 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

Parses four values (types S, T, U, V) from a line.

See also
interpretLine<T>

Definition at line 132 of file Fieldmap.hpp.

References Fieldmap::getLine(), Fieldmap::interpretLine(), 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

Parses a single value of type T from a line in the stream.

Reads a line using getLine(), then attempts to extract one value. Validates that the extraction matches the type and that no unexpected data remains on the line.

Parameters
inInput file stream.
valueOutput variable reference.
file_length_knownIf false, EOF is acceptable.
Returns
true if successful, false if EOF (and permitted).

Definition at line 23 of file Fieldmap.hpp.

References Fieldmap::getLine(), Fieldmap::interpretLine(), 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

◆ isInside()

bool FM2DDynamic::isInside ( const Vector_t< double, 3 > &  r) const
inlineoverridevirtual

Checks if the given coordinate is inside the volume covered by the fieldmap.

Parameters
rCoordinate
Note
This cannot be called inside a GPU kernel (implicit capture of the 'this' pointer not allowed on device)

Implements Fieldmap.

Definition at line 88 of file FM2DDynamic.h.

References rend_m, zbegin_m, and zend_m.

Referenced by getFieldstrength().

◆ lowResolutionWarning()

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

◆ missingValuesWarning()

void Fieldmap::missingValuesWarning ( )
protectedinherited

◆ noFieldmapWarning()

void Fieldmap::noFieldmapWarning ( )
protectedinherited

◆ readHeader()

MapType Fieldmap::readHeader ( std::string  Filename)
staticinherited

Read the header of a field map file to determine its type.

Determines the fieldmap type.

Parameters
FilenameThe file to check.
Returns
The MapType determined from the file header.
MapType

Definition at line 174 of file Fieldmap.cpp.

References Fieldmap::getLine(), Fieldmap::lines_read_m, Fieldmap::readHeader(), T1DDynamic, T1DElectroStatic, T1DMagnetoStatic, T1DProfile1, T2DDynamic, T2DElectroStatic, T2DMagnetoStatic, T3DDynamic, T3DDynamicH5Block, T3DElectroStatic, T3DMagnetoStatic, T3DMagnetoStatic_Extended, T3DMagnetoStaticH5Block, TAstraDynamic, TAstraElectroStatic, TAstraMagnetoStatic, and UNKNOWN.

Referenced by Fieldmap::getFieldmap(), and Fieldmap::readHeader().

Here is the call graph for this function:

◆ readMap() [1/2]

void FM2DDynamic::readMap ( )
overrideprivatevirtual

Pure virtual method to read the map data. Called by the public static readMap().

Implements Fieldmap.

Definition at line 113 of file FM2DDynamic.cpp.

References FieldstrengthBt_m, FieldstrengthEr_m, FieldstrengthEz_m, Fieldmap::Filename_m, Fieldmap::getLine(), Physics::mu_0, Fieldmap::normalize_m, num_gridpr_m, num_gridpz_m, readMap(), and swap_m.

Referenced by readMap().

Here is the call graph for this function:

◆ readMap() [2/2]

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

Trigger the actual reading of the field map data.

Parameters
FilenameThe file to read.

Definition at line 301 of file Fieldmap.cpp.

References Fieldmap::FieldmapDictionary, and Fieldmap::readMap().

Referenced by Fieldmap::readMap(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

Here is the call graph for this function:

◆ setEdgeConstants()

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

Definition at line 408 of file Fieldmap.cpp.

References Fieldmap::setEdgeConstants().

Referenced by Fieldmap::setEdgeConstants().

Here is the call graph for this function:

◆ setFieldGap()

void Fieldmap::setFieldGap ( double  gap)
virtualinherited

Definition at line 602 of file Fieldmap.cpp.

References Fieldmap::setFieldGap().

Referenced by Fieldmap::setFieldGap().

Here is the call graph for this function:

◆ setFieldLength()

void Fieldmap::setFieldLength ( const double &  )
virtualinherited

Definition at line 412 of file Fieldmap.cpp.

References Fieldmap::setFieldLength().

Referenced by Fieldmap::setFieldLength().

Here is the call graph for this function:

◆ setFrequency()

void FM2DDynamic::setFrequency ( double  freq)
overridevirtual

Set the frequency.

Parameters
freqFrequency [MHz].
Note
Not implemented yet

Implements Fieldmap.

Definition at line 337 of file FM2DDynamic.cpp.

References frequency_m, and setFrequency().

Referenced by setFrequency().

Here is the call graph for this function:

◆ swap()

void FM2DDynamic::swap ( )
overridevirtual

Swap coordinates.

Implements Fieldmap.

Definition at line 328 of file FM2DDynamic.cpp.

References swap(), and swap_m.

Referenced by swap().

Here is the call graph for this function:

◆ typeset_msg()

std::string Fieldmap::typeset_msg ( const std::string &  msg,
const std::string &  title 
)
staticinherited

Definition at line 527 of file Fieldmap.cpp.

References Fieldmap::typeset_msg().

Referenced by FM2DMagnetoStatic::freeMap(), Fieldmap::lowResolutionWarning(), FM2DMagnetoStatic::readMap(), and Fieldmap::typeset_msg().

Here is the call graph for this function:

◆ 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< double, 3 > > &  ef,
const std::vector< Vector_t< double, 3 > > &  bf 
)
protectedinherited

Definition at line 604 of file Fieldmap.cpp.

References Util::combineFilePath(), Fieldmap::Filename_m, OpalData::getAuxiliaryOutputDirectory(), OpalData::getInstance(), and Fieldmap::write3DField().

Referenced by Fieldmap::write3DField().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ Fieldmap

friend class Fieldmap
friend

Definition at line 192 of file FM2DDynamic.h.

Member Data Documentation

◆ alpha_numeric

std::string Fieldmap::alpha_numeric
staticprivateinherited

Definition at line 302 of file Fieldmap.h.

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

◆ buffer_m

char Fieldmap::buffer_m
staticprivateinherited

Definition at line 301 of file Fieldmap.h.

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

◆ FieldmapDictionary

std::map< std::string, Fieldmap::FieldmapDescription > Fieldmap::FieldmapDictionary
staticprivateinherited
Initial value:
=
std::map<std::string, Fieldmap::FieldmapDescription>()

Definition at line 313 of file Fieldmap.h.

Referenced by Fieldmap::clearDictionary(), Fieldmap::freeMap(), Fieldmap::getFieldmap(), Fieldmap::getListFieldmapNames(), and Fieldmap::readMap().

◆ FieldstrengthBt_m

Kokkos::DualView<double*> FM2DDynamic::FieldstrengthBt_m
private

2D array with Er, read in like Ez

Definition at line 173 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), freeMap(), getFieldstrength(), and readMap().

◆ FieldstrengthEr_m

Kokkos::DualView<double*> FM2DDynamic::FieldstrengthEr_m
private

2D array with Er, read in like Ez

Definition at line 172 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), freeMap(), getFieldstrength(), and readMap().

◆ FieldstrengthEz_m

Kokkos::DualView<double*> FM2DDynamic::FieldstrengthEz_m
private

Fieldstrengths.

2D array with Ez, read in first along z0 - r0 to rN then z1 - r0 to rN until zN - r0 to rN

Definition at line 170 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), freeMap(), getFieldstrength(), getOnaxisEz(), and readMap().

◆ Filename_m

◆ frequency_m

double FM2DDynamic::frequency_m
private

Definition at line 175 of file FM2DDynamic.h.

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

◆ hr_m

double FM2DDynamic::hr_m
private

length between points in grid, r-direction, m

Definition at line 187 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), computeField(), FM2DDynamic(), and getFieldstrength().

◆ hz_m

double FM2DDynamic::hz_m
private

Grid.

length between points in grid, z-direction, m

Definition at line 186 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), computeField(), FM2DDynamic(), and getFieldstrength().

◆ lines_read_m

◆ normalize_m

◆ num_gridpr_m

int FM2DDynamic::num_gridpr_m
private

Read in number of points after 0(not counted here) in grid, r-direction

Definition at line 188 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), computeField(), FM2DDynamic(), getFieldstrength(), and readMap().

◆ num_gridpz_m

int FM2DDynamic::num_gridpz_m
private

Read in number of points after 0(not counted here) in grid, z-direction

Definition at line 189 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), computeField(), FM2DDynamic(), getFieldstrength(), getOnaxisEz(), and readMap().

◆ rbegin_m

double FM2DDynamic::rbegin_m
private

Radius Bounds.

Definition at line 178 of file FM2DDynamic.h.

Referenced by FM2DDynamic().

◆ rend_m

double FM2DDynamic::rend_m
private

Definition at line 179 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), FM2DDynamic(), and isInside().

◆ swap_m

bool FM2DDynamic::swap_m
private

Definition at line 191 of file FM2DDynamic.h.

Referenced by FM2DDynamic(), readMap(), and swap().

◆ Type

◆ zbegin_m

double FM2DDynamic::zbegin_m
private

Z Bounds relative to element edge.

Definition at line 182 of file FM2DDynamic.h.

Referenced by applyField(), applyRFField(), computeField(), FM2DDynamic(), getFieldDimensions(), getFieldstrength(), getInfo(), getOnaxisEz(), and isInside().

◆ zend_m

double FM2DDynamic::zend_m
private

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