#include <AMReX_AmrMesh.H>
Public Member Functions | |
AmrMesh () | |
AmrMesh (const RealBox *rb, int max_level_in, const Vector< int > &n_cell_in, int coord=-1, Vector< IntVect > refrat=Vector< IntVect >(), const int *is_per=nullptr) | |
AmrMesh (const RealBox &rb, int max_level_in, const Vector< int > &n_cell_in, int coord, Vector< IntVect > const &a_refrat, Array< int, AMREX_SPACEDIM > const &is_per) | |
AmrMesh (Geometry const &level_0_geom, AmrInfo const &amr_info) | |
AmrMesh (const AmrMesh &rhs)=delete | |
AmrMesh & | operator= (const AmrMesh &rhs)=delete |
AmrMesh (AmrMesh &&rhs)=default | |
AmrMesh & | operator= (AmrMesh &&rhs)=default |
virtual | ~AmrMesh ()=default |
int | Verbose () const noexcept |
int | maxLevel () const noexcept |
Return the max level. More... | |
int | finestLevel () const noexcept |
Return the finest level. More... | |
IntVect | refRatio (int lev) const noexcept |
Return the refinement ratio for level lev. More... | |
int | MaxRefRatio (int lev) const noexcept |
Return the maximum refinement ratio in any direction. More... | |
const Vector< IntVect > & | refRatio () const noexcept |
Return refinement ratios between all levels. More... | |
const Vector< Geometry > & | Geom () const noexcept |
const Vector< DistributionMapping > & | DistributionMap () const noexcept |
const Vector< BoxArray > & | boxArray () const noexcept |
const Geometry & | Geom (int lev) const noexcept |
const DistributionMapping & | DistributionMap (int lev) const noexcept |
const BoxArray & | boxArray (int lev) const noexcept |
Vector< Geometry > | Geom (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< BoxArray > | boxArray (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< DistributionMapping > | DistributionMap (int a_coarsest_lev, int a_finest_lev) const noexcept |
Vector< Geometry > & | Geom () noexcept |
Geometry & | Geom (int lev) noexcept |
void | SetMaxGridSize (int new_mgs) noexcept |
void | SetMaxGridSize (const IntVect &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< int > &new_mgs) noexcept |
void | SetMaxGridSize (const Vector< IntVect > &new_mgs) noexcept |
void | SetBlockingFactor (int new_bf) noexcept |
void | SetBlockingFactor (const IntVect &new_bf) noexcept |
void | SetBlockingFactor (const Vector< int > &new_bf) noexcept |
void | SetBlockingFactor (const Vector< IntVect > &new_bf) noexcept |
void | SetGridEff (Real eff) noexcept |
void | SetNProper (int n) noexcept |
void | SetFinestLevel (int new_finest_level) noexcept |
Set ref_ratio would require rebuilding Geometry objects. More... | |
void | SetDistributionMap (int lev, const DistributionMapping &dmap_in) noexcept |
void | SetBoxArray (int lev, const BoxArray &ba_in) noexcept |
void | SetGeometry (int lev, const Geometry &geom_in) noexcept |
int | GetLevel (Box const &domain) const noexcept |
Given domain box, return AMR level. Return -1 if there is no match. More... | |
void | ClearDistributionMap (int lev) noexcept |
void | ClearBoxArray (int lev) noexcept |
int | nErrorBuf (int lev, int direction=0) const noexcept |
Return the number of buffer cells (as a single integer) in error estimator. More... | |
const IntVect & | nErrorBufVect (int lev) const noexcept |
Return the number of buffer cells (as an IntVect) in error estimator. More... | |
Real | gridEff () const noexcept |
Return the minimum allowable grid efficiency. More... | |
int | nProper () const noexcept |
Return the number of cells to define proper nesting. More... | |
const IntVect & | blockingFactor (int lev) const noexcept |
Return the blocking factor at level lev. More... | |
const IntVect & | maxGridSize (int lev) const noexcept |
Return the largest allowable grid. More... | |
bool | LevelDefined (int lev) const noexcept |
bool | useFixedCoarseGrids () const noexcept |
Should we keep the coarser grids fixed (and not regrid those levels) at all? More... | |
int | useFixedUpToLevel () const noexcept |
Up to what level should we keep the coarser grids fixed (and not regrid those levels)? More... | |
void | ChopGrids (int lev, BoxArray &ba, int target_size) const |
"Try" to chop up grids so that the number of boxes in the BoxArray is greater than the target_size. More... | |
BoxArray | MakeBaseGrids () const |
Make a level 0 grids covering the whole domain. It does NOT install the new grids. More... | |
void | MakeNewGrids (int lbase, Real time, int &new_finest, Vector< BoxArray > &new_grids) |
Make new grids based on error estimates. This function expects that valid BoxArrays exist in this->grids from level lbase to level this->finest_level (the current finest level). new_grids. On return, the new finest level is stored in new_finest, and the new grids are stored in new_grids from Array element lbase+1 to new_finest_level (unless fixed grids are used). Note that this function adds at most one more level to the existing levels, and it may remove all levels above the base level. This function does not change the value of this->finest_level, nor does it modifies any BoxArrays stored in this->grids. It also does not modify new_grids's elements outside the range [lbase+1,new_finest_level]. More... | |
void | MakeNewGrids (Real time=0.0) |
This function makes new grid for all levels (including level 0). More... | |
virtual void | MakeNewLevelFromScratch (int, Real, const BoxArray &, const DistributionMapping &) |
virtual void | ErrorEst (int, TagBoxArray &, Real, int) |
Tag cells for refinement. TagBoxArray tags is built on level lev grids. More... | |
virtual void | ManualTagsPlacement (int, TagBoxArray &, const Vector< IntVect > &) |
Manually tag. Note that tags is built on level lev grids coarsened by bf_lev[lev]. More... | |
virtual void | PostProcessBaseGrids (BoxArray &) const |
virtual BoxArray | GetAreaNotToTag (int) |
Long | CountCells (int lev) const noexcept |
virtual DistributionMapping | MakeDistributionMap (int lev, BoxArray const &ba) |
Protected Member Functions | |
void | checkInput () |
void | SetIterateToFalse () noexcept |
void | SetUseNewChop () noexcept |
Protected Attributes | |
int | finest_level |
Current finest level. More... | |
Vector< Geometry > | geom |
Vector< DistributionMapping > | dmap |
Vector< BoxArray > | grids |
unsigned int | num_setdm = 0 |
unsigned int | num_setba = 0 |
Protected Attributes inherited from amrex::AmrInfo | |
int | verbose = 0 |
int | max_level = 0 |
Maximum allowed level. More... | |
Vector< IntVect > | ref_ratio {{IntVect(2)}} |
Refinement ratios. More... | |
Vector< IntVect > | blocking_factor {{IntVect(8)}} |
Blocking factor in grid generation (by level). More... | |
Vector< IntVect > | max_grid_size {{IntVect(AMREX_D_PICK(128,128,64))}} |
Maximum allowable grid size (by level). More... | |
Vector< IntVect > | n_error_buf {{IntVect(1)}} |
Buffer cells around each tagged cell. More... | |
Real | grid_eff = static_cast<Real>(0.7) |
Grid efficiency. More... | |
int | n_proper = 1 |
Cells required for proper nesting. More... | |
int | use_fixed_upto_level = 0 |
bool | use_fixed_coarse_grids = false |
bool | refine_grid_layout = true |
IntVect | refine_grid_layout_dims = IntVect(1) |
bool | check_input = true |
bool | use_new_chop = false |
bool | iterate_on_new_grids = true |
Private Member Functions | |
void | InitAmrMesh (int max_level_in, const Vector< int > &n_cell_in, Vector< IntVect > refrat=Vector< IntVect >(), const RealBox *rb=nullptr, int coord=-1, const int *is_per=nullptr) |
Static Private Member Functions | |
static void | ProjPeriodic (BoxList &blout, const Box &domain, Array< int, AMREX_SPACEDIM > const &is_per) |
Friends | |
std::ostream & | operator<< (std::ostream &os, AmrMesh const &amr_mesh) |
amrex::AmrMesh::AmrMesh | ( | ) |
amrex::AmrMesh::AmrMesh | ( | const RealBox * | rb, |
int | max_level_in, | ||
const Vector< int > & | n_cell_in, | ||
int | coord = -1 , |
||
Vector< IntVect > | refrat = Vector<IntVect>() , |
||
const int * | is_per = nullptr |
||
) |
amrex::AmrMesh::AmrMesh | ( | const RealBox & | rb, |
int | max_level_in, | ||
const Vector< int > & | n_cell_in, | ||
int | coord, | ||
Vector< IntVect > const & | a_refrat, | ||
Array< int, AMREX_SPACEDIM > const & | is_per | ||
) |
|
delete |
|
default |
|
virtualdefault |
Return the blocking factor at level lev.
|
inlinenoexcept |
|
protected |
"Try" to chop up grids so that the number of boxes in the BoxArray is greater than the target_size.
|
noexcept |
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinevirtual |
Tag cells for refinement. TagBoxArray tags is built on level lev grids.
Reimplemented in amrex::AmrCore, and amrex::Amr.
|
inlinenoexcept |
Return the finest level.
Reimplemented in amrex::Amr.
Given domain box, return AMR level. Return -1 if there is no match.
|
inlinenoexcept |
Return the minimum allowable grid efficiency.
|
private |
|
noexcept |
BoxArray amrex::AmrMesh::MakeBaseGrids | ( | ) | const |
Make a level 0 grids covering the whole domain. It does NOT install the new grids.
|
virtual |
void amrex::AmrMesh::MakeNewGrids | ( | int | lbase, |
Real | time, | ||
int & | new_finest, | ||
Vector< BoxArray > & | new_grids | ||
) |
Make new grids based on error estimates. This function expects that valid BoxArrays exist in this->grids from level lbase to level this->finest_level (the current finest level). new_grids. On return, the new finest level is stored in new_finest, and the new grids are stored in new_grids from Array element lbase+1 to new_finest_level (unless fixed grids are used). Note that this function adds at most one more level to the existing levels, and it may remove all levels above the base level. This function does not change the value of this->finest_level, nor does it modifies any BoxArrays stored in this->grids. It also does not modify new_grids's elements outside the range [lbase+1,new_finest_level].
void amrex::AmrMesh::MakeNewGrids | ( | Real | time = 0.0 | ) |
This function makes new grid for all levels (including level 0).
|
inlinevirtual |
This function is called by the second version of MakeNewGrids. Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization.
Reimplemented in amrex::Amr, and amrex::AmrCore.
|
inlinevirtual |
Manually tag. Note that tags is built on level lev grids coarsened by bf_lev[lev].
Reimplemented in amrex::Amr.
Return the largest allowable grid.
|
inlinenoexcept |
Return the max level.
Return the maximum refinement ratio in any direction.
Return the number of buffer cells (as a single integer) in error estimator.
Return the number of buffer cells (as an IntVect) in error estimator.
|
inlinenoexcept |
Return the number of cells to define proper nesting.
|
inlinevirtual |
Apply some user-defined changes the to base grids.
This function is only called by MakeNewGrids after computing a box array for the coarsest level and before calling MakeNewLevelFromScratch.
For example, use this function if you want to remove covered grids on the coarsest refinement level.
|
staticprivate |
Return refinement ratios between all levels.
Return the refinement ratio for level lev.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
inlinenoexcept |
Set ref_ratio would require rebuilding Geometry objects.
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
inlinenoexcept |
Should we keep the coarser grids fixed (and not regrid those levels) at all?
|
inlinenoexcept |
Up to what level should we keep the coarser grids fixed (and not regrid those levels)?
|
inlinenoexcept |
|
friend |
|
protected |
|
protected |
Current finest level.
|
protected |
|
protected |