chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Realm Class Reference

Class for holding multifluid Realms, which are the Realms that we actually use. More...

#include <CD_Realm.H>

Public Member Functions

 Realm ()
 Default constructor. Must subsequently call define.
 
 Realm (const Realm &a_other)=delete
 Disallowed copy ctor.
 
 Realm (const Realm &&a_other)=delete
 Disallowed move ctor.
 
Realmoperator= (const Realm &a_other)=delete
 Disallowed copy assignment operator.
 
Realmoperator= (const Realm &&a_other)=delete
 Disallowed move assignment operator.
 
 ~Realm ()
 Destructor.
 
void define (const Vector< DisjointBoxLayout > &a_grids, const Vector< ProblemDomain > &a_domains, const Vector< int > &a_refRat, const Vector< Real > &a_dx, const RealVect &a_probLo, const int a_finestLevel, const int a_minBlockSize, const int a_ebGhost, const int a_numGhost, const int a_lsfGhost, const int a_redistRad, const int a_mgInterpOrder, const int a_mgInterpRadius, const int a_mgInterpWeight, const CellCentroidInterpolation::Type a_centroidInterpType, const EBCentroidInterpolation::Type a_ebInterpType, const std::map< phase::which_phase, RefCountedPtr< BaseIF > > &a_baseif, const RefCountedPtr< MultiFluidIndexSpace > &a_mfis)
 Full define function.
 
void setGrids (const Vector< DisjointBoxLayout > &a_grids, const int a_finestLevel)
 Set grid method.
 
void preRegrid ()
 Perform pre-regrid operations.
 
void regridBase (const int a_lmin)
 Regrid method for EBAMR base.
 
void regridOperators (const int a_lmin)
 Regrid method for EBAMR operators.
 
void registerOperator (const std::string &a_operator, const phase::which_phase a_phase)
 Register an AMR operator.
 
bool queryOperator (const std::string &a_operator, const phase::which_phase a_phase) const
 Query if an AMR operator has been registered.
 
void registerMask (const std::string &a_mask, const int a_buffer)
 Register a mask.
 
bool queryMask (const std::string &a_mask, const int a_buffer) const
 Query if a mask has been registered.
 
const Vector< int > & getRefinementRatios () const
 Get refinement ratios.
 
const Vector< Real > & getDx () const
 Get grid resolutions.
 
const Vector< DisjointBoxLayout > & getGrids () const
 Get AMR grids.
 
const Vector< ProblemDomain > & getDomains () const
 Get problem domains.
 
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid ()
 Get MFLevelGrids.
 
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridCoFi ()
 Get the coarsened grids.
 
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridFiCo ()
 Get the refined grids.
 
const RefCountedPtr< EBIndexSpace > & getEBIndexSpace (const phase::which_phase a_phase) const
 Get EBIndexSpace for particular phase.
 
const Vector< EBISLayout > & getEBISLayout (const phase::which_phase a_phase) const
 Get EBISLayout for particular phase.
 
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGrid (const phase::which_phase a_phase) const
 Get EBLevelGrid for particular phase.
 
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGridCoFi (const phase::which_phase a_phase) const
 Get coarsened fine EBLevelGrid for particular phase.
 
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getVofIterator (const phase::which_phase a_phase) const
 Get VoFIterators covering all cut-cells (singly- and multiply-cut) for a particular phase.
 
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getMultiCutVofIterator (const phase::which_phase a_phase) const
 Get VoFIterators restricted to multiply-cut cells for a particular phase.
 
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIterator (const phase::which_phase a_phase) const
 Get face iterators with FaceStop::SurroundingWithBoundary over cut-cell faces in each valid grid box for a particular phase.
 
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIteratorNoBoundary (const phase::which_phase a_phase) const
 Get face iterators with FaceStop::SurroundingNoBoundary over cut-cell faces in each valid grid box for a particular phase.
 
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getFaceIteratorWithTangentialGhosts (const phase::which_phase a_phase) const
 Get per-direction face iterators covering cut-cell faces that reach into the tangential ghost layer.
 
Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & getMultiCutFaceIterator (const phase::which_phase a_phase) const
 Get face iterators restricted to multiply-cut faces in each valid grid box.
 
const Vector< RefCountedPtr< EBNonConservativeDivergence > > & getNonConservativeDivergence (const phase::which_phase a_phase) const
 Get objects for computing "non-conservative divergences".
 
const Vector< RefCountedPtr< CellCentroidInterpolation > > & getCellCentroidInterpolation (const phase::which_phase a_phase) const
 Get objects for computing interpolation of cell-centered data to cell centroids.
 
const Vector< RefCountedPtr< EBCentroidInterpolation > > & getEBCentroidInterpolation (const phase::which_phase a_phase) const
 Get objects for computing interpolation of cell-centered data to EB centroids.
 
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage (const phase::which_phase a_phase)
 Get data coarsening utility.
 
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator (const phase::which_phase a_phase)
 Get the multigrid interpolator.
 
EBAMRParticleMeshgetParticleMesh (const phase::which_phase a_phase)
 Get the particle mesh operator.
 
EBAMRSurfaceDepositiongetSurfaceDeposition (const phase::which_phase a_phase)
 Get the particle mesh operator.
 
const Vector< RefCountedPtr< EBGradient > > & getGradientOp (const phase::which_phase a_phase) const
 Get gradient operator.
 
Vector< RefCountedPtr< EBGhostCellInterpolator > > & getGhostCellInterpolator (const phase::which_phase a_phase)
 Get ghost cell interpolator.
 
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp (const phase::which_phase a_phase)
 Get piecewise linear ghost cell interpolation utility.
 
