OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
AmrObject Class Referenceabstract

#include <AmrObject.h>

Inheritance diagram for AmrObject:
Inheritance graph
[legend]

Classes

struct  AmrInfo
 

Public Types

enum  TaggingCriteria {
  CHARGE_DENSITY = 0 , POTENTIAL , EFIELD , MOMENTA ,
  MIN_NUM_PARTICLES , MAX_NUM_PARTICLES
}
 Methods for tagging cells for refinement. More...
 
typedef std::pair< Vector_t, Vector_tVectorPair_t
 

Public Member Functions

 AmrObject ()
 
 AmrObject (TaggingCriteria tagging, double scaling, double chargedensity)
 
virtual ~AmrObject ()
 
virtual void getGridStatistics (std::map< int, long > &gridPtsPerCore, std::vector< int > &gridsPerLevel) const =0
 
virtual void initFineLevels ()=0
 
virtual void regrid (double time)=0
 
void setTagging (TaggingCriteria tagging)
 
void setTagging (const std::string &tagging)
 
void setScalingFactor (double scaling)
 
void setChargeDensity (double chargedensity)
 
void setMaxNumParticles (size_t maxNumPart)
 
void setMinNumParticles (size_t minNumPart)
 
virtual VectorPair_t getEExtrema ()=0
 
virtual double getRho (int x, int y, int z)=0
 
virtual void computeSelfFields ()=0
 
virtual void computeSelfFields (int b)=0
 
virtual void computeSelfFields_cycl (double gamma)=0
 
virtual void computeSelfFields_cycl (int b)=0
 
virtual void updateMesh ()=0
 
virtual Vektor< int, 3 > getBaseLevelGridPoints () const =0
 
virtual const int & maxLevel () const =0
 
virtual const int & finestLevel () const =0
 
virtual double getT () const =0
 
virtual void redistributeGrids (int)
 
const bool & isRefined () const
 

Static Public Member Functions

static std::string enum2string (int number)
 

Protected Attributes

TaggingCriteria tagging_m
 Tagging strategy. More...
 
double scaling_m
 Scaling factor for tagging [0, 1]. More...
 
double chargedensity_m
 Tagging value for CHARGE_DENSITY. More...
 
size_t maxNumPart_m
 Tagging value for MAX_NUM_PARTICLES. More...
 
size_t minNumPart_m
 Tagging value for MIN_NUM_PARTICLES. More...
 
bool refined_m
 Only set to true in AmrObject::initFineLevels() More...
 
IpplTimings::TimerRef amrSolveTimer_m
 timer for selfField calculation (used in concrete AmrObject classes) More...
 
IpplTimings::TimerRef amrRegridTimer_m
 

Detailed Description

Definition at line 31 of file AmrObject.h.

Member Typedef Documentation

◆ VectorPair_t

Definition at line 35 of file AmrObject.h.

Member Enumeration Documentation

◆ TaggingCriteria

Methods for tagging cells for refinement.

Enumerator
CHARGE_DENSITY 
POTENTIAL 
EFIELD 
MOMENTA 
MIN_NUM_PARTICLES 

min. #particles per cell

MAX_NUM_PARTICLES 

max. #particles per cell

Definition at line 39 of file AmrObject.h.

Constructor & Destructor Documentation

◆ AmrObject() [1/2]

AmrObject::AmrObject ( )

Definition at line 26 of file AmrObject.cpp.

◆ AmrObject() [2/2]

AmrObject::AmrObject ( TaggingCriteria  tagging,
double  scaling,
double  chargedensity 
)

Definition at line 31 of file AmrObject.cpp.

◆ ~AmrObject()

AmrObject::~AmrObject ( )
virtual

Definition at line 45 of file AmrObject.cpp.

Member Function Documentation

◆ computeSelfFields() [1/2]

virtual void AmrObject::computeSelfFields ( )
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::computeSelfFields().

◆ computeSelfFields() [2/2]

virtual void AmrObject::computeSelfFields ( int  b)
pure virtual

Implemented in AmrBoxLib.

◆ computeSelfFields_cycl() [1/2]

virtual void AmrObject::computeSelfFields_cycl ( double  gamma)
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::computeSelfFields_cycl().

◆ computeSelfFields_cycl() [2/2]

virtual void AmrObject::computeSelfFields_cycl ( int  b)
pure virtual

Implemented in AmrBoxLib.

◆ enum2string()

std::string AmrObject::enum2string ( int  number)
static

Used in Fieldsolver in order to convert a number that specifies the tagging to the corresponding string. Check enum TaggingCriteria for ordering.

Parameters
numberof tagging

Definition at line 100 of file AmrObject.cpp.

Referenced by FieldSolver::getTagging_m().

◆ finestLevel()

virtual const int & AmrObject::finestLevel ( ) const
pure virtual

Implemented in AmrBoxLib.

◆ getBaseLevelGridPoints()

virtual Vektor< int, 3 > AmrObject::getBaseLevelGridPoints ( ) const
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::updateDomainLength().

◆ getEExtrema()

virtual VectorPair_t AmrObject::getEExtrema ( )
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::getEExtrema().

◆ getGridStatistics()

virtual void AmrObject::getGridStatistics ( std::map< int, long > &  gridPtsPerCore,
std::vector< int > &  gridsPerLevel 
) const
pure virtual

Collect information about grid load balancing.

Parameters
gridPtsPerCoreis filled.
gridsPerLevelis filled

Implemented in AmrBoxLib.

Referenced by GridLBalWriter::write().

