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

#include <AmrBoxLib.h>

Inheritance diagram for AmrBoxLib:
Collaboration diagram for AmrBoxLib:

Public Types

enum  Strategy { RANK_ZERO = 0 , PFC = 1 , RANDOM = 2 , KNAPSACK = 3 }
typedef amr::AmrField_t AmrField_t
typedef amr::AmrScalarFieldContainer_t AmrScalarFieldContainer_t
typedef amr::AmrVectorFieldContainer_t AmrVectorFieldContainer_t
typedef amr::AmrGeomContainer_t AmrGeomContainer_t
typedef amr::AmrGridContainer_t AmrGridContainer_t
typedef amr::AmrProcMapContainer_t AmrProcMapContainer_t
typedef amr::AmrDomain_t AmrDomain_t
typedef amr::AmrIntArray_t AmrIntArray_t
typedef amr::AmrReal_t AmrReal_t
typedef amr::AmrGrid_t AmrGrid_t
typedef amr::AmrProcMap_t AmrProcMap_t
typedef amr::AmrGeometry_t AmrGeometry_t
typedef amr::AmrIntVect_t AmrIntVect_t
typedef amrex::FArrayBox FArrayBox_t
typedef amrex::Box Box_t
typedef amrex::TagBox TagBox_t
typedef amrex::TagBoxArray TagBoxArray_t
typedef amrex::MFIter MFIter_t
enum class  TaggingCriteria : unsigned int {
  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

 AmrBoxLib (const AmrDomain_t &domain, const AmrIntArray_t &nGridPts, int maxLevel, AmrPartBunch *bunch_p)
void regrid (double time)
void getGridStatistics (std::map< int, long > &gridPtsPerCore, std::vector< int > &gridsPerLevel) const
void initFineLevels ()
VectorPair_t getEExtrema ()
double getRho (int x, int y, int z)
void computeSelfFields ()
void computeSelfFields (int bin)
void computeSelfFields_cycl (double gamma)
void computeSelfFields_cycl (int bin)
void updateMesh ()
const Vector_tgetMeshScaling () const
Vektor< int, 3 > getBaseLevelGridPoints () const
const int & maxLevel () const
const int & finestLevel () const
double getT () const
void redistributeGrids (int how)
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)
const bool & isRefined () const

Static Public Member Functions

static std::unique_ptr< AmrBoxLibcreate (const AmrInfo &info, AmrPartBunch *bunch_p)
static std::string getTaggingString (int number)

Protected Member Functions

void RemakeLevel (int lev, AmrReal_t time, const AmrGrid_t &new_grids, const AmrProcMap_t &new_dmap)
void MakeNewLevel (int lev, AmrReal_t time, const AmrGrid_t &new_grids, const AmrProcMap_t &new_dmap)
void ClearLevel (int lev)
virtual void ErrorEst (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow) override
void MakeNewLevelFromScratch (int lev, AmrReal_t time, const AmrGrid_t &ba, const AmrProcMap_t &dm)
void MakeNewLevelFromCoarse (int lev, AmrReal_t time, const AmrGrid_t &ba, const AmrProcMap_t &dm)

Protected Attributes

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

Private Member Functions

void doRegrid_m (int lbase, double time)
void preRegrid_m ()
void postRegrid_m (int old_finest)
double solvePoisson_m ()
void tagForChargeDensity_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void tagForPotentialStrength_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void tagForEfield_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void tagForMomenta_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void tagForMaxNumParticles_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void tagForMinNumParticles_m (int lev, TagBoxArray_t &tags, AmrReal_t time, int ngrow)
void initBaseLevel_m (const AmrIntArray_t &nGridPts)
void fillPhysbc_m (AmrField_t &mf, int lev=0)

Static Private Member Functions

static void initParmParse_m (const AmrInfo &info, AmrLayout_t *layout_p)

Private Attributes

AmrPartBunchbunch_mp
 bunch used for tagging strategies
AmrLayout_tlayout_mp
AmrScalarFieldContainer_t rho_m
 charge density on the grid for all levels
AmrScalarFieldContainer_t phi_m
 scalar potential on the grid for all levels