Vector< RefCountedPtr< EBReflux > > & getFluxRegister (const phase::which_phase a_phase)
 Get flux register utility.
 
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp (const phase::which_phase a_phase)
 Get the redistribution operators.
 
const EBAMRFAB & getLevelset (const phase::which_phase a_phase) const
 Get level-set function.
 
const EBAMRCellData & getRegularCells (const phase::which_phase a_phase) const
 Get the regular-cell mask (value 1 in regular cells, 0 elsewhere) for a phase.
 
const EBAMRCellData & getCoveredCells (const phase::which_phase a_phase) const
 Get the covered-cell mask (value 1 in covered cells, 0 elsewhere) for a phase.
 
const EBAMRCellData & getNotCoveredCells (const phase::which_phase a_phase) const
 Get the non-covered-cell mask (1 in regular/irregular cells, 0 in covered cells) for a phase.
 
const EBAMRCellData & getIrregularCells (const phase::which_phase a_phase) const
 Get the irregular-cell mask (value 1 in irregular cells, 0 elsewhere) for a phase.
 
const AMRMaskgetMask (const std::string &a_mask, const int a_buffer) const
 Get AMR mask.
 
const AMRMaskgetValidCells () const
 Get all valid cells.
 
void registerParticleGhostMask (const int a_width) noexcept
 Register a particle ghost-mask width so it is (re)built at every regrid.
 
const AMRParticleGhostMaskgetParticleGhostMask (const int a_width) const noexcept
 Get the same-level particle ghost mask for a registered width.
 
const AMRParticleGhostMaskgetParticleGhostMaskFineToCoar (const int a_width) const noexcept
 Get the fine-to-coarse particle ghost mask for a registered width.
 
const AMRParticleGhostMaskgetParticleGhostMaskCoarToFine (const int a_width) const noexcept
 Get the coarse-to-fine particle ghost mask for a registered width.
 
const AMRParticleGhostMaskgetTrivialParticleGhostMask () const noexcept
 Get a trivial (empty) particle ghost mask that scatters no particles.
 
const AMRMaskgetParticleGhostExposure (const int a_width) const noexcept
 Get the boundary-exposure mask for a registered particle ghost width.
 
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles () const noexcept
 Get the tiled space.
 
LevelTiles::LevelAndBox getLevelAndBox (const RealVect &a_pos) const noexcept
 Find the (finest) grid box covering a physical position.
 

Static Public Attributes

static const std::string Primal = "primal"
 Identifier for perimal realm.
 
static const std::string primal = "primal"
 Identifier for perimal realm.
 

Protected Member Functions

void defineMFLevelGrid (const int a_lmin)
 Define MFLevelGrid.
 
void defineMasks (const int a_lmin)
 Define masks.
 
void defineOuterHaloMask (const int a_lmin)
 Define outer particle halo mask.
 
void defineOuterHaloMask (LevelData< BaseFab< bool > > &a_coarMask, const ProblemDomain &a_domainCoar, const ProblemDomain &a_domainFine, const DisjointBoxLayout &a_gridsCoar, const DisjointBoxLayout &a_gridsFine, const int a_buffer, const int a_refRat)
 Define the outer particle halo masks. This is the level-version.
 
void defineInnerHaloMask (const int a_lmin)
 Define inner particle halo mask.
 
void defineOuterCFMask (const int a_lmin)
 Define a mask which is true on the outside (i.e., coarse side) of the refinement boundary.
 
void defineOuterCFMask (LevelData< BaseFab< bool > > &a_coarMask, const ProblemDomain &a_domainCoar, const ProblemDomain &a_domainFine, const DisjointBoxLayout &a_gridsCoar, const DisjointBoxLayout &a_gridsFine, const int a_buffer, const int a_refRat)
 Define the outer cf region mask. This is the level-version.
 
void defineInnerCFMask (const int a_lmin)
 Define a mask which is true on the inside (i.e., fine side) of the refinement boundary.
 
void defineCFIVS (const int a_lmin)
 Define the coarse-fine interface.
 
void defineValidCells ()
 Define the valid cell region mask.
 
void defineLevelTiles () noexcept
 Define the tiled space.
 
void defineParticleGhostMasks () noexcept
 Define the same-level, fine-to-coarse, and coarse-to-fine particle ghost masks on every level.
 
void defineParticleGhostMaskSameLevel (LayoutData< ParticleGhostMask > &a_mask, const DisjointBoxLayout &a_dbl, const ProblemDomain &a_domain, const int a_ghost) noexcept
 Define the SAME-level particle ghost mask on one level.
 
void defineParticleGhostMaskFineToCoar (LayoutData< ParticleGhostMask > &a_mask, const DisjointBoxLayout &a_thisLayout, const DisjointBoxLayout &a_coarLayout, const ProblemDomain &a_coarDomain, const int a_refRat, const int a_ghost) noexcept
 Define the FINE-to-COARSE particle ghost mask on one level (targets on the next-coarser level).
 
void defineParticleGhostMaskCoarToFine (LayoutData< ParticleGhostMask > &a_mask, const DisjointBoxLayout &a_thisLayout, const DisjointBoxLayout &a_fineLayout, const LevelData< BaseFab< bool > > &a_validCells, const ProblemDomain &a_fineDomain, const int a_refRat, const int a_ghost) noexcept
 Define the COARSE-to-FINE particle ghost mask on one level (targets on the next-finer level).
 
