OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
AmrBoxLib Class Reference

#include <AmrBoxLib.h>

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

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
 
- Public Types inherited from AmrObject
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

 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)
 
- Public Member Functions inherited from AmrObject
 AmrObject ()
 
 AmrObject (TaggingCriteria tagging, double scaling, double chargedensity)
 
virtual ~AmrObject ()
 
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 Public Member Functions inherited from AmrObject
static std::string enum2string (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)
 

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 More...
 
AmrLayout_tlayout_mp
 
AmrScalarFieldContainer_t rho_m
 charge density on the grid for all levels More...
 
AmrScalarFieldContainer_t phi_m
 scalar potential on the grid for all levels More...
 
AmrVectorFieldContainer_t efield_m
 vector field on the grid for all levels More...
 
Vector_t meshScaling_m
 in particle rest frame, the longitudinal length enlarged More...
 
std::vector< bool > isFirstTagging_m
 
bool isPoissonSolved_m
 

Additional Inherited Members

- Protected Attributes inherited from AmrObject
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 36 of file AmrBoxLib.h.

Member Typedef Documentation

◆ AmrDomain_t

Definition at line 47 of file AmrBoxLib.h.

◆ AmrField_t

Definition at line 41 of file AmrBoxLib.h.

◆ AmrGeomContainer_t

Definition at line 44 of file AmrBoxLib.h.

◆ AmrGeometry_t

Definition at line 52 of file AmrBoxLib.h.

◆ AmrGrid_t

Definition at line 50 of file AmrBoxLib.h.

◆ AmrGridContainer_t

Definition at line 45 of file AmrBoxLib.h.

◆ AmrIntArray_t

Definition at line 48 of file AmrBoxLib.h.

◆ AmrIntVect_t

Definition at line 53 of file AmrBoxLib.h.

◆ AmrProcMap_t

Definition at line 51 of file AmrBoxLib.h.

◆ AmrProcMapContainer_t

Definition at line 46 of file AmrBoxLib.h.

◆ AmrReal_t

Definition at line 49 of file AmrBoxLib.h.

◆ AmrScalarFieldContainer_t

Definition at line 42 of file AmrBoxLib.h.

◆ AmrVectorFieldContainer_t

Definition at line 43 of file AmrBoxLib.h.

◆ Box_t

typedef amrex::Box AmrBoxLib::Box_t

Definition at line 56 of file AmrBoxLib.h.

◆ FArrayBox_t

typedef amrex::FArrayBox AmrBoxLib::FArrayBox_t

Definition at line 55 of file AmrBoxLib.h.

◆ MFIter_t

typedef amrex::MFIter AmrBoxLib::MFIter_t

Definition at line 59 of file AmrBoxLib.h.

◆ TagBox_t

typedef amrex::TagBox AmrBoxLib::TagBox_t

Definition at line 57 of file AmrBoxLib.h.

◆ TagBoxArray_t

typedef amrex::TagBoxArray AmrBoxLib::TagBoxArray_t

Definition at line 58 of file AmrBoxLib.h.

Member Enumeration Documentation

◆ Strategy

Used for the redistribution of grids

Enumerator
RANK_ZERO 
PFC 
RANDOM 
KNAPSACK 

Definition at line 65 of file AmrBoxLib.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 44 of file AmrBoxLib.cpp.

References initBaseLevel_m(), layout_mp, maxLevel(), BoxLibLayout< T, Dim >::resize(), 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 657 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 226 of file AmrBoxLib.cpp.

◆ computeSelfFields() [2/2]

void AmrBoxLib::computeSelfFields ( int  bin)
virtual

Implements AmrObject.

Definition at line 232 of file AmrBoxLib.cpp.

◆ computeSelfFields_cycl() [1/2]

void AmrBoxLib::computeSelfFields_cycl ( double  gamma)
virtual

◆ computeSelfFields_cycl() [2/2]

void AmrBoxLib::computeSelfFields_cycl ( int  bin)
virtual

◆ 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 71 of file AmrBoxLib.cpp.

References AmrBoxLib(), PartBunchBase< T, Dim >::getLayout(), Options::info, 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 719 of file AmrBoxLib.cpp.

References ClearLevel(), layout_mp, MakeNewLevel(), PAssert, RemakeLevel(), and ParticleAmrLayout< T, Dim >::setFinestLevel().

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

◆ 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 1519 of file AmrBoxLib.cpp.

References Hypervolume::n.

Referenced by computeSelfFields_cycl(), and solvePoisson_m().

◆ finestLevel()

const int & AmrBoxLib::finestLevel ( ) const
inlinevirtual

Implements AmrObject.

Definition at line 518 of file AmrBoxLib.cpp.

Referenced by computeSelfFields_cycl().

◆ getBaseLevelGridPoints()

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

Implements AmrObject.

Definition at line 501 of file AmrBoxLib.cpp.

◆ getEExtrema()

AmrBoxLib::VectorPair_t AmrBoxLib::getEExtrema ( )
virtual

Implements AmrObject.

Definition at line 196 of file AmrBoxLib.cpp.