AmrVectorFieldContainer_t efield_m
 vector field on the grid for all levels
Vector_t meshScaling_m
 in particle rest frame, the longitudinal length enlarged
std::vector< bool > isFirstTagging_m
bool isPoissonSolved_m

Detailed Description

Definition at line 39 of file AmrBoxLib.h.

Member Typedef Documentation

◆ AmrDomain_t

Definition at line 49 of file AmrBoxLib.h.

◆ AmrField_t

Definition at line 43 of file AmrBoxLib.h.

◆ AmrGeomContainer_t

◆ AmrGeometry_t

Definition at line 54 of file AmrBoxLib.h.

◆ AmrGrid_t

Definition at line 52 of file AmrBoxLib.h.

◆ AmrGridContainer_t

◆ AmrIntArray_t

Definition at line 50 of file AmrBoxLib.h.

◆ AmrIntVect_t

Definition at line 55 of file AmrBoxLib.h.

◆ AmrProcMap_t

Definition at line 53 of file AmrBoxLib.h.

◆ AmrProcMapContainer_t

◆ AmrReal_t

Definition at line 51 of file AmrBoxLib.h.

◆ AmrScalarFieldContainer_t

◆ AmrVectorFieldContainer_t

◆ Box_t

typedef amrex::Box AmrBoxLib::Box_t

Definition at line 58 of file AmrBoxLib.h.

◆ FArrayBox_t

typedef amrex::FArrayBox AmrBoxLib::FArrayBox_t

Definition at line 57 of file AmrBoxLib.h.

◆ MFIter_t

typedef amrex::MFIter AmrBoxLib::MFIter_t

Definition at line 61 of file AmrBoxLib.h.

◆ TagBox_t

typedef amrex::TagBox AmrBoxLib::TagBox_t

Definition at line 59 of file AmrBoxLib.h.

◆ TagBoxArray_t

typedef amrex::TagBoxArray AmrBoxLib::TagBoxArray_t

Definition at line 60 of file AmrBoxLib.h.

◆ VectorPair_t

typedef std::pair<Vector_t, Vector_t> AmrObject::VectorPair_t
inherited

Definition at line 35 of file AmrObject.h.

Member Enumeration Documentation

◆ Strategy

Used for the redistribution of grids

Enumerator
RANK_ZERO 
PFC 
RANDOM 
KNAPSACK 

Definition at line 66 of file AmrBoxLib.h.

◆ TaggingCriteria

enum class AmrObject::TaggingCriteria : unsigned int
stronginherited

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

◆ AmrBoxLib()

AmrBoxLib::AmrBoxLib ( const AmrDomain_t & domain,
const AmrIntArray_t & nGridPts,
int maxLevel,
AmrPartBunch * bunch_p )

See other constructors documentation for further info.

Parameters
domainis the physical domain of the problem
nGridPtsper dimension (nx, ny, nz / nt)
maxLevelof mesh refinement
bunchis used when we tag for charges per cell

Definition at line 47 of file AmrBoxLib.cpp.

References AmrObject::AmrObject(), bunch_mp, efield_m, initBaseLevel_m(), isFirstTagging_m, isPoissonSolved_m, layout_mp, maxLevel(), meshScaling_m, phi_m, rho_m, and updateMesh().

Referenced by create().

Here is the call graph for this function:

Member Function Documentation

◆ ClearLevel()

void AmrBoxLib::ClearLevel ( int lev)
protected

Clean up a level.

Parameters
levto free allocated memory.

Definition at line 656 of file AmrBoxLib.cpp.

References efield_m, isFirstTagging_m, phi_m, and rho_m.

Referenced by doRegrid_m().

◆ computeSelfFields() [1/2]

void AmrBoxLib::computeSelfFields ( )
virtual

Implements AmrObject.

Definition at line 228 of file AmrBoxLib.cpp.

◆ computeSelfFields() [2/2]

void AmrBoxLib::computeSelfFields ( int bin)
virtual

Implements AmrObject.

Definition at line 234 of file AmrBoxLib.cpp.