void defineParticleGhostExposure (LevelData< BaseFab< bool > > &a_exposure, const DisjointBoxLayout &a_dbl, const LayoutData< ParticleGhostMask > &a_same, const LayoutData< ParticleGhostMask > &a_fineToCoar, const LayoutData< ParticleGhostMask > &a_coarToFine, const bool a_hasCoar, const bool a_hasFine) noexcept
 Define the boundary-exposure mask on one level from that level's three particle ghost masks.
 
void definePetscGrid () noexcept
 Define the PETSc composite grid.
 
PhaseRealmgetRealm (const phase::which_phase a_phase)
 Get a particular realm.
 

Protected Attributes

bool m_isDefined
 Realm defined or not.
 
int m_verbosity
 Realm verbosity. Used for debugging.
 
int m_finestLevel
 Finest AMR level.
 
int m_minBlockSize
 Blocking factor.
 
int m_numGhost
 Number of ghost cells.
 
RealVect m_probLo
 Physical coordinates of lower-left corner in simulation domain.
 
Vector< Real > m_dx
 Grid resolutions.
 
Vector< int > m_refinementRatios
 Refinement ratios.
 
Vector< DisjointBoxLayout > m_grids
 AMR grids.
 
Vector< ProblemDomain > m_domains
 Domains.
 
Vector< RefCountedPtr< MFLevelGrid > > m_mflg
 MFLevelGrids.
 
Vector< RefCountedPtr< MFLevelGrid > > m_mflgCoFi
 Coarsened grids. Entry lvl contains the coarsened version of grids on level lvl+1.
 
Vector< RefCountedPtr< MFLevelGrid > > m_mflgFiCo
 Refined grids. Entry lvl+1 contains the refined version of grids on level lvl.
 
Vector< RefCountedPtr< LevelTiles > > m_levelTiles
 Level "tiles" – i.e. the grids viewed as constant-size boxes.
 
RefCountedPtr< MultiFluidIndexSpacem_multifluidIndexSpace
 Index spaces.
 
AMRMask m_validCells
 Mask which is true for all valid cells.
 
std::set< int > m_particleGhostMaskWidths
 Registered particle ghost-mask widths (>0). Persist across regrids; the masks below are (re)built for exactly these widths in defineParticleGhostMasks().
 
std::map< int, AMRParticleGhostMaskm_particleGhostMask
 Same-level particle ghost masks, keyed by ghost width. Per width: indexed by source level, and per source box maps a source cell to the same-level boxes whose ghosted region covers it.
 
std::map< int, AMRParticleGhostMaskm_particleGhostMaskFineToCoar
 Fine-to-coarse particle ghost masks, keyed by ghost width. Per width: indexed by source level (>=1); per source (fine) box maps a source cell to the coarser-level boxes whose ghosted region covers it.
 
std::map< int, AMRParticleGhostMaskm_particleGhostMaskCoarToFine
 Coarse-to-fine particle ghost masks, keyed by ghost width. Per width: indexed by source level (<finest); per source (coarse) box maps a source cell to the finer-level boxes whose ghosted region covers it.
 
std::map< int, AMRMaskm_particleGhostExposure
 Particle boundary-exposure masks, keyed by ghost width. Per width: indexed by level, true in every cell that has at least one outgoing ghost-shipment target in ANY direction – i.e. the OR over the same-level, fine-to-coarse and coarse-to-fine masks of numTargets(cell) > 0.
 
std::map< phase::which_phase, RefCountedPtr< PhaseRealm > > m_realms
 Phase realms.
 
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
 Implicit/signed distance functions on each phase.
 
std::map< std::pair< std::string, int >, AMRMaskm_masks
 Masks.
 

Detailed Description

Class for holding multifluid Realms, which are the Realms that we actually use.

Constructor & Destructor Documentation

◆ Realm() [1/2]

Realm::Realm ( const Realm a_other)
delete

Disallowed copy ctor.

Parameters
[in]a_otherOther realm

◆ Realm() [2/2]

Realm::Realm ( const Realm &&  a_other)
delete

Disallowed move ctor.

Parameters
[in]a_otherOther realm

Member Function Documentation

◆ define()

void Realm::define ( const Vector< DisjointBoxLayout > &  a_grids,
const Vector< ProblemDomain > &  a_domains,
const Vector< int > &  a_refRat,
const Vector< Real > &  a_dx,
const RealVect &  a_probLo,
const int  a_finestLevel,
const int  a_minBlockSize,
const int  a_ebGhost,
const int  a_numGhost,
const int  a_lsfGhost,
const int  a_redistRad,
const int  a_mgInterpOrder,
const int  a_mgInterpRadius,
const int  a_mgInterpWeight,
const CellCentroidInterpolation::Type  a_centroidInterpType,
const EBCentroidInterpolation::Type  a_ebInterpType,
const std::map< phase::which_phase, RefCountedPtr< BaseIF > > &  a_baseif,
const RefCountedPtr< MultiFluidIndexSpace > &  a_mfis 
)

Full define function.

Parameters
[in]a_gridsGrids on each level, i.e. boxes and processor distributions
[in]a_domainsProblem domains
[in]a_refRatRefinement ratios
[in]a_dxGrid resolutions
[in]a_probLoLower-left corner of physical domain
[in]a_finestLevelFinest grid level
[in]a_minBlockSizeGrid blocking factor
[in]a_ebGhostNumber of ghost cells used for geometric information when making operators
[in]a_numGhostNumber of ghost cells in data holders
[in]a_lsfGhostNumber of ghost cells used when computing the level set on the mesh
[in]a_redistRadRedistribution radius
[in]a_mgInterpOrderMultigrid ghost cell interpolation order
[in]a_mgInterpRadiusMultigrid ghost cell interpolation radius
[in]a_mgInterpWeightMultigrid ghost cell interpolation weight (for least squares)
[in]a_centroidInterpTypeStencil type for interpolation from cell centers to cell centroids
[in]a_ebInterpTypeStencil type for interpolation from cell centers to eb centroids
[in]a_baseifImplicit/signed distance function
[in]a_mfisEBIndexSpace discrete information

