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

#include <FieldSolver.h>

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

Public Member Functions

 FieldSolver ()
 Exemplar constructor. More...
 
virtual ~FieldSolver ()
 
virtual FieldSolverclone (const std::string &name)
 Make clone. More...
 
std::string getType ()
 
double getMX () const
 Return meshsize. More...
 
double getMY () const
 Return meshsize. More...
 
double getMT () const
 Return meshsize. More...
 
void setMX (double)
 Store emittance for mode 1. More...
 
void setMY (double)
 Store emittance for mode 2. More...
 
void setMT (double)
 Store emittance for mode 3. More...
 
virtual void update ()
 Update the field solver data. More...
 
virtual void execute ()
 Execute (init) the field solver data. More...
 
void initCartesianFields ()
 
void initSolver (PartBunchBase< double, 3 > *b)
 
bool hasValidSolver ()
 
void setFieldSolverType ()
 
FieldSolverType getFieldSolverType () const
 
Layout_tgetParticleLayout ()
 
FieldLayout_tgetFieldLayout ()
 
InformprintInfo (Inform &os) const
 
unsigned int getInteractionRadius ()
 
bool hasPeriodicZ ()
 
bool isAmrSolverType () const
 
AmrObjectgetAmrObject ()
 
const AmrObjectgetAmrObject () const
 
- Public Member Functions inherited from Definition
virtual ~Definition ()
 
virtual const std::string getCategory () const
 Return the object category as a string. More...
 
virtual bool shouldTrace () const
 Trace flag. More...
 
virtual bool shouldUpdate () const
 Update flag. More...
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
virtual bool canReplaceBy (Object *object)
 Test if replacement is allowed. More...
 
virtual Objectclone (const std::string &name)=0
 Return a clone. More...
 
void copyAttributes (const Object &)
 Copy attributes from another object. More...
 
virtual void execute ()
 Execute the command. More...
 
virtual AttributefindAttribute (const std::string &name)
 Find an attribute by name. More...
 
virtual const AttributefindAttribute (const std::string &name) const
 Find an attribute by name. More...
 
virtual const std::string getCategory () const =0
 Return the object category as a string. More...
 
virtual bool shouldTrace () const =0
 Trace flag. More...
 
virtual bool shouldUpdate () const =0
 Update flag. More...
 
virtual ObjectmakeTemplate (const std::string &, TokenStream &, Statement &)
 Macro handler function. More...
 
virtual ObjectmakeInstance (const std::string &name, Statement &, const Parser *)
 Macro handler function. More...
 
virtual void parse (Statement &)
 Parse the object. More...
 
virtual void parseShortcut (Statement &, bool eval=true)
 Parser for single-attribute commands. More...
 
virtual void print (std::ostream &) const
 Print the object. More...
 
virtual void printValue (std::ostream &) const
 
virtual void printHelp (std::ostream &) const
 Print help. More...
 
virtual void replace (Object *oldObject, Object *newObject)
 Replace references. More...
 
virtual void update ()
 Update this object. More...
 
bool isBuiltin () const
 True, if [b]this[/b] is a built-in object. More...
 
virtual bool isShared () const
 Shared flag. More...
 
virtual void setShared (bool)
 Set/reset shared flag. More...
 
void setDirty (bool)
 Set/reset the [b]modified[/b] flag. More...
 
bool isDirty () const
 True, if the [b]modified[/b] flag is set. More...
 
void setFlag (bool)
 Flag/unflag this object, e. g. to control output of objects for. More...
 
bool isFlagged () const
 True, if [b]this[/b] is flagged by setFlag(true). More...
 
const ObjectgetBaseObject () const
 Return the object's base type object. More...
 
const std::string & getOpalName () const
 Return object name. More...
 
ObjectgetParent () const
 Return parent pointer. More...
 
bool isTreeMember (const Object *subTree) const
 Test for tree membership. More...
 
void setOpalName (const std::string &name)
 Set object name. More...
 
void setParent (Object *)
 Set parent object. More...
 
void clear ()
 Clear the occurrence counter. More...
 
int increment ()
 Increment and return the occurrence counter. More...
 
int occurrenceCount ()
 Return the occurrence counter. More...
 
void registerReference (Invalidator *a)
 Register a reference to this object. More...
 
void unregisterReference (Invalidator *a)
 Unegister a reference to this object. More...
 
void registerOwnership (const AttributeHandler::OwnerType &itsClass) const
 
- Public Member Functions inherited from RCObject
int addReference () const
 Increment reference count. More...
 
int removeReference () const
 Decrement the reference count. More...
 
bool isShared () const
 Test for sharing. More...
 

Static Public Member Functions

static FieldSolverfind (const std::string &name)
 Find named FieldSolver. More...
 

Public Attributes

PoissonSolversolver_m
 the actual solver, should be a base object More...
 