◆ computeSelfFields_cycl() [1/2]

void AmrBoxLib::computeSelfFields_cycl ( double gamma)
virtual

Lorentz transformation In particle rest frame, the longitudinal length (y for cyclotron) enlarged

Back Lorentz transformation

calculate coefficient

calculate B field from E field

Implements AmrObject.

Definition at line 240 of file AmrBoxLib.cpp.

References Options::amrYtDumpFreq, bunch_mp, Physics::c, AmrParticleBase< PLayout >::domainMapping(), efield_m, Physics::epsilon_0, finestLevel(), BoxLibParticle< PLayout >::gather(), phi_m, rho_m, AmrParticleBase< PLayout >::setForbidTransform(), solvePoisson_m(), AmrParticleBase< PLayout >::update(), AmrYtWriter::writeBunch(), and AmrYtWriter::writeFields().

Here is the call graph for this function:

◆ computeSelfFields_cycl() [2/2]

void AmrBoxLib::computeSelfFields_cycl ( int bin)
virtual

get gamma of this bin

scatter particles charge onto grid. from charge (C) to charge density (C/m^3).

Lorentz transformation

Back Lorentz transformation

Calculate coefficient

Calculate B_bin field from E_bin field accumulate B and E field

Implements AmrObject.

Definition at line 333 of file AmrBoxLib.cpp.

References Options::amrRegridFreq, AmrObject::amrSolveTimer_m, Options::amrYtDumpFreq, bunch_mp, Physics::c, AmrParticleBase< PLayout >::domainMapping(), efield_m, Physics::epsilon_0, fillPhysbc_m(), finestLevel(), BoxLibParticle< PLayout >::gather(), isPoissonSolved_m, meshScaling_m, phi_m, regrid(), rho_m, Units::s2ns, BoxLibParticle< PLayout >::scatter(), AmrParticleBase< PLayout >::setForbidTransform(), PoissonSolver::solve(), IpplTimings::startTimer(), IpplTimings::stopTimer(), AmrParticleBase< PLayout >::update(), AmrYtWriter::writeBunch(), and AmrYtWriter::writeFields().

Here is the call graph for this function:

◆ create()

std::unique_ptr< AmrBoxLib > AmrBoxLib::create ( const AmrInfo & info,
AmrPartBunch * bunch_p )
static

Create a new object

Parameters
infoare the initial informations to construct an AmrBoxLib object. It is set in src/Solvers/FieldSolver.cpp
bunch_ppointing to. Is used for getting the geometry (i.e. physical domain of the problem).

Definition at line 74 of file AmrBoxLib.cpp.

References AmrBoxLib(), PartBunchBase< T, Dim >::getLayout(), and initParmParse_m().

Referenced by FieldSolver::initAmrObject_m().

Here is the call graph for this function:

◆ doRegrid_m()

void AmrBoxLib::doRegrid_m ( int lbase,
double time )
private

Update of mesh according to chosen refinement strategy. Rebuild levels finer than lbase.

Parameters
lbasebase level to start regriding
timeof regrid

Definition at line 718 of file AmrBoxLib.cpp.

References ClearLevel(), layout_mp, MakeNewLevel(), PAssert, and RemakeLevel().

Referenced by regrid().

Here is the call graph for this function:

◆ ErrorEst()

void AmrBoxLib::ErrorEst ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
overrideprotectedvirtual

Is called in the AmrMesh function for performing tagging. (inherited from AmrMesh)

Definition at line 669 of file AmrBoxLib.cpp.

References AmrObject::CHARGE_DENSITY, AmrObject::EFIELD, endl(), gmsg, level2(), AmrObject::MAX_NUM_PARTICLES, AmrObject::MIN_NUM_PARTICLES, AmrObject::MOMENTA, AmrObject::POTENTIAL, tagForChargeDensity_m(), tagForEfield_m(), tagForMaxNumParticles_m(), tagForMinNumParticles_m(), tagForMomenta_m(), tagForPotentialStrength_m(), and AmrObject::tagging_m.

Here is the call graph for this function:

◆ fillPhysbc_m()