◆ defineCFIVS()

void Realm::defineCFIVS ( const int  a_lmin)
protected

Define the coarse-fine interface.

This is a mask which is true on the immediate outside of a refinement boundary.

Parameters
[in]a_lminDescription

◆ defineInnerCFMask()

void Realm::defineInnerCFMask ( const int  a_lmin)
protected

Define a mask which is true on the inside (i.e., fine side) of the refinement boundary.

Parameters
[in]a_lminDescription

◆ defineInnerHaloMask()

void Realm::defineInnerHaloMask ( const int  a_lmin)
protected

Define inner particle halo mask.

This is a mask which is true on the INSIDE of a refinement boundary. The buffer size is always the number of COARSE grid cells. I.e., if one uses a refinement factor of 2, the first two strips of fine-grid cells are set to true and the others to false.

Parameters
[in]a_lminCoarsest level that changed during regrid

◆ defineMasks()

void Realm::defineMasks ( const int  a_lmin)
protected

Define masks.

Parameters
[in]a_lminCoarsest level that changed during regrid

◆ defineMFLevelGrid()

void Realm::defineMFLevelGrid ( const int  a_lmin)
protected

Define MFLevelGrid.

Parameters
[in]a_lminCoarsest level that changed during regrid

◆ defineOuterCFMask() [1/2]

void Realm::defineOuterCFMask ( const int  a_lmin)
protected

Define a mask which is true on the outside (i.e., coarse side) of the refinement boundary.

Parameters
[in]a_lminDescription

◆ defineOuterCFMask() [2/2]

void Realm::defineOuterCFMask ( LevelData< BaseFab< bool > > &  a_coarMask,
const ProblemDomain &  a_domainCoar,
const ProblemDomain &  a_domainFine,
const DisjointBoxLayout &  a_gridsCoar,
const DisjointBoxLayout &  a_gridsFine,
const int  a_buffer,
const int  a_refRat 
)
protected

Define the outer cf region mask. This is the level-version.

Parameters
[out]a_coarMaskMask
[in]a_domainCoarCoarse domain
[in]a_domainFineFine domain
[in]a_gridsCoarCoarse grids
[in]a_gridsFineFine grids
[in]a_bufferBuffer
[in]a_refRatRefinement ratio between the two levels

◆ defineOuterHaloMask() [1/2]

void Realm::defineOuterHaloMask ( const int  a_lmin)
protected

Define outer particle halo mask.

This is a mask which is true on the OUTSIDE of a refinement boundary.

Parameters
[in]a_lminCoarsest level that changed during regrid

◆ defineOuterHaloMask() [2/2]

void Realm::defineOuterHaloMask ( LevelData< BaseFab< bool > > &  a_coarMask,
const ProblemDomain &  a_domainCoar,
const ProblemDomain &  a_domainFine,
const DisjointBoxLayout &  a_gridsCoar,
const DisjointBoxLayout &  a_gridsFine,
const int  a_buffer,
const int  a_refRat 
)
protected

Define the outer particle halo masks. This is the level-version.

Parameters
[out]a_coarMaskMask
[in]a_domainCoarCoarse domain
[in]a_domainFineFine domain
[in]a_gridsCoarCoarse grids
[in]a_gridsFineFine grids
[in]a_bufferBuffer (i.e. width of "halo")
[in]a_refRatRefinement ratio between the two levels

◆ defineParticleGhostExposure()

void Realm::defineParticleGhostExposure ( LevelData< BaseFab< bool > > &  a_exposure,
const DisjointBoxLayout &  a_dbl,
const LayoutData< ParticleGhostMask > &  a_same,
const LayoutData< ParticleGhostMask > &  a_fineToCoar,
const LayoutData< ParticleGhostMask > &  a_coarToFine,
const bool  a_hasCoar,
const bool  a_hasFine 
)
protectednoexcept

Define the boundary-exposure mask on one level from that level's three particle ghost masks.

Sets a cell true iff it has at least one outgoing ghost-shipment target in any direction; see m_particleGhostExposure' own docs for what the mask is for. a_hasCoar/a_hasFine say whether the fine-to-coarse/coarse-to-fine masks are actually defined on this level – they are allocated but left undefined on level 0 and on the finest level respectively, and must not be queried there.

Parameters
[out]a_exposurePer-box boolean mask over a_dbl to fill (no ghost cells).
[in]a_dblThis level's grids.
[in]a_sameThis level's same-level ghost mask.
[in]a_fineToCoarThis level's fine-to-coarse ghost mask. Only read if a_hasCoar.
[in]a_coarToFineThis level's coarse-to-fine ghost mask. Only read if a_hasFine.
[in]a_hasCoarWhether a coarser level exists (i.e. a_fineToCoar is defined).
[in]a_hasFineWhether a finer level exists (i.e. a_coarToFine is defined).

◆ defineParticleGhostMaskCoarToFine()

void Realm::defineParticleGhostMaskCoarToFine ( LayoutData< ParticleGhostMask > &  a_mask,
const DisjointBoxLayout &  a_thisLayout,
const DisjointBoxLayout &  a_fineLayout,
const LevelData< BaseFab< bool > > &  a_validCells,
const ProblemDomain &  a_fineDomain,
const int  a_refRat,
const int  a_ghost 
)
protectednoexcept

