chombo-discharge
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EBGhostCellInterpolator Class Reference

Class which can interpolate ghost cells across the coarse-fine interface. To select an interpolation method, use the type argument. More...

#include <CD_EBGhostCellInterpolator.H>

Public Types

enum  Type { PWC , MinMod , MonotonizedCentral , Superbee }
 Type of interpolation slopes supported.
 

Public Member Functions

 EBGhostCellInterpolator () noexcept
 Weak constructor. Need to call define afterwards.
 
 EBGhostCellInterpolator (const EBGhostCellInterpolator &a_other)=delete
 Disallowed copy constructor.
 
 EBGhostCellInterpolator (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const EBLevelGrid &a_eblgCoar, const IntVect &a_ghostVector, const int a_refRat, const int a_ghostCF) noexcept
 Full constructor. Calls the define function. More...
 
virtual ~EBGhostCellInterpolator () noexcept
 Destructor (does nothing)
 
virtual void define (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const EBLevelGrid &a_eblgCoar, const IntVect &a_ghostVector, const int a_refRat, const int a_ghostCF) noexcept
 Define method. Puts object in usable state. More...
 
virtual void interpolate (LevelData< EBCellFAB > &a_phiFine, const LevelData< EBCellFAB > &a_phiCoar, const Interval a_variables, const Type a_interpType) const noexcept
 Do inhomogeneous interpolation. More...
 

Protected Member Functions

virtual void defineGhostRegions () noexcept
 Define ghost regions to be interpolated.
 
virtual void defineBuffers () noexcept
 Define buffers.
 
virtual void interpolateRegular (FArrayBox &a_phiFine, const FArrayBox &a_phiCoar, const DataIndex &a_dit, const int a_fineVar, const int a_coarVar, const Type a_interpType) const noexcept
 Regular interpolation, as if the EB was not there. More...
 
virtual void interpolateIrregular (EBCellFAB &a_phiFine, const EBCellFAB &a_phiCoar, const DataIndex &a_dit, const int a_fineVar, const int a_coarVar, const Type a_interpType) const noexcept
 Ghost cell interpolation near the EB, correcting slopes that broke in interpolateRegular. More...
 
Real minmod (const Real &dwl, const Real &dwr) const noexcept
 minmod slope function. More...
 
Real superbee (const Real &dwl, const Real &dwr) const noexcept
 Superbee slope limiter. More...
 
Real monotonizedCentral (const Real &dwl, const Real &dwr) const noexcept
 Monotonized central difference slope limiter. More...
 

Protected Attributes

bool m_isDefined
 Is defined or not.
 
EBLevelGrid m_eblgFine
 Fine grids.
 
EBLevelGrid m_eblgCoar
 Coarse grids.
 
EBLevelGrid m_eblgCoFi
 Coarsened fine grids.
 
IntVect m_ghostVector
 Minimum number of ghost cells in input data.
 
int m_refRat
 Refinement factor between fine and coarse level.
 
int m_ghostCF
 Number of ghost cells to fill across coarse-fine interface. More...
 
LayoutData< std::map< std::pair< int, Side::LoHiSide >, Box > > m_regularGhostRegions
 Regular ghost regions to be interpolated.
 
Copier m_copier
 Copier for making copying from m_eblgCoar to m_grownCoarData go faster.
 
LayoutData< BaseIVFAB< VolIndex > > m_coarsenedFineGhosts
 List of coarse-grid cells that appear through coarsening a fine-grid ghost cell. More...
 
LayoutData< VoFIterator > m_fineIrregCells
 Fine-grid ghost cells on the coarse-fine interface that overlap an irregular coarse cell.
 
LayoutData< VoFIterator > m_coarIrregCells
 Coarse-grid cells on the caorse-side of the interface that are irregular cells.
 
LayoutData< BaseIVFAB< Real > > m_coarIrregSlopes
 Buffer data defined on the coarsened fine grids (over m_coarIrregCells). Used for holding slopes in the coarse-grid cut-cells.
 

Detailed Description

Class which can interpolate ghost cells across the coarse-fine interface. To select an interpolation method, use the type argument.

This class works by computing slopes on the coarse grid. We then interpolate within the coarse-grid cell to the fine-grid ghost cell, using the computed slopes. Note that all fine-grid ghost cells are interpolated from the coarse grid. Thus, this interpolator is useless for multigrid.

Constructor & Destructor Documentation

◆ EBGhostCellInterpolator()