void AmrBoxLib::fillPhysbc_m ( AmrField_t & mf,
int lev = 0 )
private

Fill the physical / mesh boundary values

Parameters
mffield to fill boundary values

Definition at line 1518 of file AmrBoxLib.cpp.

Referenced by computeSelfFields_cycl(), and solvePoisson_m().

◆ finestLevel()

const int & AmrBoxLib::finestLevel ( ) const
inlinevirtual

Implements AmrObject.

Definition at line 520 of file AmrBoxLib.cpp.

Referenced by computeSelfFields_cycl(), and computeSelfFields_cycl().

◆ getBaseLevelGridPoints()

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

Implements AmrObject.

Definition at line 503 of file AmrBoxLib.cpp.

◆ getEExtrema()

AmrBoxLib::VectorPair_t AmrBoxLib::getEExtrema ( )
virtual

Implements AmrObject.

Definition at line 198 of file AmrBoxLib.cpp.

References bunch_mp, efield_m, max(), and min().

Here is the call graph for this function:

◆ getGridStatistics()

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

Collect information about grid load balancing.

Parameters
gridPtsPerCoreis filled.
gridsPerLevelis filled

Implements AmrObject.

Definition at line 137 of file AmrBoxLib.cpp.

◆ getMeshScaling()

const Vector_t & AmrBoxLib::getMeshScaling ( ) const

Mesh scaling for solver (gamma factor) (in particle rest frame, the longitudinal length enlarged)

Definition at line 498 of file AmrBoxLib.cpp.

References meshScaling_m.

◆ getRho()

double AmrBoxLib::getRho ( int x,
int y,
int z )
virtual

Implements AmrObject.

Definition at line 221 of file AmrBoxLib.cpp.

◆ getT()

double AmrBoxLib::getT ( ) const
inlinevirtual
Returns
the time of the bunch [s]

Implements AmrObject.

Definition at line 525 of file AmrBoxLib.cpp.

References bunch_mp.

◆ getTaggingString()

std::string AmrObject::getTaggingString ( int number)
staticinherited

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

References CHARGE_DENSITY, EFIELD, MAX_NUM_PARTICLES, MIN_NUM_PARTICLES, MOMENTA, and POTENTIAL.

Referenced by FieldSolver::getTagging_m().

◆ initBaseLevel_m()

void AmrBoxLib::initBaseLevel_m ( const AmrIntArray_t & nGridPts)
private

Use particle BoxArray and DistributionMapping for AmrObject and reset geometry for bunch

Parameters
nGridPtsper dimension (nx, ny, nz / nt)

Definition at line 1191 of file AmrBoxLib.cpp.

References layout_mp, and RemakeLevel().

Referenced by AmrBoxLib().

Here is the call graph for this function:

◆ initFineLevels()

void AmrBoxLib::initFineLevels ( )
virtual

Initial gridding. Sets up all levels.

Implements AmrObject.

Definition at line 164 of file AmrBoxLib.cpp.

References bunch_mp, AmrParticleBase< PLayout >::domainMapping(), endl(), gmsg, AmrParticleBase< PLayout >::isForbidTransform(), AmrObject::refined_m, regrid(), Units::s2ns, and AmrParticleBase< PLayout >::setForbidTransform().

Here is the call graph for this function:

◆ initParmParse_m()

void AmrBoxLib::initParmParse_m ( const AmrInfo & info,
AmrLayout_t * layout_p )
staticprivate

AMReX uses the ParmParse object to initialize parameters like the maximum level etc. This function initializes "all" of them.

Parameters
infoall parameters that we set over the OPAL input file
layout_pof bunch

Definition at line 1217 of file AmrBoxLib.cpp.

Referenced by create().

◆ isRefined()

const bool & AmrObject::isRefined ( ) const
inherited

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

Returns
true fine grids are initialized

Definition at line 98 of file AmrObject.cpp.

References refined_m.

◆ MakeNewLevel()

void AmrBoxLib::MakeNewLevel ( int lev,
AmrReal_t time,
const AmrGrid_t & new_grids,
const AmrProcMap_t & new_dmap )
protected