- Public Attributes inherited from Object
std::vector< AttributeitsAttr
 The object attributes. More...
 

Private Member Functions

std::string getTagging_m () const
 
void initAmrObject_m ()
 
void initAmrSolver_m ()
 
 FieldSolver (const FieldSolver &)
 
void operator= (const FieldSolver &)
 
 FieldSolver (const std::string &name, FieldSolver *parent)
 

Private Attributes

std::unique_ptr< AmrObjectitsAmrObject_mp
 
Mesh_tmesh_m
 The cartesian mesh. More...
 
FieldLayout_tFL_m
 The field layout f. More...
 
std::unique_ptr< Layout_tPL_m
 The particle layout. More...
 
PartBunchBase< double, 3 > * itsBunch_m
 all the particles are here ... More...
 
std::string fsName_m
 
FieldSolverType fsType_m
 
double rpp_m
 

Additional Inherited Members

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

Detailed Description

Definition at line 52 of file FieldSolver.h.

Constructor & Destructor Documentation

◆ FieldSolver() [1/3]

FieldSolver::FieldSolver ( )

◆ ~FieldSolver()

FieldSolver::~FieldSolver ( )
virtual

Definition at line 366 of file FieldSolver.cpp.

References FL_m, mesh_m, and solver_m.

◆ FieldSolver() [2/3]

FieldSolver::FieldSolver ( const FieldSolver )
private

◆ FieldSolver() [3/3]

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

Definition at line 356 of file FieldSolver.cpp.

References FL_m, mesh_m, PL_m, and solver_m.

Member Function Documentation

◆ clone()

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

Make clone.

Implements Object.

Definition at line 381 of file FieldSolver.cpp.

References FieldSolver(), and name.

Here is the call graph for this function:

◆ execute()

void FieldSolver::execute ( )
virtual

Execute (init) the field solver data.

Reimplemented from Object.

Definition at line 385 of file FieldSolver.cpp.

References setFieldSolverType(), and update().

Here is the call graph for this function:

◆ find()

FieldSolver * FieldSolver::find ( const std::string &  name)
static

Find named FieldSolver.

Definition at line 390 of file FieldSolver.cpp.

References OpalData::find(), Hypervolume::fs, OpalData::getInstance(), and name.

Referenced by TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ getAmrObject() [1/2]

AmrObject * FieldSolver::getAmrObject ( )
inline

Definition at line 114 of file FieldSolver.h.

References itsAmrObject_mp.

Referenced by AmrPartBunch::setSolver().

◆ getAmrObject() [2/2]

const AmrObject * FieldSolver::getAmrObject ( ) const
inline

Definition at line 118 of file FieldSolver.h.

References itsAmrObject_mp.

◆ getFieldLayout()

FieldLayout_t * FieldSolver::getFieldLayout ( )
inline

Definition at line 103 of file FieldSolver.h.

References FL_m.

◆ getFieldSolverType()

FieldSolverType FieldSolver::getFieldSolverType ( ) const
inline

◆ getInteractionRadius()

unsigned int FieldSolver::getInteractionRadius ( )
inline

Definition at line 107 of file FieldSolver.h.

References rpp_m.

◆ getMT()

double FieldSolver::getMT ( ) const

Return meshsize.

Definition at line 411 of file FieldSolver.cpp.

References Attributes::getReal(), Object::itsAttr, and Attrib::Distribution::MT.

Referenced by initAmrObject_m(), initCartesianFields(), and TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ getMX()

double FieldSolver::getMX ( ) const

Return meshsize.

Definition at line 403 of file FieldSolver.cpp.

References Attributes::getReal(), Object::itsAttr, and Attrib::Distribution::MX.

Referenced by initAmrObject_m(), initCartesianFields(), and TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ getMY()

double FieldSolver::getMY ( ) const

Return meshsize.

Definition at line 407 of file FieldSolver.cpp.

References Attributes::getReal(), Object::itsAttr, and Attrib::Distribution::MY.

Referenced by initAmrObject_m(), initCartesianFields(), and TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ getParticleLayout()

Layout_t & FieldSolver::getParticleLayout ( )
inline

Definition at line 101 of file FieldSolver.h.

References PL_m.

◆ getTagging_m()

std::string FieldSolver::getTagging_m ( ) const
private

Definition at line 713 of file FieldSolver.cpp.

References Physics::c, AmrObject::enum2string(), PyOpal::PyPolynomialPatch::function(), Attributes::getString(), and Object::itsAttr.

Referenced by initAmrObject_m(), and printInfo().

Here is the call graph for this function:

◆ getType()

std::string FieldSolver::getType ( )

Definition at line 399 of file FieldSolver.cpp.

References Attributes::getString(), and Object::itsAttr.

Referenced by initAmrSolver_m(), and setFieldSolverType().

Here is the call graph for this function:

◆ hasPeriodicZ()

bool FieldSolver::hasPeriodicZ ( )