Define the COARSE-to-FINE particle ghost mask on one level (targets on the next-finer level).

Per source (coarse) cell the mask holds every fine box whose ghosted region (grown by a_ghost FINE cells) contains any of the cell's fine children – found by walking a ghostDefine Copier motion plan (only overlapping box pairs are visited), and multi-valued since a cell may scatter to several fine boxes. The fine reach is coarsened to whole coarse source cells, and only VALID coarse cells (those not covered by the finer level) are kept – that is the coarse-side outer halo. The ghost width is measured in fine (destination) cells and is a MINIMUM: whole coarse source cells overlapping the halo are recorded (over-communication across the interface is accepted). Periodic boundaries are not handled.

Parameters
[out]a_maskPer-box CSR ghost mask over a_thisLayout (the coarse level) to fill.
[in]a_thisLayoutThis (coarse, source) level's grids.
[in]a_fineLayoutThe next-finer (target) level's grids.
[in]a_validCellsThis (coarse) level's valid-cell mask; source cells are kept only where valid.
[in]a_fineDomainProblem domain at the fine (target) resolution.
[in]a_refRatRefinement ratio between this level and the fine level.
[in]a_ghostGhost width in fine (destination) cells.

◆ defineParticleGhostMaskFineToCoar()

void Realm::defineParticleGhostMaskFineToCoar ( LayoutData< ParticleGhostMask > &  a_mask,
const DisjointBoxLayout &  a_thisLayout,
const DisjointBoxLayout &  a_coarLayout,
const ProblemDomain &  a_coarDomain,
const int  a_refRat,
const int  a_ghost 
)
protectednoexcept

Define the FINE-to-COARSE particle ghost mask on one level (targets on the next-coarser level).

Per source (fine) cell the mask holds every coarse box whose ghosted region (grown by a_ghost COARSE cells) contains the cell's coarse footprint – found by walking a ghostDefine Copier motion plan (only overlapping box pairs are visited), and multi-valued since a cell may scatter to several coarse boxes (e.g. diagonal coarse-fine cells). Sources are restricted to the INNER coarse-fine halo so the nested interior is not scattered: the halo is built geometrically from the coarsened-fine footprint (the ring outside each footprint box, minus the abutting footprint boxes = internal seams, grown back inward), independent of the coarse grid's box decomposition. The ghost width is measured in coarse (destination) cells and is a MINIMUM: each halo coarse cell refines to all its fine source children (over-communication across the interface is accepted). Periodic boundaries are not handled.

Parameters
[out]a_maskPer-box CSR ghost mask over a_thisLayout (the fine level) to fill.
[in]a_thisLayoutThis (fine, source) level's grids.
[in]a_coarLayoutThe next-coarser (target) level's grids.
[in]a_coarDomainProblem domain at the coarse (target) resolution.
[in]a_refRatRefinement ratio between the coarse level and this level.
[in]a_ghostGhost width in coarse (destination) cells.

◆ defineParticleGhostMasks()

void Realm::defineParticleGhostMasks ( )
protectednoexcept

Define the same-level, fine-to-coarse, and coarse-to-fine particle ghost masks on every level.

Allocates and fills the three per-level masks (m_particleGhostMask, m_particleGhostMaskFineToCoar, m_particleGhostMaskCoarToFine) by delegating to defineParticleGhostMaskSameLevel and defineParticleGhostMaskCrossLevel. Each mask records, per source cell, the target boxes (grid index + receiving rank) that a particle in that cell must be scattered to in that direction. Called from regridBase after the valid-cell and level-tile structures exist. The ghost width is m_numGhost. Periodic boundaries are not handled.

◆ defineParticleGhostMaskSameLevel()

void Realm::defineParticleGhostMaskSameLevel ( LayoutData< ParticleGhostMask > &  a_mask,
const DisjointBoxLayout &  a_dbl,
const ProblemDomain &  a_domain,
const int  a_ghost 
)
protectednoexcept

Define the SAME-level particle ghost mask on one level.

For each box, records (per cell) the abutting same-level boxes whose grown region (the box grown by a_ghost cells) covers the cell, together with the owning/receiving rank. Uses a NeighborIterator to enumerate the abutting boxes, so the build is fully box-local – no coarsen/refine and no Copier – and each box fills its own CSR in two passes (count, then packed fill). NeighborIterator returns grow-by-one (abutting) neighbours only; this loses nothing because every box is min_block_size-aligned and AmrMesh::sanityCheck enforces a_ghost < min_block_size, so two non-abutting same-level boxes are always at least min_block_size (> a_ghost) apart and can never reach into each other's ghost region. Periodic boundaries are not handled.

Parameters
[out]a_maskPer-box CSR ghost mask over a_dbl to fill.
[in]a_dblThis level's grids (both the source cells and the neighbour targets).
[in]a_domainProblem domain at this level's resolution.
[in]a_ghostGhost width (cells) defining each neighbour's grown region.

◆ getCellCentroidInterpolation()

const Vector< RefCountedPtr< CellCentroidInterpolation > > & Realm::getCellCentroidInterpolation ( const phase::which_phase  a_phase) const

Get objects for computing interpolation of cell-centered data to cell centroids.

Parameters
[in]a_phasePhase
Returns
Cell centroid interpolation

◆ getCoarseAverage()

Vector< RefCountedPtr< EBCoarAve > > & Realm::getCoarseAverage ( const phase::which_phase  a_phase)

Get data coarsening utility.

Parameters
[in]a_phasePhase
Returns
Coarse average

◆ getCoveredCells()

const EBAMRCellData & Realm::getCoveredCells ( const phase::which_phase  a_phase) const