Create completeley new grids for a level (inherited from AmrMesh)

Parameters
levis the current level
timenot used
new_gridsare the new created grids for this level
new_dmapis the new distribution to processors

Definition at line 624 of file AmrBoxLib.cpp.

References efield_m, layout_mp, phi_m, and rho_m.

Referenced by doRegrid_m().

◆ MakeNewLevelFromCoarse()

void AmrBoxLib::MakeNewLevelFromCoarse ( int lev,
AmrReal_t time,
const AmrGrid_t & ba,
const AmrProcMap_t & dm )
protected

Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data.

Remark: Not used in OPAL

Parameters
levto create
timeof simulation
bathe boxes
dmthe grid distribution among cores

Definition at line 710 of file AmrBoxLib.cpp.

◆ MakeNewLevelFromScratch()

void AmrBoxLib::MakeNewLevelFromScratch ( int lev,
AmrReal_t time,
const AmrGrid_t & ba,
const AmrProcMap_t & dm )
protected

Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization.

Remark: Not used in OPAL

Parameters
levto create
timeof simulation
bathe boxes
dmthe grid distribution among cores

Definition at line 702 of file AmrBoxLib.cpp.

◆ maxLevel()

const int & AmrBoxLib::maxLevel ( ) const
inlinevirtual

Implements AmrObject.

Definition at line 515 of file AmrBoxLib.cpp.

Referenced by AmrBoxLib().

◆ postRegrid_m()

void AmrBoxLib::postRegrid_m ( int old_finest)
private

Called within doRegrid_m(). Redistribute particles and delete levels on particle side.

Parameters
old_finestlevel

Definition at line 770 of file AmrBoxLib.cpp.

References bunch_mp, AmrParticleBase< PLayout >::getLocalNumPerLevel(), PoissonSolver::hasToRegrid(), layout_mp, and AmrParticleBase< PLayout >::update().

Referenced by regrid().

Here is the call graph for this function:

◆ preRegrid_m()

void AmrBoxLib::preRegrid_m ( )
private

Called within doRegrid_m(). Especially used for potential and e-field tagging in combination with binning.

Definition at line 754 of file AmrBoxLib.cpp.

References AmrObject::EFIELD, AmrObject::POTENTIAL, solvePoisson_m(), and AmrObject::tagging_m.

Referenced by regrid().

Here is the call graph for this function:

◆ redistributeGrids()

void AmrBoxLib::redistributeGrids ( int )
virtual

Rebalance the grids among the cores

Reimplemented from AmrObject.

Definition at line 530 of file AmrBoxLib.cpp.

◆ regrid()

void AmrBoxLib::regrid ( double time)
virtual

Inherited from AmrObject

Implements AmrObject.

Definition at line 106 of file AmrBoxLib.cpp.

References AmrObject::amrRegridTimer_m, doRegrid_m(), endl(), gmsg, postRegrid_m(), preRegrid_m(), IpplTimings::startTimer(), and IpplTimings::stopTimer().

Referenced by computeSelfFields_cycl(), and initFineLevels().

Here is the call graph for this function:

◆ RemakeLevel()

void AmrBoxLib::RemakeLevel ( int lev,
AmrReal_t time,
const AmrGrid_t & new_grids,
const AmrProcMap_t & new_dmap )
protected

Update the grids and the distributionmapping for a specific level (inherited from AmrMesh)

Parameters
levis the current level
timenot used
new_gridsare the new created grids for this level
new_dmapis the new distribution to processors

Definition at line 591 of file AmrBoxLib.cpp.

References efield_m, layout_mp, phi_m, and rho_m.

Referenced by doRegrid_m(), and initBaseLevel_m().

◆ setChargeDensity()

void AmrObject::setChargeDensity ( double chargedensity)
inherited

Charge density for tagging with CHARGE_DENSITY

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

Definition at line 83 of file AmrObject.cpp.

References chargedensity_m.

◆ setMaxNumParticles()

void AmrObject::setMaxNumParticles ( size_t maxNumPart)
inherited

Maximum number of particles per cell for tagging

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

Definition at line 88 of file AmrObject.cpp.