◆ getRho()

virtual double AmrObject::getRho ( int  x,
int  y,
int  z 
)
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::getRho().

◆ getT()

virtual double AmrObject::getT ( ) const
pure virtual
Returns
the time of the simulation

Implemented in AmrBoxLib.

◆ initFineLevels()

virtual void AmrObject::initFineLevels ( )
pure virtual

Setup all fine levels after object creation.

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::computeSelfFields_cycl(), and AmrPartBunch::do_binaryRepart().

◆ isRefined()

const bool & AmrObject::isRefined ( ) const

Used in AmrPartBunch to check if we need to refine first.

Returns
true fine grids are initialized

Definition at line 95 of file AmrObject.cpp.

References refined_m.

Referenced by AmrPartBunch::computeSelfFields_cycl(), and AmrPartBunch::do_binaryRepart().

◆ maxLevel()

virtual const int & AmrObject::maxLevel ( ) const
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::gatherLevelStatistics().

◆ redistributeGrids()

virtual void AmrObject::redistributeGrids ( int  )
inlinevirtual

Rebalance the grids among the cores

Reimplemented in AmrBoxLib.

Definition at line 163 of file AmrObject.h.

◆ regrid()

virtual void AmrObject::regrid ( double  time)
pure virtual

Update of mesh according to chosen refinement strategy.

Parameters
timeof regrid

Implemented in AmrBoxLib.

◆ setChargeDensity()

void AmrObject::setChargeDensity ( double  chargedensity)

Charge density for tagging with CHARGE_DENSITY

Parameters
chargedensity>= 0.0 (e.g. 1e-14)

Definition at line 80 of file AmrObject.cpp.

References chargedensity_m.

◆ setMaxNumParticles()

void AmrObject::setMaxNumParticles ( size_t  maxNumPart)

Maximum number of particles per cell for tagging

Parameters
maxNumPartis upper bound for a cell to be marked for refinement

Definition at line 85 of file AmrObject.cpp.

References maxNumPart_m.

◆ setMinNumParticles()

void AmrObject::setMinNumParticles ( size_t  minNumPart)

Minimum number of particles per cell for tagging

Parameters
minNumPartis lower bound for a cell to be marked for refinement

Definition at line 90 of file AmrObject.cpp.

References minNumPart_m.

◆ setScalingFactor()

void AmrObject::setScalingFactor ( double  scaling)

Scaling factor for tagging. It is used with POTENTIAL and EFIELD

Parameters
scalingfactor in [0, 1]

Definition at line 75 of file AmrObject.cpp.

References scaling_m.

◆ setTagging() [1/2]

void AmrObject::setTagging ( const std::string &  tagging)

Choose a new tagging strategy (string version). Is used in src/Structure/FieldSolver.cpp

Parameters
taggingstrategy

Definition at line 54 of file AmrObject.cpp.

References tagging_m.

◆ setTagging() [2/2]

void AmrObject::setTagging ( TaggingCriteria  tagging)

Choose a new tagging strategy. Is used in src/Structure/FieldSolver.cpp

Parameters
taggingstrategy

Definition at line 49 of file AmrObject.cpp.

References tagging_m.

◆ updateMesh()

virtual void AmrObject::updateMesh ( )
pure virtual

Implemented in AmrBoxLib.

Member Data Documentation

◆ amrRegridTimer_m

IpplTimings::TimerRef AmrObject::amrRegridTimer_m
protected

Definition at line 196 of file AmrObject.h.

Referenced by AmrBoxLib::regrid().

◆ amrSolveTimer_m

IpplTimings::TimerRef AmrObject::amrSolveTimer_m
protected

timer for selfField calculation (used in concrete AmrObject classes)

Definition at line 195 of file AmrObject.h.

Referenced by AmrBoxLib::computeSelfFields_cycl(), and AmrBoxLib::solvePoisson_m().

◆ chargedensity_m

double AmrObject::chargedensity_m
protected

Tagging value for CHARGE_DENSITY.

Definition at line 186 of file AmrObject.h.

Referenced by setChargeDensity(), and AmrBoxLib::tagForChargeDensity_m().

◆ maxNumPart_m

size_t AmrObject::maxNumPart_m
protected

Tagging value for MAX_NUM_PARTICLES.

Definition at line 188 of file AmrObject.h.

Referenced by setMaxNumParticles(), and AmrBoxLib::tagForMaxNumParticles_m().

◆ minNumPart_m

size_t AmrObject::minNumPart_m
protected

Tagging value for MIN_NUM_PARTICLES.

Definition at line 190 of file AmrObject.h.

Referenced by setMinNumParticles(), and AmrBoxLib::tagForMinNumParticles_m().

◆ refined_m

bool AmrObject::refined_m
protected

Only set to true in AmrObject::initFineLevels()

Definition at line 192 of file AmrObject.h.

Referenced by AmrBoxLib::initFineLevels(), and isRefined().

◆ scaling_m

double AmrObject::scaling_m
protected

Scaling factor for tagging [0, 1].

Definition at line 184 of file AmrObject.h.

Referenced by setScalingFactor(), AmrBoxLib::tagForEfield_m(), AmrBoxLib::tagForMomenta_m(), and AmrBoxLib::tagForPotentialStrength_m().

◆ tagging_m

TaggingCriteria AmrObject::tagging_m
protected

Tagging strategy.

Definition at line 182 of file AmrObject.h.

Referenced by AmrBoxLib::ErrorEst(), AmrBoxLib::preRegrid_m(), and setTagging().


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