Get the covered-cell mask (value 1 in covered cells, 0 elsewhere) for a phase.

Parameters
[in]a_phasePhase
Returns
Covered-cell mask

◆ getDomains()

const Vector< ProblemDomain > & Realm::getDomains ( ) const

Get problem domains.

Returns
Domains

◆ getDx()

const Vector< Real > & Realm::getDx ( ) const

Get grid resolutions.

Returns
m_dx

◆ getEBCentroidInterpolation()

const Vector< RefCountedPtr< EBCentroidInterpolation > > & Realm::getEBCentroidInterpolation ( const phase::which_phase  a_phase) const

Get objects for computing interpolation of cell-centered data to EB centroids.

Parameters
[in]a_phasePhase
Returns
E b centroid interpolation

◆ getEBIndexSpace()

const RefCountedPtr< EBIndexSpace > & Realm::getEBIndexSpace ( const phase::which_phase  a_phase) const

Get EBIndexSpace for particular phase.

Parameters
[in]a_phasePhase
Returns
E b index space

◆ getEBISLayout()

const Vector< EBISLayout > & Realm::getEBISLayout ( const phase::which_phase  a_phase) const

Get EBISLayout for particular phase.

Parameters
[in]a_phasePhase
Returns
E b i s layout

◆ getEBLevelGrid()

const Vector< RefCountedPtr< EBLevelGrid > > & Realm::getEBLevelGrid ( const phase::which_phase  a_phase) const

Get EBLevelGrid for particular phase.

Parameters
[in]a_phasePhase
Returns
E b level grid

◆ getEBLevelGridCoFi()

const Vector< RefCountedPtr< EBLevelGrid > > & Realm::getEBLevelGridCoFi ( const phase::which_phase  a_phase) const

Get coarsened fine EBLevelGrid for particular phase.

Parameters
[in]a_phasePhase
Returns
E b level grid co fi

◆ getFaceIterator()

Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & Realm::getFaceIterator ( const phase::which_phase  a_phase) const

Get face iterators with FaceStop::SurroundingWithBoundary over cut-cell faces in each valid grid box for a particular phase.

Includes domain-boundary faces. For cell-to-face averaging that excludes domain boundary faces, use getFaceIteratorNoBoundary. For faces that extend into the tangential ghost layer, use getFaceIteratorWithTangentialGhosts.

Parameters
[in]a_phasePhase (gas or solid)
Returns
Per-level LayoutData of FaceIterator arrays (one per coordinate direction)

◆ getFaceIteratorNoBoundary()

Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & Realm::getFaceIteratorNoBoundary ( const phase::which_phase  a_phase) const

Get face iterators with FaceStop::SurroundingNoBoundary over cut-cell faces in each valid grid box for a particular phase.

Domain boundary faces are excluded. Intended for cell-to-face averaging where boundary faces are fixed up separately. For iterators that include domain boundary faces, use getFaceIterator.

Parameters
[in]a_phasePhase (gas or solid)
Returns
Per-level LayoutData of FaceIterator arrays (one per coordinate direction)

◆ getFaceIteratorWithTangentialGhosts()

Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & Realm::getFaceIteratorWithTangentialGhosts ( const phase::which_phase  a_phase) const

Get per-direction face iterators covering cut-cell faces that reach into the tangential ghost layer.

For the iterator in direction dir, the underlying IVS covers irregular cells in a box grown by 1 in the two directions tangential to dir; the dir extent stays at the valid box. Domain boundary faces are excluded (FaceStop::SurroundingNoBoundary). Callers require at least 1 ghost layer in cell data.

Parameters
[in]a_phasePhase
Returns
Tangential-ghost face iterator

◆ getFineInterp()

Vector< RefCountedPtr< EBCoarseToFineInterp > > & Realm::getFineInterp ( const phase::which_phase  a_phase)

Get piecewise linear ghost cell interpolation utility.

Parameters
[in]a_phasePhase
Returns
Fine interp

◆ getFluxRegister()

Vector< RefCountedPtr< EBReflux > > & Realm::getFluxRegister ( const phase::which_phase  a_phase)

Get flux register utility.

Parameters
[in]a_phasePhase
Returns
Flux register

◆ getGhostCellInterpolator()

Vector< RefCountedPtr< EBGhostCellInterpolator > > & Realm::getGhostCellInterpolator ( const phase::which_phase  a_phase)

Get ghost cell interpolator.

Parameters
[in]a_phasePhase
Returns
Ghost cell interpolator

◆ getGradientOp()

const Vector< RefCountedPtr< EBGradient > > & Realm::getGradientOp ( const phase::which_phase  a_phase) const

Get gradient operator.

Parameters
[in]a_phasePhase
Returns
Gradient op

◆ getGrids()

const Vector< DisjointBoxLayout > & Realm::getGrids ( ) const

Get AMR grids.

Returns
m_grids

◆ getIrregularCells()

const EBAMRCellData & Realm::getIrregularCells ( const phase::which_phase  a_phase) const

Get the irregular-cell mask (value 1 in irregular cells, 0 elsewhere) for a phase.

Parameters
[in]a_phasePhase
Returns
Irregular-cell mask

◆ getLevelAndBox()

LevelTiles::LevelAndBox Realm::getLevelAndBox ( const RealVect &  a_pos) const
noexcept

Find the (finest) grid box covering a physical position.

O(1) point->block query delegating to the shared LevelTiles::findDestination core over this Realm's LevelTiles: the position is mapped to a min_block_size tile by integer division, then looked up in the per-level tile->box hash, finest level first. Works for variable-sized/anisotropic boxes because every box is registered under all the min tiles it covers. This is the same mapping ParticleContainer uses to bin particles, exposed for any user that needs to know which box owns a point.

