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_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.
 
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 for particular phase.
 
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 EBAMRFABgetLevelset (const phase::which_phase a_phase) const
 Get level-set function.
 
const AMRMaskgetMask (const std::string a_mask, const int a_buffer) const
 Get AMR mask.
 
const AMRMaskgetValidCells () const
 Get all valid cells.
 
const Vector< RefCountedPtr< LevelTiles > > & getLevelTiles () const noexcept
 Get the tiled space.
 

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 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_blockingFactor
 Blocking factor.
 
int m_numGhost
 Number of ghost cells.
 
RealVect m_probLo
 Physical coordinates of lower-left corner in simulation domain.
 
Vector< Realm_dx
 Grid resolutions.
 
Vector< intm_refinementRatios
 Refinement ratios.
 
Vector< DisjointBoxLayoutm_grids
 AMR grids.
 
Vector< ProblemDomainm_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::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_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.

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_blockingFactorGrid 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.

◆ 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()

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

◆ 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

◆ getCoarseAverage()

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

Get data coarsening utility.

Parameters
[in]a_phasePhase

◆ 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

◆ getEBIndexSpace()

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

Get EBIndexSpace for particular phase.

Parameters
[in]a_phasePhase

◆ getEBISLayout()

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

Get EBISLayout for particular phase.

Parameters
[in]a_phasePhase

◆ getEBLevelGrid()

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

Get EBLevelGrid for particular phase.

Parameters
[in]a_phasePhase

◆ 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

◆ getFineInterp()

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

Get piecewise linear ghost cell interpolation utility.

Parameters
[in]a_phasePhase

◆ getFluxRegister()

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

Get flux register utility.

Parameters
[in]a_phasePhase

◆ getGhostCellInterpolator()

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

Get ghost cell interpolator.

Parameters
[in]a_phasePhase

◆ getGradientOp()

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

Get gradient operator.

Parameters
[in]a_phasePhase

◆ getGrids()

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

Get AMR grids.

Returns
m_grids

◆ getLevelset()

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

Get level-set function.

Parameters
[in]a_phasePhase

◆ getMask()

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

Get AMR mask.

Parameters
[in]a_phasePhase

◆ 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.

◆ 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.

◆ getMultigridInterpolator()

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

Get the multigrid interpolator.

Parameters
[in]a_phasePhase

◆ 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

◆ getParticleMesh()

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

Get the particle mesh operator.

Parameters
[in]a_phaseWhich phase

◆ getRealm()

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

Get a particular realm.

Parameters
[in]a_phasePhase

◆ getRedistributionOp()

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

Get the redistribution operators.

Parameters
[in]a_phasePhase (gas or solid)

◆ getRefinementRatios()

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

Get refinement ratios.

Returns
m_refinementRatios

◆ getSurfaceDeposition()

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

Get the particle mesh operator.

Parameters
[in]a_phaseWhich phase

◆ getVofIterator()

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

Get VoFIterators for particular phase.

Parameters
[in]a_phasePhase

◆ 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
[in]a_phasePhase where mask is registered
Returns
true if mask has been registered

◆ 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_phasePhase where mask is registered

◆ 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

◆ 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_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: