chombo-discharge
Loading...
Searching...
No Matches
CD_Realm.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2021 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_Realm_H
13#define CD_Realm_H
14
15// Our includes
16#include <CD_PhaseRealm.H>
19#include <CD_MFLevelGrid.H>
20#include <CD_LevelTiles.H>
21#include <CD_PetscGrid.H>
22#include <CD_NamespaceHeader.H>
23
28
32class Realm
33{
34public:
38 const static std::string Primal;
39
43 const static std::string primal;
44
48 Realm();
49
54 Realm(const Realm& a_other) = delete;
55
60 Realm(const Realm&& a_other) = delete;
61
66 Realm&
67 operator=(const Realm& a_other) = delete;
68
73 Realm&
74 operator=(const Realm&& a_other) = delete;
75
79 ~Realm();
80
102 void
105 const Vector<int>& a_refRat,
106 const Vector<Real>& a_dx,
107 const RealVect a_probLo,
108 const int a_finestLevel,
109 const int a_blockingFactor,
110 const int a_ebGhost,
111 const int a_numGhost,
112 const int a_lsfGhost,
113 const int a_redistRad,
114 const int a_mgInterpOrder,
115 const int a_mgInterpRadius,
116 const int a_mgInterpWeight,
119 const std::map<phase::which_phase, RefCountedPtr<BaseIF>> a_baseif,
121
128 void
130
134 void
135 preRegrid();
136
142 void
143 regridBase(const int a_lmin);
144
150 void
151 regridOperators(const int a_lmin);
152
159 void
160 registerOperator(const std::string a_operator, const phase::which_phase a_phase);
161
168 bool
169 queryOperator(const std::string a_operator, const phase::which_phase a_phase) const;
170
176 void
177 registerMask(const std::string a_mask, const int a_buffer);
178
185 bool
186 queryMask(const std::string a_mask, const int a_buffer) const;
187
192 const Vector<int>&
193 getRefinementRatios() const;
194
199 const Vector<Real>&
200 getDx() const;
201
207 getGrids() const;
208
213 getDomains() const;
214
220
228
236
242 getEBIndexSpace(const phase::which_phase a_phase) const;
243
248 const Vector<EBISLayout>&
249 getEBISLayout(const phase::which_phase a_phase) const;
250
256 getEBLevelGrid(const phase::which_phase a_phase) const;
257
263 getEBLevelGridCoFi(const phase::which_phase a_phase) const;
264
270 getVofIterator(const phase::which_phase a_phase) const;
271
277 getNonConservativeDivergence(const phase::which_phase a_phase) const;
278
284 getCellCentroidInterpolation(const phase::which_phase a_phase) const;
285
291 getEBCentroidInterpolation(const phase::which_phase a_phase) const;
292
298 getCoarseAverage(const phase::which_phase a_phase);
299
305 getMultigridInterpolator(const phase::which_phase a_phase);
306
312 getParticleMesh(const phase::which_phase a_phase);
313
319 getSurfaceDeposition(const phase::which_phase a_phase);
320
326 getGradientOp(const phase::which_phase a_phase) const;
327
333 getGhostCellInterpolator(const phase::which_phase a_phase);
334
340 getFineInterp(const phase::which_phase a_phase);
341
347 getFluxRegister(const phase::which_phase a_phase);
348
354 getRedistributionOp(const phase::which_phase a_phase);
355
360 const EBAMRFAB&
361 getLevelset(const phase::which_phase a_phase) const;
362
367 const AMRMask&
368 getMask(const std::string a_mask, const int a_buffer) const;
369
373 const AMRMask&
374 getValidCells() const;
375
381
382#ifdef CH_USE_PETSC
388#endif
389
390protected:
395
400
405
410
415
420
425
430
435
440
445
450
455
460
465
470
471#ifdef CH_USE_PETSC
476#endif
477
483
488
493
498 void
499 defineMFLevelGrid(const int a_lmin);
500
505 void
506 defineMasks(const int a_lmin);
507
513 void
514 defineOuterHaloMask(const int a_lmin);
515
526 void
532 const int a_buffer,
533 const int a_refRat);
534
542 void
543 defineInnerHaloMask(const int a_lmin);
544
548 void
549 defineOuterCFMask(const int a_lmin);
550
561 void
567 const int a_buffer,
568 const int a_refRat);
569
573 void
574 defineInnerCFMask(const int a_lmin);
575
580 void
581 defineCFIVS(const int a_lmin);
582
586 void
588
592 void
594
598 void
600
606 getRealm(const phase::which_phase a_phase);
607};
608
609#include <CD_NamespaceFooter.H>
610
611#endif
Declaration of a class for handling particle-mesh operations with AMR.
Declaration of LevelTiles.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Multi-fluid index space.
Declaration of core class for handling AMR-related operations (with embedded boundaries)
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:27
Type
Supported interpolation types.
Definition CD_CellCentroidInterpolation.H:43
Class for handling particle-mesh operations with AMR.
Definition CD_EBAMRParticleMesh.H:52
class for handling surface deposition of particles with EB and AMR.
Definition CD_EBAMRSurfaceDeposition.H:29
Type
Supported interpolation types.
Definition CD_EBCentroidInterpolation.H:43
Class that holds important things for doing AMR over a specific phase and processor distribution.
Definition CD_PhaseRealm.H:70
Class for holding multifluid Realms, which are the Realms that we actually use.
Definition CD_Realm.H:33
void registerMask(const std::string a_mask, const int a_buffer)
Register a mask.
Definition CD_Realm.cpp:1111
Vector< RefCountedPtr< EBReflux > > & getFluxRegister(const phase::which_phase a_phase)
Get flux register utility.
Definition CD_Realm.cpp:1280
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_blockingFactor, 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:44
void defineMFLevelGrid(const int a_lmin)
Define MFLevelGrid.
Definition CD_Realm.cpp:214
Vector< RefCountedPtr< EBCoarseToFineInterp > > & getFineInterp(const phase::which_phase a_phase)
Get piecewise linear ghost cell interpolation utility.
Definition CD_Realm.cpp:1274
AMRMask m_validCells
Mask which is true for all valid cells.
Definition CD_Realm.H:469
static const std::string primal
Identifier for perimal realm.
Definition CD_Realm.H:43
Realm(const Realm &a_other)=delete
Disallowed copy ctor.
bool m_isDefined
Realm defined or not.
Definition CD_Realm.H:394
void defineOuterHaloMask(const int a_lmin)
Define outer particle halo mask.
Definition CD_Realm.cpp:286
std::map< phase::which_phase, RefCountedPtr< BaseIF > > m_baseif
Implicit/signed distance functions on each phase.
Definition CD_Realm.H:487
Vector< ProblemDomain > m_domains
Domains.
Definition CD_Realm.H:439
Vector< int > m_refinementRatios
Refinement ratios.
Definition CD_Realm.H:429
Vector< RefCountedPtr< EBFluxRedistribution > > & getRedistributionOp(const phase::which_phase a_phase)
Get the redistribution operators.
Definition CD_Realm.cpp:1286
Realm(const Realm &&a_other)=delete
Disallowed move ctor.
const Vector< ProblemDomain > & getDomains() const
Get problem domains.
Definition CD_Realm.cpp:1166
const Vector< RefCountedPtr< EBNonConservativeDivergence > > & getNonConservativeDivergence(const phase::which_phase a_phase) const
Get objects for computing "non-conservative divergences".
Definition CD_Realm.cpp:1220
Vector< RefCountedPtr< MFLevelGrid > > m_mflgCoFi
Coarsened grids. Entry lvl contains the coarsened version of grids on level lvl+1.
Definition CD_Realm.H:449
void defineValidCells()
Define the valid cell region mask.
Definition CD_Realm.cpp:956
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridFiCo()
Get the refined grids.
Definition CD_Realm.cpp:1184
const Vector< EBISLayout > & getEBISLayout(const phase::which_phase a_phase) const
Get EBISLayout for particular phase.
Definition CD_Realm.cpp:1196
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGridCoFi()
Get the coarsened grids.
Definition CD_Realm.cpp:1178
Vector< RefCountedPtr< LayoutData< VoFIterator > > > & getVofIterator(const phase::which_phase a_phase) const
Get VoFIterators for particular phase.
Definition CD_Realm.cpp:1214
Vector< RefCountedPtr< EBMultigridInterpolator > > & getMultigridInterpolator(const phase::which_phase a_phase)
Get the multigrid interpolator.
Definition CD_Realm.cpp:1256
const Vector< RefCountedPtr< EBGradient > > & getGradientOp(const phase::which_phase a_phase) const
Get gradient operator.
Definition CD_Realm.cpp:1262
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:1100
const Vector< DisjointBoxLayout > & getGrids() const
Get AMR grids.
Definition CD_Realm.cpp:1160
int m_verbosity
Realm verbosity. Used for debugging.
Definition CD_Realm.H:399
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:811
Vector< RefCountedPtr< MFLevelGrid > > m_mflg
MFLevelGrids.
Definition CD_Realm.H:444
Vector< RefCountedPtr< EBCoarAve > > & getCoarseAverage(const phase::which_phase a_phase)
Get data coarsening utility.
Definition CD_Realm.cpp:1238
Vector< Real > m_dx
Grid resolutions.
Definition CD_Realm.H:424
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGrid(const phase::which_phase a_phase) const
Get EBLevelGrid for particular phase.
Definition CD_Realm.cpp:1202
std::map< phase::which_phase, RefCountedPtr< PhaseRealm > > m_realms
Phase realms.
Definition CD_Realm.H:482
Vector< RefCountedPtr< EBGhostCellInterpolator > > & getGhostCellInterpolator(const phase::which_phase a_phase)
Get ghost cell interpolator.
Definition CD_Realm.cpp:1268
const AMRMask & getValidCells() const
Get all valid cells.
Definition CD_Realm.cpp:1309
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:1148
Vector< RefCountedPtr< MFLevelGrid > > & getMFLevelGrid()
Get MFLevelGrids.
Definition CD_Realm.cpp:1172
void defineLevelTiles() noexcept
Define the tiled space.
Definition CD_Realm.cpp:1045
int m_finestLevel
Finest AMR level.
Definition CD_Realm.H:404
void registerOperator(const std::string a_operator, const phase::which_phase a_phase)
Register an AMR operator.
Definition CD_Realm.cpp:1089
void regridOperators(const int a_lmin)
Regrid method for EBAMR operators.
Definition CD_Realm.cpp:174
void defineMasks(const int a_lmin)
Define masks.
Definition CD_Realm.cpp:190
Vector< RefCountedPtr< LevelTiles > > m_levelTiles
Level "tiles" – i.e. the grids viewed as constant-size boxes.
Definition CD_Realm.H:459
std::map< std::pair< std::string, int >, AMRMask > m_masks
Masks.
Definition CD_Realm.H:492
int m_blockingFactor
Blocking factor.
Definition CD_Realm.H:409
Vector< RefCountedPtr< MFLevelGrid > > m_mflgFiCo
Refined grids. Entry lvl+1 contains the refined version of grids on level lvl.
Definition CD_Realm.H:454
bool queryMask(const std::string a_mask, const int a_buffer) const
Query if a mask has been registered.
Definition CD_Realm.cpp:1122
const Vector< RefCountedPtr< EBLevelGrid > > & getEBLevelGridCoFi(const phase::which_phase a_phase) const
Get coarsened fine EBLevelGrid for particular phase.
Definition CD_Realm.cpp:1208
void definePetscGrid() noexcept
Define the PETSc composite grid.
Definition CD_Realm.cpp:1060
EBAMRParticleMesh & getParticleMesh(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:1244
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles() const noexcept
Get the tiled space.
Definition CD_Realm.cpp:1315
const Vector< Real > & getDx() const
Get grid resolutions.
Definition CD_Realm.cpp:1154
PhaseRealm & getRealm(const phase::which_phase a_phase)
Get a particular realm.
Definition CD_Realm.cpp:1142
void setGrids(const Vector< DisjointBoxLayout > &a_grids, const int a_finestLevel)
Set grid method.
Definition CD_Realm.cpp:122
RefCountedPtr< MultiFluidIndexSpace > m_multifluidIndexSpace
Index spaces.
Definition CD_Realm.H:464
const AMRMask & getMask(const std::string a_mask, const int a_buffer) const
Get AMR mask.
Definition CD_Realm.cpp:1298
const RefCountedPtr< EBIndexSpace > & getEBIndexSpace(const phase::which_phase a_phase) const
Get EBIndexSpace for particular phase.
Definition CD_Realm.cpp:1190
void defineCFIVS(const int a_lmin)
Define the coarse-fine interface.
Definition CD_Realm.cpp:891
Realm()
Default constructor. Must subsequently call define.
Definition CD_Realm.cpp:26
EBAMRSurfaceDeposition & getSurfaceDeposition(const phase::which_phase a_phase)
Get the particle mesh operator.
Definition CD_Realm.cpp:1250
void defineInnerHaloMask(const int a_lmin)
Define inner particle halo mask.
Definition CD_Realm.cpp:472
Vector< DisjointBoxLayout > m_grids
AMR grids.
Definition CD_Realm.H:434
static const std::string Primal
Identifier for perimal realm.
Definition CD_Realm.H:38
void preRegrid()
Perform pre-regrid operations.
Definition CD_Realm.cpp:135
RealVect m_probLo
Physical coordinates of lower-left corner in simulation domain.
Definition CD_Realm.H:419
const EBAMRFAB & getLevelset(const phase::which_phase a_phase) const
Get level-set function.
Definition CD_Realm.cpp:1292
int m_numGhost
Number of ghost cells.
Definition CD_Realm.H:414
~Realm()
Destructor.
Definition CD_Realm.cpp:40
void regridBase(const int a_lmin)
Regrid method for EBAMR base.
Definition CD_Realm.cpp:157
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:1232
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:625
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:1226
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
TracerParticleSolver()
Default constructor.
Definition CD_TracerParticleSolverImplem.H:25
phase names
Definition CD_MultiFluidIndexSpace.H:27