chombo-discharge
Loading...
Searching...
No Matches
CD_Realm.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
12
13#ifndef CD_REALM_H
14#define CD_REALM_H
15
16// Std includes
17#include <map>
18#include <set>
19
20// Our includes
21#include <CD_PhaseRealm.H>
24#include <CD_MFLevelGrid.H>
25#include <CD_LevelTiles.H>
27#include <CD_PetscGrid.H>
28#include <CD_NamespaceHeader.H>
29
33using AMRMask = Vector<RefCountedPtr<LevelData<BaseFab<bool>>>>;
34
38class Realm
39{
40public:
44 const static std::string Primal;
45
49 const static std::string primal;
50
54 Realm();
55
60 Realm(const Realm& a_other) = delete;
61
66 Realm(const Realm&& a_other) = delete;
67
72 Realm&
73 operator=(const Realm& a_other) = delete;
74
79 Realm&
80 operator=(const Realm&& a_other) = delete;
81
86
114 void
115 define(const Vector<DisjointBoxLayout>& a_grids,
116 const Vector<ProblemDomain>& a_domains,
117 const Vector<int>& a_refRat,
118 const Vector<Real>& a_dx,
119 const RealVect& a_probLo,
120 const int a_finestLevel,
121 const int a_minBlockSize,
122 const int a_maxBlockSize,
123 const int a_ebGhost,
124 const int a_numGhost,
125 const int a_lsfGhost,
126 const int a_srdOrder,
127 const Real a_srdTargetVolFrac,
128 const int a_mgInterpOrder,
129 const int a_mgInterpRadius,
130 const int a_mgInterpWeight,
131 const int a_mirrorBandRadius,
132 const Real a_mirrorCondTol,
133 const Real a_mirrorCreaseTol,
134 const CellCentroidInterpolation::Type a_centroidInterpType,
135 const EBCentroidInterpolation::Type a_ebInterpType,
136 const std::map<phase::which_phase, RefCountedPtr<BaseIF>>& a_baseif,
137 const RefCountedPtr<MultiFluidIndexSpace>& a_mfis);
138
145 void
146 setGrids(const Vector<DisjointBoxLayout>& a_grids, const int a_finestLevel);
147
151 void
152 preRegrid();
153
159 void
160 regridBase(const int a_lmin);
161
167 void
168 regridOperators(const int a_lmin);
169
176 void
177 registerOperator(const std::string& a_operator, const phase::which_phase a_phase);
178
188 void
189 registerMultigrid(const int a_minCellsBottom);
190
197 const Vector<Vector<RefCountedPtr<EBLevelGrid>>>&
198 getMultigridLevelGrids(const phase::which_phase a_phase) const;
199
206 const Vector<Vector<RefCountedPtr<EBLevelGrid>>>&
208
215 const Vector<Vector<RefCountedPtr<EBCoarAve>>>&
217
223 const Vector<Vector<RefCountedPtr<MFLevelGrid>>>&
225
231 const Vector<Vector<RefCountedPtr<MFLevelGrid>>>&
233
240 bool
241 queryOperator(const std::string& a_operator, const phase::which_phase a_phase) const;
242
248 void
249 registerMask(const std::string& a_mask, const int a_buffer);
250
257 bool
258 queryMask(const std::string& a_mask, const int a_buffer) const;
259
264 const Vector<int>&
265 getRefinementRatios() const;
266
271 const Vector<Real>&
272 getDx() const;
273
278 const Vector<DisjointBoxLayout>&
279 getGrids() const;
280
285 const Vector<ProblemDomain>&
286 getDomains() const;
287
292 Vector<RefCountedPtr<MFLevelGrid>>&
294
301 Vector<RefCountedPtr<MFLevelGrid>>&
303
310 Vector<RefCountedPtr<MFLevelGrid>>&
312
318 const RefCountedPtr<EBIndexSpace>&
319 getEBIndexSpace(const phase::which_phase a_phase) const;
320
326 const Vector<EBISLayout>&
327 getEBISLayout(const phase::which_phase a_phase) const;
328
334 const Vector<RefCountedPtr<EBLevelGrid>>&
335 getEBLevelGrid(const phase::which_phase a_phase) const;
336
342 const Vector<RefCountedPtr<EBLevelGrid>>&
343 getEBLevelGridCoFi(const phase::which_phase a_phase) const;
344
351 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
352 getVofIterator(const phase::which_phase a_phase) const;
353
359 Vector<RefCountedPtr<LayoutData<VoFIterator>>>&
360 getMultiCutVofIterator(const phase::which_phase a_phase) const;
361
371 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
372 getFaceIterator(const phase::which_phase a_phase) const;
373
382 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
384
393 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
395
403 Vector<RefCountedPtr<LayoutData<std::array<FaceIterator, SpaceDim>>>>&
404 getMultiCutFaceIterator(const phase::which_phase a_phase) const;
405
411 const Vector<RefCountedPtr<EBNonConservativeDivergence>>&
413
419 const Vector<RefCountedPtr<CellCentroidInterpolation>>&
421
427 const Vector<RefCountedPtr<EBCentroidInterpolation>>&
429
435 Vector<RefCountedPtr<EBCoarAve>>&
437
443 Vector<RefCountedPtr<EBMultigridInterpolator>>&
445
452 getParticleMesh(const phase::which_phase a_phase);
453
461
467 const Vector<RefCountedPtr<EBGradient>>&
468 getGradientOp(const phase::which_phase a_phase) const;
469
475 Vector<RefCountedPtr<EBGhostCellInterpolator>>&
477
483 Vector<RefCountedPtr<EBCoarseToFineInterp>>&
484 getFineInterp(const phase::which_phase a_phase);
485
491 Vector<RefCountedPtr<EBReflux>>&
492 getFluxRegister(const phase::which_phase a_phase);
493
499 Vector<RefCountedPtr<EBMassRedistribution>>&
501
507 const RefCountedPtr<EBStateRedistribution>&
509
515 const EBAMRFAB&
516 getLevelset(const phase::which_phase a_phase) const;
517
523 const EBAMRCellData&
524 getRegularCells(const phase::which_phase a_phase) const;
525
531 const EBAMRCellData&
532 getCoveredCells(const phase::which_phase a_phase) const;
533
539 const EBAMRCellData&
540 getNotCoveredCells(const phase::which_phase a_phase) const;
541
547 const EBAMRCellData&
548 getIrregularCells(const phase::which_phase a_phase) const;
549
555 const EBAMRCellData&
556 getMirrorSurfaceData(const phase::which_phase a_phase) const;
557
563 const Vector<int>&
564 getMirrorHasCutCells(const phase::which_phase a_phase) const;
565
572 const AMRMask&
573 getMask(const std::string& a_mask, const int a_buffer) const;
574
579 const AMRMask&
580 getValidCells() const;
581
589 void
590 registerParticleGhostMask(const int a_width) noexcept;
591
598 getParticleGhostMask(const int a_width) const noexcept;
599
606 getParticleGhostMaskFineToCoar(const int a_width) const noexcept;
607
614 getParticleGhostMaskCoarToFine(const int a_width) const noexcept;
615
623 getTrivialParticleGhostMask() const noexcept;
624
632 const AMRMask&
633 getParticleGhostExposure(const int a_width) const noexcept;
634
639 const Vector<RefCountedPtr<LevelTiles>>&
640 getLevelTiles() const noexcept;
641
653 LevelTiles::LevelAndBox
654 getLevelAndBox(const RealVect& a_pos) const noexcept;
655
656#ifdef CH_USE_PETSC
661 const RefCountedPtr<PetscGrid>&
662 getPetscGrid() const noexcept;
663#endif
664
665protected:
670
675
680
685
690
696
701
705 RealVect m_probLo;
706
710 Vector<Real> m_dx;
711
716
720 Vector<DisjointBoxLayout> m_grids;
721
725 Vector<ProblemDomain> m_domains;
726
730 Vector<RefCountedPtr<MFLevelGrid>> m_mflg;
731
735 Vector<RefCountedPtr<MFLevelGrid>> m_mflgCoFi;
736
740 Vector<RefCountedPtr<MFLevelGrid>> m_mflgFiCo;
741
745 Vector<Vector<RefCountedPtr<MFLevelGrid>>> m_mgMflg;
746
751 Vector<Vector<RefCountedPtr<MFLevelGrid>>> m_mgMflgCoFi;
752
756 Vector<RefCountedPtr<LevelTiles>> m_levelTiles;
757
761 RefCountedPtr<MultiFluidIndexSpace> m_multifluidIndexSpace;
762
767
773
778 std::map<int, AMRParticleGhostMask> m_particleGhostMask;
779
784 std::map<int, AMRParticleGhostMask> m_particleGhostMaskFineToCoar;
785
790 std::map<int, AMRParticleGhostMask> m_particleGhostMaskCoarToFine;
791
806 std::map<int, AMRMask> m_particleGhostExposure;
807
808#ifdef CH_USE_PETSC
812 RefCountedPtr<PetscGrid> m_petscGrid;
813#endif
814
819 mutable std::map<phase::which_phase, RefCountedPtr<PhaseRealm>> m_realms;
820
824 std::map<phase::which_phase, RefCountedPtr<BaseIF>> m_baseif;
825
829 std::map<std::pair<std::string, int>, AMRMask> m_masks;
830
835 void
836 defineMFLevelGrid(const int a_lmin);
837
846 void
848
862 bool
863 getCoarserMultigridLayout(DisjointBoxLayout& a_dblCoar,
864 ProblemDomain& a_domainCoar,
865 const DisjointBoxLayout& a_dblFine,
866 const ProblemDomain& a_domainFine,
867 const bool a_repartition) const;
868
873 void
874 defineMasks(const int a_lmin);
875
881 void
882 defineOuterHaloMask(const int a_lmin);
883
894 void
895 defineOuterHaloMask(LevelData<BaseFab<bool>>& a_coarMask,
896 const ProblemDomain& a_domainCoar,
897 const ProblemDomain& a_domainFine,
898 const DisjointBoxLayout& a_gridsCoar,
899 const DisjointBoxLayout& a_gridsFine,
900 const int a_buffer,
901 const int a_refRat);
902
910 void
911 defineInnerHaloMask(const int a_lmin);
912
917 void
918 defineOuterCFMask(const int a_lmin);
919
930 void
931 defineOuterCFMask(LevelData<BaseFab<bool>>& a_coarMask,
932 const ProblemDomain& a_domainCoar,
933 const ProblemDomain& a_domainFine,
934 const DisjointBoxLayout& a_gridsCoar,
935 const DisjointBoxLayout& a_gridsFine,
936 const int a_buffer,
937 const int a_refRat);
938
943 void
944 defineInnerCFMask(const int a_lmin);
945
951 void
952 defineCFIVS(const int a_lmin);
953
961 void
962 defineCoveredByFinerMask(const int a_lmin);
963
972 void
973 defineCoarseFineGhostMask(const int a_lmin);
974
978 void
980
984 void
985 defineLevelTiles() noexcept;
986
996 void
997 defineParticleGhostMasks() noexcept;
998
1014 void
1016 const DisjointBoxLayout& a_dbl,
1017 const ProblemDomain& a_domain,
1018 const int a_ghost) noexcept;
1019
1038 void
1040 const DisjointBoxLayout& a_thisLayout,
1041 const DisjointBoxLayout& a_coarLayout,
1042 const ProblemDomain& a_coarDomain,
1043 const int a_refRat,
1044 const int a_ghost) noexcept;
1045
1064 void
1066 const DisjointBoxLayout& a_thisLayout,
1067 const DisjointBoxLayout& a_fineLayout,
1068 const LevelData<BaseFab<bool>>& a_validCells,
1069 const ProblemDomain& a_fineDomain,
1070 const int a_refRat,
1071 const int a_ghost) noexcept;
1072
1087 void
1088 defineParticleGhostExposure(LevelData<BaseFab<bool>>& a_exposure,
1089 const DisjointBoxLayout& a_dbl,
1090 const LayoutData<ParticleGhostMask>& a_same,
1091 const LayoutData<ParticleGhostMask>& a_fineToCoar,
1092 const LayoutData<ParticleGhostMask>& a_coarToFine,
1093 const bool a_hasCoar,
1094 const bool a_hasFine) noexcept;
1095
1099 void
1100 definePetscGrid() noexcept;
1101
1107 PhaseRealm&
1108 getRealm(const phase::which_phase a_phase);
1109};
1110
1111#include <CD_NamespaceFooter.H>
1112
1113#endif
Declaration of an AMR driver that deposits/interpolates ParticleContainer particles.
Declaration of LevelTiles.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Multi-fluid index space.
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:95
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:78
void registerMask(const std::string &a_mask, const int a_buffer)
Register a mask.
Definition CD_Realm.cpp:1951
int m_minBlockSize
Blocking factor.
Definition CD_Realm.H:684
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const phase::which_phase a_phase)
Get flux register utility.
Definition CD_Realm.cpp:2150
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:1533
void defineCoveredByFinerMask(const int a_lmin)
Define the masks of the cells that are covered by the finer level.
Definition CD_Realm.cpp:264
void defineMFLevelGrid(const int a_lmin)
Define MFLevelGrid.
Definition CD_Realm.cpp:392
void defineCoarseFineGhostMask(const int a_lmin)
Define the masks of the ghost cells that lie outside the grids of a level.
Definition CD_Realm.cpp:334
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:1940
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:2259
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const phase::which_phase a_phase)
Get piecewise linear ghost cell interpolation utility.
Definition CD_Realm.cpp:2144
AMRMask m_validCells
Mask which is true for all valid cells.
Definition CD_Realm.H:766
static const std::string primal
Identifier for perimal realm.
Definition CD_Realm.H:49
const Vector< Vector< RefCountedPtr< EBCoarAve > > > & getMultigridCoarseAverage(const phase::which_phase a_phase) const
Get the coarse averaging between consecutive multigrid levels for a phase.
Definition CD_Realm.cpp:1922
const EBAMRCellData & getMirrorSurfaceData(const phase::which_phase a_phase) const
Get the per-band-cell surface data used by mirrored deposition, for a phase.
Definition CD_Realm.cpp:2198
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:1584
bool m_isDefined
Realm defined or not.
Definition CD_Realm.H:669
const Vector< Vector< RefCountedPtr< MFLevelGrid > > > & getMultigridMFLevelGrids() const
Get the multifluid multigrid levels.
Definition CD_Realm.cpp:1928
void defineOuterHaloMask(const int a_lmin)
Define outer particle halo mask.
Definition CD_Realm.cpp:635
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit/signed distance functions on each phase.
Definition CD_Realm.H:824
Vector< ProblemDomain > m_domains
Domains.
Definition CD_Realm.H:725
Vector< int > m_refinementRatios
Refinement ratios.
Definition CD_Realm.H:715
const RefCountedPtr< PetscGrid > & getPetscGrid() const noexcept
Get the PETSc grid object.
Definition CD_Realm.cpp:2310
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:772
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:784
const Vector< ProblemDomain > & getDomains() const
Get problem domains.
Definition CD_Realm.cpp:2006
const AMRParticleGhostMask & getTrivialParticleGhostMask() const noexcept
Get a trivial (empty) particle ghost mask that scatters no particles.
Definition CD_Realm.cpp:2272
bool queryMask(const std::string &a_mask, const int a_buffer) const
Query if a mask has been registered.
Definition CD_Realm.cpp:1962
const Vector< RefCountedPtr< EBNonConservativeDivergence > > & getNonConservativeDivergence(const phase::which_phase a_phase) const
Get objects for computing "non-conservative divergences".
Definition CD_Realm.cpp:2090
Vector< Vector< RefCountedPtr< MFLevelGrid > > > m_mgMflg
Multifluid multigrid levels, with the same indexing as PhaseRealm::m_mgLevelGrids.
Definition CD_Realm.H:745
Vector< RefCountedPtr< MFLevelGrid > > m_mflgCoFi
Coarsened grids. Entry lvl contains the coarsened version of grids on level lvl+1.
Definition CD_Realm.H:735
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:2186
const AMRMask & getParticleGhostExposure(const int a_width) const noexcept
Get the boundary-exposure mask for a registered particle ghost width.
Definition CD_Realm.cpp:2280
void defineValidCells()
Define the valid cell region mask.
Definition CD_Realm.cpp:1334
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:1637
const Vector< int > & getMirrorHasCutCells(const phase::which_phase a_phase) const
Get, per level, whether that level has any cut cell anywhere in the domain, for a phase.
Definition CD_Realm.cpp:2204
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:2084
void registerMultigrid(const int a_minCellsBottom)
Register the multigrid levels.
Definition CD_Realm.cpp:1895
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridFiCo()
Get the refined grids.
Definition CD_Realm.cpp:2024
const Vector< EBISLayout > & getEBISLayout(const phase::which_phase a_phase) const
Get EBISLayout for particular phase.
Definition CD_Realm.cpp:2036
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:2060
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:1751
bool getCoarserMultigridLayout(DisjointBoxLayout &a_dblCoar, ProblemDomain &a_domainCoar, const DisjointBoxLayout &a_dblFine, const ProblemDomain &a_domainFine, const bool a_repartition) const
Get a factor 2 coarsening of a multigrid level.
Definition CD_Realm.cpp:576
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridCoFi()
Get the coarsened grids.
Definition CD_Realm.cpp:2018
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:2078
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:2054
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const phase::which_phase a_phase)
Get the multigrid interpolator.
Definition CD_Realm.cpp:2126
const Vector< RefCountedPtr< EBGradient > > & getGradientOp(const phase::which_phase a_phase) const
Get gradient operator.
Definition CD_Realm.cpp:2132
const Vector< DisjointBoxLayout > & getGrids() const
Get AMR grids.
Definition CD_Realm.cpp:2000
int m_verbosity
Realm verbosity. Used for debugging.
Definition CD_Realm.H:674
const Vector< Vector< RefCountedPtr< EBLevelGrid > > > & getMultigridLevelGridsCoFi(const phase::which_phase a_phase) const
Get the coarsened grids between consecutive multigrid levels for a phase.
Definition CD_Realm.cpp:1916
void registerOperator(const std::string &a_operator, const phase::which_phase a_phase)
Register an AMR operator.
Definition CD_Realm.cpp:1884
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_maxBlockSize, const int a_ebGhost, const int a_numGhost, const int a_lsfGhost, const int a_srdOrder, const Real a_srdTargetVolFrac, const int a_mgInterpOrder, const int a_mgInterpRadius, const int a_mgInterpWeight, const int a_mirrorBandRadius, const Real a_mirrorCondTol, const Real a_mirrorCreaseTol, 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:50
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:1188
Vector< RefCountedPtr< MFLevelGrid > > m_mflg
MFLevelGrids.
Definition CD_Realm.H:730
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const phase::which_phase a_phase)
Get data coarsening utility.
Definition CD_Realm.cpp:2108
Vector< RefCountedPtr< EBMassRedistribution > > & getMassRedistributionOp(const phase::which_phase a_phase)
Get the redistribution operators.
Definition CD_Realm.cpp:2156
void defineParticleGhostMasks() noexcept
Define the same-level, fine-to-coarse, and coarse-to-fine particle ghost masks on every level.
Definition CD_Realm.cpp:1438
int m_maxBlockSize
Largest box size.
Definition CD_Realm.H:689
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:2246
Vector< Real > m_dx
Grid resolutions.
Definition CD_Realm.H:710
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGrid(const phase::which_phase a_phase) const
Get EBLevelGrid for particular phase.
Definition CD_Realm.cpp:2042
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:2180
std::map< phase::which_phase, RefCountedPtr< PhaseRealm > > m_realms
Phase realms.
Definition CD_Realm.H:819
int m_mgMinCellsBottom
Smallest number of cells along any direction of the bottom domain, over all registered multigrid user...
Definition CD_Realm.H:695
Vector< RefCountedPtr< EBGhostCellInterpolator > > & getGhostCellInterpolator(const phase::which_phase a_phase)
Get ghost cell interpolator.
Definition CD_Realm.cpp:2138
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:2072
const AMRMask & getValidCells() const
Get all valid cells.
Definition CD_Realm.cpp:2221
Vector< Vector< RefCountedPtr< MFLevelGrid > > > m_mgMflgCoFi
Multifluid coarsened grids between consecutive multigrid levels, with the same indexing as PhaseRealm...
Definition CD_Realm.H:751
Realm & operator=(const Realm &&a_other)=delete
Disallowed move assignment operator.
const Vector< Vector< RefCountedPtr< EBLevelGrid > > > & getMultigridLevelGrids(const phase::which_phase a_phase) const
Get the multigrid levels for a phase.
Definition CD_Realm.cpp:1910
Realm & operator=(const Realm &a_other)=delete
Disallowed copy assignment operator.
const Vector< int > & getRefinementRatios() const
Get refinement ratios.
Definition CD_Realm.cpp:1988
void defineMultigridLevels()
Define the multigrid levels of every phase, and their multifluid compositions.
Definition CD_Realm.cpp:464
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid()
Get MFLevelGrids.
Definition CD_Realm.cpp:2012
void defineLevelTiles() noexcept
Define the tiled space.
Definition CD_Realm.cpp:1840
int m_finestLevel
Finest AMR level.
Definition CD_Realm.H:679
const RefCountedPtr< EBStateRedistribution > & getStateRedistribution(const phase::which_phase a_phase)
Get the state redistribution.
Definition CD_Realm.cpp:2162
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:2192
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:2066
void regridOperators(const int a_lmin)
Regrid method for EBAMR operators.
Definition CD_Realm.cpp:196
void defineMasks(const int a_lmin)
Define masks.
Definition CD_Realm.cpp:229
Vector< RefCountedPtr< LevelTiles > > m_levelTiles
Level "tiles" – i.e. the grids viewed as constant-size boxes.
Definition CD_Realm.H:756
std::map< std::pair< std::string, int >, AMRMask > m_masks
Masks.
Definition CD_Realm.H:829
const AMRParticleGhostMask & getParticleGhostMask(const int a_width) const noexcept
Get the same-level particle ghost mask for a registered width.
Definition CD_Realm.cpp:2233
Vector< RefCountedPtr< MFLevelGrid > > m_mflgFiCo
Refined grids. Entry lvl+1 contains the refined version of grids on level lvl.
Definition CD_Realm.H:740
RefCountedPtr< PetscGrid > m_petscGrid
PETSc grid.
Definition CD_Realm.H:812
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGridCoFi(const phase::which_phase a_phase) const
Get coarsened fine EBLevelGrid for particular phase.
Definition CD_Realm.cpp:2048
void definePetscGrid() noexcept
Define the PETSc composite grid.
Definition CD_Realm.cpp:1855
EBAMRParticleMesh & getParticleMesh(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:2114
const Vector< Vector< RefCountedPtr< MFLevelGrid > > > & getMultigridMFLevelGridsCoFi() const
Get the multifluid coarsened grids between consecutive multigrid levels.
Definition CD_Realm.cpp:1934
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles() const noexcept
Get the tiled space.
Definition CD_Realm.cpp:2227
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:1423
const Vector< Real > & getDx() const
Get grid resolutions.
Definition CD_Realm.cpp:1994
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:778
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:790
PhaseRealm & getRealm(const phase::which_phase a_phase)
Get a particular realm.
Definition CD_Realm.cpp:1982
void setGrids(const Vector< DisjointBoxLayout > &a_grids, const int a_finestLevel)
Set grid method.
Definition CD_Realm.cpp:142
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
Index spaces.
Definition CD_Realm.H:761
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:2174
const RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase) const
Get EBIndexSpace for particular phase.
Definition CD_Realm.cpp:2030
const AMRMask & getMask(const std::string &a_mask, const int a_buffer) const
Get AMR mask.
Definition CD_Realm.cpp:2210
void defineCFIVS(const int a_lmin)
Define the coarse-fine interface.
Definition CD_Realm.cpp:1269
Realm()
Default constructor. Must subsequently call define.
Definition CD_Realm.cpp:36
EBAMRSurfaceDeposition & getSurfaceDeposition(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:2120
void defineInnerHaloMask(const int a_lmin)
Define inner particle halo mask.
Definition CD_Realm.cpp:829
Vector< DisjointBoxLayout > m_grids
AMR grids.
Definition CD_Realm.H:720
static const std::string Primal
Identifier for perimal realm.
Definition CD_Realm.H:44
void preRegrid()
Perform pre-regrid operations.
Definition CD_Realm.cpp:155
LevelTiles::LevelAndBox getLevelAndBox(const RealVect &a_pos) const noexcept
Find the (finest) grid box covering a physical position.
Definition CD_Realm.cpp:2295
RealVect m_probLo
Physical coordinates of lower-left corner in simulation domain.
Definition CD_Realm.H:705
const EBAMRFAB & getLevelset(const phase::which_phase a_phase) const
Get level-set function.
Definition CD_Realm.cpp:2168
int m_numGhost
Number of ghost cells.
Definition CD_Realm.H:700
~Realm()
Destructor.
void regridBase(const int a_lmin)
Regrid method for EBAMR base.
Definition CD_Realm.cpp:179
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:2102
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:994
std::map< int, AMRMask > m_particleGhostExposure
Particle boundary-exposure masks, keyed by ghost width. Per width: indexed by level,...
Definition CD_Realm.H:806
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:2096
Phase names namespace.
Definition CD_MultiFluidIndexSpace.H:28
which_phase
Enumeration of supported phases.
Definition CD_MultiFluidIndexSpace.H:38