References maxNumPart_m.

◆ setMinNumParticles()

void AmrObject::setMinNumParticles ( size_t minNumPart)
inherited

Minimum number of particles per cell for tagging

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

Definition at line 93 of file AmrObject.cpp.

References minNumPart_m.

◆ setScalingFactor()

void AmrObject::setScalingFactor ( double scaling)
inherited

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

Parameters
scalingfactor in [0, 1]

Definition at line 78 of file AmrObject.cpp.

References scaling_m.

◆ setTagging() [1/2]

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

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

Parameters
taggingstrategy

Definition at line 56 of file AmrObject.cpp.

References CHARGE_DENSITY, EFIELD, MAX_NUM_PARTICLES, MIN_NUM_PARTICLES, MOMENTA, POTENTIAL, and tagging_m.

◆ setTagging() [2/2]

void AmrObject::setTagging ( TaggingCriteria tagging)
inherited

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

Parameters
taggingstrategy

Definition at line 51 of file AmrObject.cpp.

References tagging_m.

◆ solvePoisson_m()

double AmrBoxLib::solvePoisson_m ( )
private

from charge (C) to charge density (C/m^3).

Definition at line 809 of file AmrBoxLib.cpp.

References AmrObject::amrSolveTimer_m, bunch_mp, efield_m, Physics::epsilon_0, fillPhysbc_m(), meshScaling_m, phi_m, rho_m, BoxLibParticle< PLayout >::scatter(), PoissonSolver::solve(), IpplTimings::startTimer(), and IpplTimings::stopTimer().

Referenced by computeSelfFields_cycl(), and preRegrid_m().

Here is the call graph for this function:

◆ tagForChargeDensity_m()

void AmrBoxLib::tagForChargeDensity_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if the value is greater equal than some amount of charge (AmrObject::chargedensity_m).

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 858 of file AmrBoxLib.cpp.

References bunch_mp, AmrObject::chargedensity_m, AmrParticleBase< PLayout >::getScalingFactor(), rho_m, BoxLibParticle< PLayout >::scatter(), and AmrParticleBase< PLayout >::update().

Referenced by ErrorEst(), tagForEfield_m(), and tagForPotentialStrength_m().

Here is the call graph for this function:

◆ tagForEfield_m()

void AmrBoxLib::tagForEfield_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if one of the electric field components is greater equal the maximum electric field value per direction scaled by some factor [0, 1] (AmrObject::scaling_m).

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 965 of file AmrBoxLib.cpp.

References efield_m, endl(), gmsg, isFirstTagging_m, isPoissonSolved_m, level2(), AmrObject::scaling_m, and tagForChargeDensity_m().

Referenced by ErrorEst().

Here is the call graph for this function:

◆ tagForMaxNumParticles_m()

void AmrBoxLib::tagForMaxNumParticles_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if it contains at most AmrObject::maxNumPart_m particles.

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 1089 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, AmrParticleBase< PLayout >::getLocalNumPerLevel(), layout_mp, AmrObject::maxNumPart_m, rho_m, and AmrParticleBase< PLayout >::update().

Referenced by ErrorEst().

Here is the call graph for this function:

◆ tagForMinNumParticles_m()

void AmrBoxLib::tagForMinNumParticles_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if it contains at least AmrObject::minNumPart_m particles.

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 1139 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, AmrParticleBase< PLayout >::getLocalNumPerLevel(), layout_mp, AmrObject::minNumPart_m, rho_m, and AmrParticleBase< PLayout >::update().

Referenced by ErrorEst().

Here is the call graph for this function:

◆ tagForMomenta_m()

void AmrBoxLib::tagForMomenta_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if at least one particle has a high momentum. The lower bound is specified by the maximum momenta per level scaled by some factor [0, 1] (AmrObject::scaling_m).

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 1030 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, dot(), AmrParticleBase< PLayout >::getLocalNumPerLevel(), layout_mp, rho_m, AmrObject::scaling_m, and AmrParticleBase< PLayout >::update().

Referenced by ErrorEst().

Here is the call graph for this function:

◆ tagForPotentialStrength_m()