EBGhostCellInterpolator::EBGhostCellInterpolator ( const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const EBLevelGrid &  a_eblgCoar,
const IntVect &  a_ghostVector,
const int  a_refRat,
const int  a_ghostCF 
)
noexcept

Full constructor. Calls the define function.

Parameters
[in]a_eblgFineFine grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_eblgCoarCoarse grids
[in]a_dataLocationInterpration of data centering. Either on the cell center or the cell centroid.
[in]a_ghostVector(Minimum) number of ghost cells in input/output data.
[in]a_refRatRefinement ratio between coarse and fine grids.
[in]a_ghostCFWidth of the ghost region to be filled. Only relevant near the EBCF.

Member Function Documentation

◆ define()

void EBGhostCellInterpolator::define ( const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const EBLevelGrid &  a_eblgCoar,
const IntVect &  a_ghostVector,
const int  a_refRat,
const int  a_ghostCF 
)
virtualnoexcept

Define method. Puts object in usable state.

Parameters
[in]a_eblgFineFine grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_eblgCoarCoarse grids
[in]a_dataLocationInterpration of data centering. Either on the cell center or the cell centroid.
[in]a_ghostVector(Minimum) number of ghost cells in input/output data.
[in]a_refRatRefinement ratio between coarse and fine grids.
[in]a_ghostCFWidth of the ghost region to be filled. Only relevant near the EBCF.

◆ interpolate()

void EBGhostCellInterpolator::interpolate ( LevelData< EBCellFAB > &  a_phiFine,
const LevelData< EBCellFAB > &  a_phiCoar,
const Interval  a_variables,
const Type  a_interpType 
) const
virtualnoexcept

Do inhomogeneous interpolation.

Parameters
[in,out]a_phiFineFine phi
[in]a_phiCoarCoarse phi
[in]a_variablesVariables to interpolate
[in]a_typeInterpolation type

◆ interpolateIrregular()

void EBGhostCellInterpolator::interpolateIrregular ( EBCellFAB &  a_phiFine,
const EBCellFAB &  a_phiCoar,
const DataIndex &  a_dit,
const int  a_fineVar,
const int  a_coarVar,
const Type  a_interpType 
) const
protectedvirtualnoexcept

Ghost cell interpolation near the EB, correcting slopes that broke in interpolateRegular.

Parameters
[in]a_phiFineFine-grid data
[in]a_phiCoarCoarse-grid data
[in]a_ditGrid index on the fine grid
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable
[in]a_interTypeSlope type

◆ interpolateRegular()

void EBGhostCellInterpolator::interpolateRegular ( FArrayBox &  a_phiFine,
const FArrayBox &  a_phiCoar,
const DataIndex &  a_dit,
const int  a_fineVar,
const int  a_coarVar,
const Type  a_interpType 
) const
protectedvirtualnoexcept

Regular interpolation, as if the EB was not there.

Parameters
[in]a_phiFineFine-grid data
[in]a_phiCoarCoarse-grid data
[in]a_ditGrid index on the fine grid
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable
[in]a_interTypeSlope type

◆ minmod()

Real EBGhostCellInterpolator::minmod ( const Real &  dwl,
const Real &  dwr 
) const
inlineprotectednoexcept

minmod slope function.

Parameters
[in]dwlLeft slope
[in]dwrRight slope

◆ monotonizedCentral()

Real EBGhostCellInterpolator::monotonizedCentral ( const Real &  dwl,
const Real &  dwr 
) const
inlineprotectednoexcept

Monotonized central difference slope limiter.

Parameters
[in]dwlLeft slope
[in]dwrRight slope

◆ superbee()

Real EBGhostCellInterpolator::superbee ( const Real &  dwl,
const Real &  dwr 
) const
inlineprotectednoexcept

Superbee slope limiter.

Parameters
[in]dwlLeft slope
[in]dwrRight slope

Member Data Documentation

◆ m_coarsenedFineGhosts

LayoutData<BaseIVFAB<VolIndex> > EBGhostCellInterpolator::m_coarsenedFineGhosts
protected

List of coarse-grid cells that appear through coarsening a fine-grid ghost cell.

This is used to accelerate interpolation fine-grid cut-cells that are also ghost cells. Doing this to avoid in-place coarsening of the fine grid ghost cell.

◆ m_ghostCF

int EBGhostCellInterpolator::m_ghostCF
protected

Number of ghost cells to fill across coarse-fine interface.

Note
Only applies the the cut-cells.

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