Parameters
[in]a_posPhysical position.
Returns
{level, gridIndex, rank, valid}. valid is false (and the other fields are unspecified) when no box covers the point.

◆ getLevelset()

const EBAMRFAB & Realm::getLevelset ( const phase::which_phase  a_phase) const

Get level-set function.

Parameters
[in]a_phasePhase
Returns
Levelset

◆ getLevelTiles()

const Vector< RefCountedPtr< LevelTiles > > & Realm::getLevelTiles ( ) const
noexcept

Get the tiled space.

Returns
Level tiles

◆ getMask()

const AMRMask & Realm::getMask ( const std::string &  a_mask,
const int  a_buffer 
) const

Get AMR mask.

Returns
Mask
Parameters
[in]a_maskMask
[in]a_bufferBuffer

◆ getMFLevelGrid()

Vector< RefCountedPtr< MFLevelGrid > > & Realm::getMFLevelGrid ( )

Get MFLevelGrids.

Returns
M f level grid

◆ getMFLevelGridCoFi()

Vector< RefCountedPtr< MFLevelGrid > > & Realm::getMFLevelGridCoFi ( )

Get the coarsened grids.

The returned vector contains the coarsened grids. Entry on level lvl=0 contains the coarsening of level lvl=1 and so on. The top level is undefined because there was no finer grid from which we can coarsen.

Returns
M f level grid co fi

◆ getMFLevelGridFiCo()

Vector< RefCountedPtr< MFLevelGrid > > & Realm::getMFLevelGridFiCo ( )

Get the refined grids.

The returned vector contains the refined grids. Entry on level lvl=1 contains the refinement of level lvl=0 and so on. The bottom level is undefined because there was no coarser grid from which we can refine.

Returns
M f level grid fi co

◆ getMultiCutFaceIterator()

Vector< RefCountedPtr< LayoutData< std::array< FaceIterator, SpaceDim > > > > & Realm::getMultiCutFaceIterator ( const phase::which_phase  a_phase) const

Get face iterators restricted to multiply-cut faces in each valid grid box.

Only faces abutting multiply-cut cells (cells with more than one VoF) are visited. Faces are enumerated with FaceStop::SurroundingNoBoundary.

Parameters
[in]a_phasePhase
Returns
Multi-cut face iterator

◆ getMultiCutVofIterator()

Vector< RefCountedPtr< LayoutData< VoFIterator > > > & Realm::getMultiCutVofIterator ( const phase::which_phase  a_phase) const

Get VoFIterators restricted to multiply-cut cells for a particular phase.

Parameters
[in]a_phasePhase
Returns
Multi-cut vof iterator

◆ getMultigridInterpolator()

Vector< RefCountedPtr< EBMultigridInterpolator > > & Realm::getMultigridInterpolator ( const phase::which_phase  a_phase)

Get the multigrid interpolator.

Parameters
[in]a_phasePhase
Returns
Multigrid interpolator

◆ getNonConservativeDivergence()

const Vector< RefCountedPtr< EBNonConservativeDivergence > > & Realm::getNonConservativeDivergence ( const phase::which_phase  a_phase) const

Get objects for computing "non-conservative divergences".

Parameters
[in]a_phasePhase
Returns
Non conservative divergence

◆ getNotCoveredCells()

const EBAMRCellData & Realm::getNotCoveredCells ( const phase::which_phase  a_phase) const

Get the non-covered-cell mask (1 in regular/irregular cells, 0 in covered cells) for a phase.

Parameters
[in]a_phasePhase
Returns
Non-covered-cell mask

◆ getParticleGhostExposure()

const AMRMask & Realm::getParticleGhostExposure ( const int  a_width) const
noexcept

Get the boundary-exposure mask for a registered particle ghost width.

See m_particleGhostExposure' own docs for what "exposed" means and why the mask carries no ghost cells.

Parameters
[in]a_widthRegistered ghost width.
Returns
The per-level exposure mask for a_width. Aborts if the width was not registered.

◆ getParticleGhostMask()

const AMRParticleGhostMask & Realm::getParticleGhostMask ( const int  a_width) const
noexcept

Get the same-level particle ghost mask for a registered width.

Parameters
[in]a_widthRegistered ghost width.
Returns
The per-level same-level mask for a_width. Aborts if the width was not registered.

◆ getParticleGhostMaskCoarToFine()

const AMRParticleGhostMask & Realm::getParticleGhostMaskCoarToFine ( const int  a_width) const
noexcept

Get the coarse-to-fine particle ghost mask for a registered width.

Parameters
[in]a_widthRegistered ghost width.
Returns
The per-level coarse-to-fine mask for a_width. Aborts if the width was not registered.

◆ getParticleGhostMaskFineToCoar()

const AMRParticleGhostMask & Realm::getParticleGhostMaskFineToCoar ( const int  a_width) const
noexcept

Get the fine-to-coarse particle ghost mask for a registered width.

Parameters
[in]a_widthRegistered ghost width.
Returns
The per-level fine-to-coarse mask for a_width. Aborts if the width was not registered.

◆ getParticleMesh()

EBAMRParticleMesh & Realm::getParticleMesh ( const phase::which_phase  a_phase)

Get the particle mesh operator.

Parameters
[in]a_phaseWhich phase
Returns
Particle mesh

◆ getRealm()

PhaseRealm & Realm::getRealm ( const phase::which_phase  a_phase)
protected

Get a particular realm.

Parameters
[in]a_phasePhase
Returns
Realm

◆ getRedistributionOp()