Definition at line 463 of file FieldSolver.cpp.

References Attributes::getString(), and Object::itsAttr.

Referenced by TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ hasValidSolver()

bool FieldSolver::hasValidSolver ( )

◆ initAmrObject_m()

void FieldSolver::initAmrObject_m ( )
private

◆ initAmrSolver_m()

void FieldSolver::initAmrSolver_m ( )
private

Definition at line 771 of file FieldSolver.cpp.

References AMRMG, FMG, fsType_m, Attributes::getBool(), Attributes::getReal(), Attributes::getString(), getType(), HPGMG, HYPRE, itsAmrObject_mp, Object::itsAttr, ML, and solver_m.

Referenced by initSolver().

Here is the call graph for this function:

◆ initCartesianFields()

void FieldSolver::initCartesianFields ( )

Definition at line 431 of file FieldSolver.cpp.

References FL_m, Attributes::getBool(), getMT(), getMX(), getMY(), Attributes::getString(), isAmrSolverType(), Object::itsAttr, mesh_m, PARALLEL, PL_m, and SERIAL.

Referenced by TrackRun::setupFieldsolver().

Here is the call graph for this function:

◆ initSolver()

void FieldSolver::initSolver ( PartBunchBase< double, 3 > *  b)

◆ isAmrSolverType()

bool FieldSolver::isAmrSolverType ( ) const

Definition at line 470 of file FieldSolver.cpp.

References Options::amr, AMRMG, FMG, fsType_m, and ML.

Referenced by initCartesianFields(), initSolver(), and printInfo().

◆ operator=()

void FieldSolver::operator= ( const FieldSolver )
private

◆ printInfo()

Inform & FieldSolver::printInfo ( Inform os) const

◆ setFieldSolverType()

void FieldSolver::setFieldSolverType ( )

Definition at line 481 of file FieldSolver.cpp.

References AMRMG, FFT, FFTBOX, FMG, fsName_m, fsType_m, getType(), HPGMG, HYPRE, ML, NONE, P3M, and SAAMG.

Referenced by execute().

Here is the call graph for this function:

◆ setMT()

void FieldSolver::setMT ( double  value)

Store emittance for mode 3.

Definition at line 423 of file FieldSolver.cpp.

References Object::itsAttr, Attrib::Distribution::MT, and Attributes::setReal().

Here is the call graph for this function:

◆ setMX()

void FieldSolver::setMX ( double  value)

Store emittance for mode 1.

Definition at line 415 of file FieldSolver.cpp.

References Object::itsAttr, Attrib::Distribution::MX, and Attributes::setReal().

Here is the call graph for this function:

◆ setMY()

void FieldSolver::setMY ( double  value)

Store emittance for mode 2.

Definition at line 419 of file FieldSolver.cpp.

References Object::itsAttr, Attrib::Distribution::MY, and Attributes::setReal().

Here is the call graph for this function:

◆ update()

void FieldSolver::update ( )
virtual

Update the field solver data.

Reimplemented from Object.

Definition at line 427 of file FieldSolver.cpp.

Referenced by execute().

Member Data Documentation

◆ FL_m

FieldLayout_t* FieldSolver::FL_m
private

The field layout f.

Definition at line 149 of file FieldSolver.h.

Referenced by FieldSolver(), getFieldLayout(), initCartesianFields(), initSolver(), and ~FieldSolver().

◆ fsName_m

std::string FieldSolver::fsName_m
private

Definition at line 157 of file FieldSolver.h.

Referenced by initSolver(), printInfo(), and setFieldSolverType().

◆ fsType_m

FieldSolverType FieldSolver::fsType_m
private

◆ itsAmrObject_mp

std::unique_ptr<AmrObject> FieldSolver::itsAmrObject_mp
private

Definition at line 135 of file FieldSolver.h.

Referenced by getAmrObject(), initAmrObject_m(), and initAmrSolver_m().

◆ itsBunch_m

PartBunchBase<double, 3>* FieldSolver::itsBunch_m
private

all the particles are here ...

Definition at line 155 of file FieldSolver.h.

Referenced by initAmrObject_m(), and initSolver().

◆ mesh_m

Mesh_t* FieldSolver::mesh_m
private

The cartesian mesh.

Definition at line 146 of file FieldSolver.h.

Referenced by FieldSolver(), initCartesianFields(), initSolver(), printInfo(), and ~FieldSolver().

◆ PL_m

std::unique_ptr<Layout_t> FieldSolver::PL_m
private

The particle layout.

Definition at line 152 of file FieldSolver.h.

Referenced by FieldSolver(), getParticleLayout(), initCartesianFields(), and printInfo().

◆ rpp_m

double FieldSolver::rpp_m
private

Definition at line 160 of file FieldSolver.h.

Referenced by getInteractionRadius().

◆ solver_m

PoissonSolver* FieldSolver::solver_m

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