OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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_t
VectorPair_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 (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 how)
 
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

The AMR interface to OPAL. A new AMR library needs to inherit from this class in order to work properly with OPAL. Among other things it specifies the refinement strategies.

Definition at line 19 of file AmrObject.h.

Member Typedef Documentation

Definition at line 23 of file AmrObject.h.

Member Enumeration Documentation

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 27 of file AmrObject.h.

Constructor & Destructor Documentation

AmrObject::AmrObject ( )

Definition at line 3 of file AmrObject.cpp.

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

Definition at line 8 of file AmrObject.cpp.

AmrObject::~AmrObject ( )
virtual

Definition at line 22 of file AmrObject.cpp.

Member Function Documentation

virtual void AmrObject::computeSelfFields ( )
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::computeSelfFields().

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

Implemented in AmrBoxLib.

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

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::computeSelfFields_cycl().

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

Implemented in AmrBoxLib.

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 79 of file AmrObject.cpp.

Referenced by FieldSolver::getTagging_m().

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

Implemented in AmrBoxLib.

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

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::updateDomainLength().

virtual VectorPair_t AmrObject::getEExtrema ( )
pure virtual

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::getEExtrema().

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().

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

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::getRho().

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

Implemented in AmrBoxLib.

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().

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 74 of file AmrObject.cpp.

References refined_m.

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

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

Implemented in AmrBoxLib.

Referenced by AmrPartBunch::gatherLevelStatistics().

virtual void AmrObject::redistributeGrids ( int  how)
inlinevirtual

Rebalance the grids among the cores

Reimplemented in AmrBoxLib.

Definition at line 151 of file AmrObject.h.

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

Update of mesh according to chosen refinement strategy.

Parameters
timeof regrid

Implemented in AmrBoxLib.

void AmrObject::setChargeDensity ( double  chargedensity)

Charge density for tagging with CHARGE_DENSITY

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

Definition at line 59 of file AmrObject.cpp.

References chargedensity_m.

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 64 of file AmrObject.cpp.

References maxNumPart_m.

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 69 of file AmrObject.cpp.

References minNumPart_m.

void AmrObject::setScalingFactor ( double  scaling)

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

Parameters
scalingfactor in [0, 1]

Definition at line 54 of file AmrObject.cpp.

References scaling_m.

void AmrObject::setTagging ( TaggingCriteria  tagging)

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

Parameters
taggingstrategy

Definition at line 26 of file AmrObject.cpp.

References tagging_m.

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

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

Parameters
taggingstrategy

Definition at line 31 of file AmrObject.cpp.

References tagging_m, and Util::toUpper().

Here is the call graph for this function:

virtual void AmrObject::updateMesh ( )
pure virtual

Implemented in AmrBoxLib.

Member Data Documentation

IpplTimings::TimerRef AmrObject::amrRegridTimer_m
protected

Definition at line 184 of file AmrObject.h.

Referenced by AmrBoxLib::regrid().

IpplTimings::TimerRef AmrObject::amrSolveTimer_m
protected

timer for selfField calculation (used in concrete AmrObject classes)

Definition at line 183 of file AmrObject.h.

Referenced by AmrBoxLib::computeSelfFields_cycl().

double AmrObject::chargedensity_m
protected

Tagging value for CHARGE_DENSITY.

Definition at line 174 of file AmrObject.h.

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

size_t AmrObject::maxNumPart_m
protected

Tagging value for MAX_NUM_PARTICLES.

Definition at line 176 of file AmrObject.h.

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

size_t AmrObject::minNumPart_m
protected

Tagging value for MIN_NUM_PARTICLES.

Definition at line 178 of file AmrObject.h.

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

bool AmrObject::refined_m
protected

Only set to true in AmrObject::initFineLevels()

Definition at line 180 of file AmrObject.h.

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

double AmrObject::scaling_m
protected

Scaling factor for tagging [0, 1].

Definition at line 172 of file AmrObject.h.

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

TaggingCriteria AmrObject::tagging_m
protected

Tagging strategy.

Definition at line 170 of file AmrObject.h.

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


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