Vector< RefCountedPtr< EBFluxRedistribution > > & Realm::getRedistributionOp ( const phase::which_phase  a_phase)

Get the redistribution operators.

Parameters
[in]a_phasePhase (gas or solid)
Returns
Redistribution op

◆ getRefinementRatios()

const Vector< int > & Realm::getRefinementRatios ( ) const

Get refinement ratios.

Returns
m_refinementRatios

◆ getRegularCells()

const EBAMRCellData & Realm::getRegularCells ( const phase::which_phase  a_phase) const

Get the regular-cell mask (value 1 in regular cells, 0 elsewhere) for a phase.

Parameters
[in]a_phasePhase
Returns
Regular-cell mask

◆ getSurfaceDeposition()

EBAMRSurfaceDeposition & Realm::getSurfaceDeposition ( const phase::which_phase  a_phase)

Get the particle mesh operator.

Parameters
[in]a_phaseWhich phase
Returns
Surface deposition

◆ getTrivialParticleGhostMask()

const AMRParticleGhostMask & Realm::getTrivialParticleGhostMask ( ) const
noexcept

Get a trivial (empty) particle ghost mask that scatters no particles.

Pass this to ParticleContainer::fillGhost for a direction that should not scatter. It holds no levels, so a fill over it is a no-op.

Returns
A static empty mask.

◆ getValidCells()

const AMRMask & Realm::getValidCells ( ) const

Get all valid cells.

Returns
Valid cells

◆ getVofIterator()

Vector< RefCountedPtr< LayoutData< VoFIterator > > > & Realm::getVofIterator ( const phase::which_phase  a_phase) const

Get VoFIterators covering all cut-cells (singly- and multiply-cut) for a particular phase.

For a pass covering only multiply-cut cells, use getMultiCutVofIterator instead.

Parameters
[in]a_phasePhase (gas or solid)
Returns
Per-level LayoutData of VoFIterators covering all irregular cells

◆ operator=() [1/2]

Realm & Realm::operator= ( const Realm &&  a_other)
delete

Disallowed move assignment operator.

Parameters
[in]a_otherOther realm

◆ operator=() [2/2]

Realm & Realm::operator= ( const Realm a_other)
delete

Disallowed copy assignment operator.

Parameters
[in]a_otherOther realm

◆ queryMask()

bool Realm::queryMask ( const std::string &  a_mask,
const int  a_buffer 
) const

Query if a mask has been registered.

Parameters
[in]a_maskMask name
Returns
true if mask has been registered
Parameters
[in]a_bufferBuffer

◆ queryOperator()

bool Realm::queryOperator ( const std::string &  a_operator,
const phase::which_phase  a_phase 
) const

Query if an AMR operator has been registered.

Parameters
[in]a_operatoroperator name
[in]a_phasePhase where operator is registered
Returns
True if operator has been registered and false otherwise

◆ registerMask()

void Realm::registerMask ( const std::string &  a_mask,
const int  a_buffer 
)

Register a mask.

Parameters
[in]a_maskMask name
[in]a_bufferBuffer

◆ registerOperator()

void Realm::registerOperator ( const std::string &  a_operator,
const phase::which_phase  a_phase 
)

Register an AMR operator.

Parameters
[in]a_operatorOperator name
[in]a_phasePhase where operator is registered

Issues run-time error if a_operator can't be recognized

◆ registerParticleGhostMask()

void Realm::registerParticleGhostMask ( const int  a_width)
noexcept

Register a particle ghost-mask width so it is (re)built at every regrid.

Downstream code must register a width before it can fetch the corresponding masks. Widths are deduplicated, so several consumers may safely request the same width. No masks are built at all unless at least one width has been registered.

Parameters
[in]a_widthGhost width (cells). Must be > 0; a run-time error is thrown otherwise.

◆ regridBase()

void Realm::regridBase ( const int  a_lmin)

Regrid method for EBAMR base.

Parameters
[in]a_lminCoarsest grid level that changed.

This regrids EBLevelGrid and iterators

◆ regridOperators()

void Realm::regridOperators ( const int  a_lmin)

Regrid method for EBAMR operators.

Parameters
[in]a_lminCoarsest grid level that changed.

This regrids all operators.

◆ setGrids()

void Realm::setGrids ( const Vector< DisjointBoxLayout > &  a_grids,
const int  a_finestLevel 
)

Set grid method.

Parameters
[in]a_gridsNew grids
[in]a_finestLevelNew finest grid level

This sets m_grids to be a_grids, but does not perform a regrid of remaining members.

Member Data Documentation

◆ m_particleGhostExposure

std::map<int, AMRMask> Realm::m_particleGhostExposure
protected

Particle boundary-exposure masks, keyed by ghost width. Per width: indexed by level, true in every cell that has at least one outgoing ghost-shipment target in ANY direction – i.e. the OR over the same-level, fine-to-coarse and coarse-to-fine masks of numTargets(cell) > 0.

A cell is "exposed" when a particle sitting in it is visible to some other box, so a consumer that wants to act on such a particle unilaterally cannot: some other box may be acting on the same particle in the same round. The mergers ask this question per particle, every timestep, for data that changes only when the masks it is derived from do – hence caching it here, beside those masks and rebuilt by the same function.

Carries NO ghost cells, deliberately: only cells holding a RESIDENT particle are ever queried, and resident means the cell lies in the patch's own box. A ghost particle's cell lies outside the box and would in any case violate ParticleGhostMask::numTargets()' own precondition.

◆ m_realms

std::map<phase::which_phase, RefCountedPtr<PhaseRealm> > Realm::m_realms
mutableprotected

Phase realms.

Mutable because some of the operators are mutable.


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