References bunch_mp, PartBunchBase< T, Dim >::Dimension, 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 135 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 496 of file AmrBoxLib.cpp.

References meshScaling_m.

Referenced by AmrMultiGrid::initLevels_m().

◆ getRho()

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

Implements AmrObject.

Definition at line 219 of file AmrBoxLib.cpp.

◆ getT()

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

Implements AmrObject.

Definition at line 523 of file AmrBoxLib.cpp.

References bunch_mp, and PartBunchBase< T, Dim >::getT().

Referenced by AmrMultiGrid::writeSDDSData_m().

Here is the call graph for this function:

◆ 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 1192 of file AmrBoxLib.cpp.

References BoxLibLayout< T, Dim >::define(), layout_mp, and RemakeLevel().

Referenced by AmrBoxLib().

Here is the call graph for this function:

◆ initFineLevels()

void AmrBoxLib::initFineLevels ( )
virtual

◆ 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 1218 of file AmrBoxLib.cpp.

References Options::info.

Referenced by create().

◆ 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 622 of file AmrBoxLib.cpp.

References BoxLibLayout< T, Dim >::buildLevelMask(), efield_m, layout_mp, phi_m, and rho_m.

Referenced by doRegrid_m().

Here is the call graph for this function:

◆ 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 711 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 703 of file AmrBoxLib.cpp.

◆ maxLevel()

const int & AmrBoxLib::maxLevel ( ) const
inlinevirtual

Implements AmrObject.

Definition at line 513 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 771 of file AmrBoxLib.cpp.

References bunch_mp, BoxLibLayout< T, Dim >::clearLevelMask(), AmrPartBunch::getAmrParticleBase(), AmrPartBunch::getFieldSolver(), PartBunchBase< T, Dim >::getLocalNum(), 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 755 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 528 of file AmrBoxLib.cpp.

◆ regrid()

void AmrBoxLib::regrid ( double  time)
virtual

Inherited from AmrObject

Implements AmrObject.

Definition at line 104 of file AmrBoxLib.cpp.

References AmrObject::amrRegridTimer_m, doRegrid_m(), endl(), gmsg, min(), 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 589 of file AmrBoxLib.cpp.

References BoxLibLayout< T, Dim >::buildLevelMask(), efield_m, layout_mp, phi_m, and rho_m.

Referenced by doRegrid_m(), and initBaseLevel_m().

Here is the call graph for this function:

◆ solvePoisson_m()

double AmrBoxLib::solvePoisson_m ( )
private

◆ 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 859 of file AmrBoxLib.cpp.

References abs(), PartBunchBase< T, Dim >::Bin, bunch_mp, AmrObject::chargedensity_m, AmrPartBunch::getAmrParticleBase(), AmrParticleBase< PLayout >::getScalingFactor(), PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, 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 966 of file AmrBoxLib.cpp.

References abs(), 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 1090 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, AmrPartBunch::getAmrParticleBase(), AmrParticleBase< PLayout >::getLocalNumPerLevel(), BoxLibLayout< T, Dim >::Index(), layout_mp, AmrObject::maxNumPart_m, PartBunchBase< T, Dim >::R, 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 1140 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, AmrPartBunch::getAmrParticleBase(), AmrParticleBase< PLayout >::getLocalNumPerLevel(), BoxLibLayout< T, Dim >::Index(), layout_mp, AmrObject::minNumPart_m, PartBunchBase< T, Dim >::R, 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 1031 of file AmrBoxLib.cpp.

References AmrParticleLevelCounter< Key, T, Compare, Allocator >::begin(), bunch_mp, dot(), AmrPartBunch::getAmrParticleBase(), AmrParticleBase< PLayout >::getLocalNumPerLevel(), BoxLibLayout< T, Dim >::Index(), layout_mp, PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::R, 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 912 of file AmrBoxLib.cpp.

References abs(), 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 484 of file AmrBoxLib.cpp.

References bunch_mp, and AmrPartBunch::setBaseLevelMeshSpacing().

Referenced by AmrBoxLib().

Here is the call graph for this function:

Member Data Documentation

◆ bunch_mp

AmrPartBunch* AmrBoxLib::bunch_mp
private

◆ efield_m

AmrVectorFieldContainer_t AmrBoxLib::efield_m
private

vector field on the grid for all levels

Definition at line 400 of file AmrBoxLib.h.

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

◆ isFirstTagging_m

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

Definition at line 406 of file AmrBoxLib.h.

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

◆ isPoissonSolved_m

bool AmrBoxLib::isPoissonSolved_m
private

Definition at line 408 of file AmrBoxLib.h.

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

◆ layout_mp

AmrLayout_t* AmrBoxLib::layout_mp
private

◆ meshScaling_m

Vector_t AmrBoxLib::meshScaling_m
private

in particle rest frame, the longitudinal length enlarged

Definition at line 403 of file AmrBoxLib.h.

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

◆ phi_m

AmrScalarFieldContainer_t AmrBoxLib::phi_m
private

scalar potential on the grid for all levels

Definition at line 397 of file AmrBoxLib.h.

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

◆ rho_m

AmrScalarFieldContainer_t AmrBoxLib::rho_m
private

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