void AmrBoxLib::tagForPotentialStrength_m ( int lev,
TagBoxArray_t & tags,
AmrReal_t time,
int ngrow )
private

Mark a cell for refinement if the potential value is greater equal than the maximum value of the potential on the grid scaled by some factor [0, 1] (AmrObject::scaling_m)

Parameters
levto check for refinement
tagsis a special box array that marks cells for refinement
timeof simulation (not used)
ngrowis the number of ghost cells (not used)

Definition at line 911 of file AmrBoxLib.cpp.

References endl(), gmsg, isFirstTagging_m, isPoissonSolved_m, level2(), phi_m, AmrObject::scaling_m, and tagForChargeDensity_m().

Referenced by ErrorEst().

Here is the call graph for this function:

◆ updateMesh()

void AmrBoxLib::updateMesh ( )
virtual

Implements AmrObject.

Definition at line 486 of file AmrBoxLib.cpp.

References bunch_mp.

Referenced by AmrBoxLib().

Member Data Documentation

◆ amrRegridTimer_m

IpplTimings::TimerRef AmrObject::amrRegridTimer_m
protectedinherited

Definition at line 193 of file AmrObject.h.

Referenced by AmrObject(), and AmrBoxLib::regrid().

◆ amrSolveTimer_m

IpplTimings::TimerRef AmrObject::amrSolveTimer_m
protectedinherited

timer for selfField calculation (used in concrete AmrObject classes)

Definition at line 192 of file AmrObject.h.

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

◆ bunch_mp

◆ chargedensity_m

double AmrObject::chargedensity_m
protectedinherited

Tagging value for CHARGE_DENSITY.

Definition at line 183 of file AmrObject.h.

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

◆ efield_m

AmrVectorFieldContainer_t AmrBoxLib::efield_m
private

vector field on the grid for all levels

Definition at line 397 of file AmrBoxLib.h.

Referenced by AmrBoxLib(), ClearLevel(), computeSelfFields_cycl(), computeSelfFields_cycl(), getEExtrema(), MakeNewLevel(), RemakeLevel(), solvePoisson_m(), and tagForEfield_m().

◆ isFirstTagging_m

std::vector<bool> AmrBoxLib::isFirstTagging_m
private

Definition at line 403 of file AmrBoxLib.h.

Referenced by AmrBoxLib(), ClearLevel(), tagForEfield_m(), and tagForPotentialStrength_m().

◆ isPoissonSolved_m

bool AmrBoxLib::isPoissonSolved_m
private

◆ layout_mp

◆ maxNumPart_m

size_t AmrObject::maxNumPart_m
protectedinherited

Tagging value for MAX_NUM_PARTICLES.

Definition at line 185 of file AmrObject.h.

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

◆ meshScaling_m

Vector_t AmrBoxLib::meshScaling_m
private

in particle rest frame, the longitudinal length enlarged

Definition at line 400 of file AmrBoxLib.h.

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

◆ minNumPart_m

size_t AmrObject::minNumPart_m
protectedinherited

Tagging value for MIN_NUM_PARTICLES.

Definition at line 187 of file AmrObject.h.

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

◆ phi_m

AmrScalarFieldContainer_t AmrBoxLib::phi_m
private

scalar potential on the grid for all levels

Definition at line 394 of file AmrBoxLib.h.

Referenced by AmrBoxLib(), ClearLevel(), computeSelfFields_cycl(), computeSelfFields_cycl(), MakeNewLevel(), RemakeLevel(), solvePoisson_m(), and tagForPotentialStrength_m().

◆ refined_m

bool AmrObject::refined_m
protectedinherited

Only set to true in AmrObject::initFineLevels().

Definition at line 189 of file AmrObject.h.

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

◆ rho_m

◆ scaling_m

double AmrObject::scaling_m
protectedinherited

Scaling factor for tagging [0, 1].

Definition at line 181 of file AmrObject.h.

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

◆ tagging_m

TaggingCriteria AmrObject::tagging_m
protectedinherited

Tagging strategy.

Definition at line 179 of file AmrObject.h.

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


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