28#include <CD_NamespaceHeader.H>
33using AMRMask = Vector<RefCountedPtr<LevelData<BaseFab<bool>>>>;
109 define(
const Vector<DisjointBoxLayout>& a_grids,
110 const Vector<ProblemDomain>& a_domains,
111 const Vector<int>& a_refRat,
112 const Vector<Real>& a_dx,
113 const RealVect& a_probLo,
114 const int a_finestLevel,
115 const int a_minBlockSize,
117 const int a_numGhost,
118 const int a_lsfGhost,
119 const int a_redistRad,
120 const int a_mgInterpOrder,
121 const int a_mgInterpRadius,
122 const int a_mgInterpWeight,
126 const RefCountedPtr<MultiFluidIndexSpace>& a_mfis);
135 setGrids(
const Vector<DisjointBoxLayout>& a_grids,
const int a_finestLevel);
183 registerMask(
const std::string& a_mask,
const int a_buffer);
192 queryMask(
const std::string& a_mask,
const int a_buffer)
const;
212 const Vector<DisjointBoxLayout>&
219 const Vector<ProblemDomain>&
226 Vector<RefCountedPtr<MFLevelGrid>>&
235 Vector<RefCountedPtr<MFLevelGrid>>&
244 Vector<RefCountedPtr<MFLevelGrid>>&
252 const RefCountedPtr<EBIndexSpace>&
260 const Vector<EBISLayout>&
268 const Vector<RefCountedPtr<EBLevelGrid>>&
276 const Vector<RefCountedPtr<EBLevelGrid>>&
285 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
293 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
305 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
316 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
327 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
337 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
345 const Vector<RefCountedPtr<EBNonConservativeDivergence>>&
353 const Vector<RefCountedPtr<CellCentroidInterpolation>>&
361 const Vector<RefCountedPtr<EBCentroidInterpolation>>&
369 Vector<RefCountedPtr<EBCoarAve>>&
377 Vector<RefCountedPtr<EBMultigridInterpolator>>&
401 const Vector<RefCountedPtr<EBGradient>>&
409 Vector<RefCountedPtr<EBGhostCellInterpolator>>&
417 Vector<RefCountedPtr<EBCoarseToFineInterp>>&
425 Vector<RefCountedPtr<EBReflux>>&
433 Vector<RefCountedPtr<EBFluxRedistribution>>&
483 getMask(
const std::string& a_mask,
const int a_buffer)
const;
570 const RefCountedPtr<PetscGrid>&
571 getPetscGrid() const noexcept;
628 Vector<RefCountedPtr<MFLevelGrid>>
m_mflg;
699 RefCountedPtr<PetscGrid> m_petscGrid;
706 mutable std::map<phase::which_phase, RefCountedPtr<PhaseRealm>>
m_realms;
711 std::map<phase::which_phase, RefCountedPtr<BaseIF>>
m_baseif;
752 const ProblemDomain& a_domainCoar,
753 const ProblemDomain& a_domainFine,
754 const DisjointBoxLayout& a_gridsCoar,
755 const DisjointBoxLayout& a_gridsFine,
788 const ProblemDomain& a_domainCoar,
789 const ProblemDomain& a_domainFine,
790 const DisjointBoxLayout& a_gridsCoar,
791 const DisjointBoxLayout& a_gridsFine,
851 const DisjointBoxLayout& a_dbl,
852 const ProblemDomain& a_domain,
853 const
int a_ghost) noexcept;
875 const DisjointBoxLayout& a_thisLayout,
876 const DisjointBoxLayout& a_coarLayout,
877 const ProblemDomain& a_coarDomain,
879 const
int a_ghost) noexcept;
901 const DisjointBoxLayout& a_thisLayout,
902 const DisjointBoxLayout& a_fineLayout,
903 const LevelData<BaseFab<
bool>>& a_validCells,
904 const ProblemDomain& a_fineDomain,
906 const
int a_ghost) noexcept;
924 const DisjointBoxLayout& a_dbl,
928 const
bool a_hasCoar,
929 const
bool a_hasFine) noexcept;
946#include <CD_NamespaceFooter.H>
Declaration of an AMR driver that deposits/interpolates ParticleContainer particles.
Declaration of LevelTiles.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Declaration of ParticleGhostMask, a per-box CSR lookup of particle ghost scatter targets.
Vector< RefCountedPtr< LayoutData< ParticleGhostMask > > > AMRParticleGhostMask
AMR-wide particle ghost-target lookup: one per-box CSR table per level, indexed by SOURCE level.
Definition CD_ParticleGhostMask.H:210
File containing declaration of PetscGrid.
Declaration of the PhaseRealm class.
Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > AMRMask
Alias for cutting down on the typic of booleans defined over AMR grids.
Definition CD_Realm.H:33
Type
Supported interpolation types.
Definition CD_CellCentroidInterpolation.H:44
AMR driver that deposits/interpolates ParticleContainer particles across the hierarchy.
Definition CD_EBAMRParticleMesh.H:74
class for handling surface deposition of particles with EB and AMR.
Definition CD_EBAMRSurfaceDeposition.H:30
Type
Supported interpolation types.
Definition CD_EBCentroidInterpolation.H:44
Class for storing the AMR hierarchy as a collection of tiles.
Definition CD_LevelTiles.H:43
Per-box CSR lookup from a source cell to the destination boxes whose ghosted region covers it.
Definition CD_ParticleGhostMask.H:53
Class that holds important things for doing AMR over a specific phase and processor distribution.
Definition CD_PhaseRealm.H:73
Class for holding multifluid Realms, which are the Realms that we actually use.
Definition CD_Realm.H:39
void registerMask(const std::string &a_mask, const int a_buffer)
Register a mask.
Definition CD_Realm.cpp:1563
int m_minBlockSize
Blocking factor.
Definition CD_Realm.H:593
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const phase::which_phase a_phase)
Get flux register utility.
Definition CD_Realm.cpp:1762
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.
Definition CD_Realm.cpp:1190
void defineMFLevelGrid(const int a_lmin)
Define MFLevelGrid.
Definition CD_Realm.cpp:220
bool queryOperator(const std::string &a_operator, const phase::which_phase a_phase) const
Query if an AMR operator has been registered.
Definition CD_Realm.cpp:1552
const AMRParticleGhostMask & getParticleGhostMaskCoarToFine(const int a_width) const noexcept
Get the coarse-to-fine particle ghost mask for a registered width.
Definition CD_Realm.cpp:1853
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const phase::which_phase a_phase)
Get piecewise linear ghost cell interpolation utility.
Definition CD_Realm.cpp:1756
AMRMask m_validCells
Mask which is true for all valid cells.
Definition CD_Realm.H:653
static const std::string primal
Identifier for perimal realm.
Definition CD_Realm.H:49
Realm(const Realm &a_other)=delete
Disallowed copy ctor.
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.
Definition CD_Realm.cpp:1241
bool m_isDefined
Realm defined or not.
Definition CD_Realm.H:578
void defineOuterHaloMask(const int a_lmin)
Define outer particle halo mask.
Definition CD_Realm.cpp:292
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit/signed distance functions on each phase.
Definition CD_Realm.H:711
Vector< ProblemDomain > m_domains
Domains.
Definition CD_Realm.H:623
Vector< int > m_refinementRatios
Refinement ratios.
Definition CD_Realm.H:613
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const phase::which_phase a_phase)
Get the redistribution operators.
Definition CD_Realm.cpp:1768
std::set< int > m_particleGhostMaskWidths
Registered particle ghost-mask widths (>0). Persist across regrids; the masks below are (re)built for...
Definition CD_Realm.H:659
Realm(const Realm &&a_other)=delete
Disallowed move ctor.
std::map< int, AMRParticleGhostMask > m_particleGhostMaskFineToCoar
Fine-to-coarse particle ghost masks, keyed by ghost width. Per width: indexed by source level (>=1); ...
Definition CD_Realm.H:671
const Vector< ProblemDomain > & getDomains() const
Get problem domains.
Definition CD_Realm.cpp:1618
const AMRParticleGhostMask & getTrivialParticleGhostMask() const noexcept
Get a trivial (empty) particle ghost mask that scatters no particles.
Definition CD_Realm.cpp:1866
bool queryMask(const std::string &a_mask, const int a_buffer) const
Query if a mask has been registered.
Definition CD_Realm.cpp:1574
const Vector< RefCountedPtr< EBNonConservativeDivergence > > & getNonConservativeDivergence(const phase::which_phase a_phase) const
Get objects for computing "non-conservative divergences".
Definition CD_Realm.cpp:1702
Vector< RefCountedPtr< MFLevelGrid > > m_mflgCoFi
Coarsened grids. Entry lvl contains the coarsened version of grids on level lvl+1.
Definition CD_Realm.H:633
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.
Definition CD_Realm.cpp:1792
const AMRMask & getParticleGhostExposure(const int a_width) const noexcept
Get the boundary-exposure mask for a registered particle ghost width.
Definition CD_Realm.cpp:1874
void defineValidCells()
Define the valid cell region mask.
Definition CD_Realm.cpp:991
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).
Definition CD_Realm.cpp:1294
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.
Definition CD_Realm.cpp:1696
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridFiCo()
Get the refined grids.
Definition CD_Realm.cpp:1636
const Vector< EBISLayout > & getEBISLayout(const phase::which_phase a_phase) const
Get EBISLayout for particular phase.
Definition CD_Realm.cpp:1648
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getMultiCutVofIterator(const phase::which_phase a_phase) const
Get VoFIterators restricted to multiply-cut cells for a particular phase.
Definition CD_Realm.cpp:1672
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).
Definition CD_Realm.cpp:1408
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridCoFi()
Get the coarsened grids.
Definition CD_Realm.cpp:1630
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.
Definition CD_Realm.cpp:1690
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.
Definition CD_Realm.cpp:1666
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const phase::which_phase a_phase)
Get the multigrid interpolator.
Definition CD_Realm.cpp:1738
const Vector< RefCountedPtr< EBGradient > > & getGradientOp(const phase::which_phase a_phase) const
Get gradient operator.
Definition CD_Realm.cpp:1744
const Vector< DisjointBoxLayout > & getGrids() const
Get AMR grids.
Definition CD_Realm.cpp:1612
int m_verbosity
Realm verbosity. Used for debugging.
Definition CD_Realm.H:583
void registerOperator(const std::string &a_operator, const phase::which_phase a_phase)
Register an AMR operator.
Definition CD_Realm.cpp:1541
void defineInnerCFMask(const int a_lmin)
Define a mask which is true on the inside (i.e., fine side) of the refinement boundary.
Definition CD_Realm.cpp:845
Vector< RefCountedPtr< MFLevelGrid > > m_mflg
MFLevelGrids.
Definition CD_Realm.H:628
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const phase::which_phase a_phase)
Get data coarsening utility.
Definition CD_Realm.cpp:1720
void defineParticleGhostMasks() noexcept
Define the same-level, fine-to-coarse, and coarse-to-fine particle ghost masks on every level.
Definition CD_Realm.cpp:1095
const AMRParticleGhostMask & getParticleGhostMaskFineToCoar(const int a_width) const noexcept
Get the fine-to-coarse particle ghost mask for a registered width.
Definition CD_Realm.cpp:1840
Vector< Real > m_dx
Grid resolutions.
Definition CD_Realm.H:608
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGrid(const phase::which_phase a_phase) const
Get EBLevelGrid for particular phase.
Definition CD_Realm.cpp:1654
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.
Definition CD_Realm.cpp:1786
std::map< phase::which_phase, RefCountedPtr< PhaseRealm > > m_realms
Phase realms.
Definition CD_Realm.H:706
Vector< RefCountedPtr< EBGhostCellInterpolator > > & getGhostCellInterpolator(const phase::which_phase a_phase)
Get ghost cell interpolator.
Definition CD_Realm.cpp:1750
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 fo...
Definition CD_Realm.cpp:1684
const AMRMask & getValidCells() const
Get all valid cells.
Definition CD_Realm.cpp:1815
Realm & operator=(const Realm &&a_other)=delete
Disallowed move assignment operator.
Realm & operator=(const Realm &a_other)=delete
Disallowed copy assignment operator.
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_Realm.cpp:1600
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid()
Get MFLevelGrids.
Definition CD_Realm.cpp:1624
void defineLevelTiles() noexcept
Define the tiled space.
Definition CD_Realm.cpp:1497
int m_finestLevel
Finest AMR level.
Definition CD_Realm.H:588
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.
Definition CD_Realm.cpp:1798
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 ...
Definition CD_Realm.cpp:1678
void regridOperators(const int a_lmin)
Regrid method for EBAMR operators.
Definition CD_Realm.cpp:179
void defineMasks(const int a_lmin)
Define masks.
Definition CD_Realm.cpp:196
Vector< RefCountedPtr< LevelTiles > > m_levelTiles
Level "tiles" – i.e. the grids viewed as constant-size boxes.
Definition CD_Realm.H:643
std::map< std::pair< std::string, int >, AMRMask > m_masks
Masks.
Definition CD_Realm.H:716
const AMRParticleGhostMask & getParticleGhostMask(const int a_width) const noexcept
Get the same-level particle ghost mask for a registered width.
Definition CD_Realm.cpp:1827
Vector< RefCountedPtr< MFLevelGrid > > m_mflgFiCo
Refined grids. Entry lvl+1 contains the refined version of grids on level lvl.
Definition CD_Realm.H:638
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGridCoFi(const phase::which_phase a_phase) const
Get coarsened fine EBLevelGrid for particular phase.
Definition CD_Realm.cpp:1660
void definePetscGrid() noexcept
Define the PETSc composite grid.
Definition CD_Realm.cpp:1512
EBAMRParticleMesh & getParticleMesh(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:1726
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles() const noexcept
Get the tiled space.
Definition CD_Realm.cpp:1821
void registerParticleGhostMask(const int a_width) noexcept
Register a particle ghost-mask width so it is (re)built at every regrid.
Definition CD_Realm.cpp:1080
const Vector< Real > & getDx() const
Get grid resolutions.
Definition CD_Realm.cpp:1606
std::map< int, AMRParticleGhostMask > m_particleGhostMask
Same-level particle ghost masks, keyed by ghost width. Per width: indexed by source level,...
Definition CD_Realm.H:665
std::map< int, AMRParticleGhostMask > m_particleGhostMaskCoarToFine
Coarse-to-fine particle ghost masks, keyed by ghost width. Per width: indexed by source level (<fines...
Definition CD_Realm.H:677
PhaseRealm & getRealm(const phase::which_phase a_phase)
Get a particular realm.
Definition CD_Realm.cpp:1594
void setGrids(const Vector< DisjointBoxLayout > &a_grids, const int a_finestLevel)
Set grid method.
Definition CD_Realm.cpp:127
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
Index spaces.
Definition CD_Realm.H:648
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.
Definition CD_Realm.cpp:1780
const RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase) const
Get EBIndexSpace for particular phase.
Definition CD_Realm.cpp:1642
const AMRMask & getMask(const std::string &a_mask, const int a_buffer) const
Get AMR mask.
Definition CD_Realm.cpp:1804
void defineCFIVS(const int a_lmin)
Define the coarse-fine interface.
Definition CD_Realm.cpp:926
Realm()
Default constructor. Must subsequently call define.
Definition CD_Realm.cpp:34
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.
Definition CD_Realm.cpp:49
EBAMRSurfaceDeposition & getSurfaceDeposition(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:1732
void defineInnerHaloMask(const int a_lmin)
Define inner particle halo mask.
Definition CD_Realm.cpp:486
Vector< DisjointBoxLayout > m_grids
AMR grids.
Definition CD_Realm.H:618
static const std::string Primal
Identifier for perimal realm.
Definition CD_Realm.H:44
void preRegrid()
Perform pre-regrid operations.
Definition CD_Realm.cpp:140
LevelTiles::LevelAndBox getLevelAndBox(const RealVect &a_pos) const noexcept
Find the (finest) grid box covering a physical position.
Definition CD_Realm.cpp:1889
RealVect m_probLo
Physical coordinates of lower-left corner in simulation domain.
Definition CD_Realm.H:603
const EBAMRFAB & getLevelset(const phase::which_phase a_phase) const
Get level-set function.
Definition CD_Realm.cpp:1774
int m_numGhost
Number of ghost cells.
Definition CD_Realm.H:598
void regridBase(const int a_lmin)
Regrid method for EBAMR base.
Definition CD_Realm.cpp:162
const Vector< RefCountedPtr< EBCentroidInterpolation > > & getEBCentroidInterpolation(const phase::which_phase a_phase) const
Get objects for computing interpolation of cell-centered data to EB centroids.
Definition CD_Realm.cpp:1714
void defineOuterCFMask(const int a_lmin)
Define a mask which is true on the outside (i.e., coarse side) of the refinement boundary.
Definition CD_Realm.cpp:651
std::map< int, AMRMask > m_particleGhostExposure
Particle boundary-exposure masks, keyed by ghost width. Per width: indexed by level,...
Definition CD_Realm.H:693
const Vector< RefCountedPtr< CellCentroidInterpolation > > & getCellCentroidInterpolation(const phase::which_phase a_phase) const
Get objects for computing interpolation of cell-centered data to cell centroids.
Definition CD_Realm.cpp:1708
Phase names namespace.
Definition CD_MultiFluidIndexSpace.H:28
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38