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

Class for interpolating data to fine grids. Can use constant interpolation or include limiters. More...

#include <CD_EBCoarseToFineInterp.H>

Public Types

enum  Type {
  PWC , ConservativePWC , ConservativeMinMod , ConservativeMonotonizedCentral ,
  ConservativeSuperbee
}
 Type of interpolation methods supported. PWC = Piecewise constant, ignoring the embedded boundary. This is not conservative. ConservativePWC = Piecewise constant, including the EB volume/area fractions boundary. ConservativeMinMod = Min-mod slope for interpolation. ConservativeMonotonizedCentral = Monotonized central slope for interpolation.
 

Public Member Functions

 EBCoarseToFineInterp () noexcept
 Default constructor. Must subsequently call the define method.
 
 EBCoarseToFineInterp (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const EBLevelGrid &a_eblgCoar, const int &a_refRat) noexcept
 Constructor. Constructs a valid object which can be used for regridding. More...
 
 EBCoarseToFineInterp (const EBCoarseToFineInterp &)=delete
 Disallowed copy constructor.
 
 EBCoarseToFineInterp (const EBCoarseToFineInterp &&)=delete
 Disallowed move constructor.
 
virtual ~EBCoarseToFineInterp () noexcept
 Destructor.
 
EBCoarseToFineInterpoperator= (const EBCoarseToFineInterp &)=delete
 Disallowed copy operator.
 
EBCoarseToFineInterpoperator= (const EBCoarseToFineInterp &&)=delete
 Disallowed move operator.
 
virtual void define (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const EBLevelGrid &a_eblgCoar, const int &a_refRat) noexcept
 Define operation. Puts object in usable state. More...
 
virtual void interpolate (LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_coarData, const Interval &a_variables, const EBCoarseToFineInterp::Type &a_interpType) const noexcept
 Interpolate to the fine grid using the specified method. More...
 
virtual void interpolate (LevelData< BaseIVFAB< Real >> &a_fineData, const LevelData< BaseIVFAB< Real >> &a_coarData, const Interval &a_variables, const EBCoarseToFineInterp::Type &a_interpType) const noexcept
 Interpolate to the fine grid using the specified method. More...
 

Protected Types

enum class  SlopeLimiter { MinMod , MonotonizedCentral , Superbee }
 Supported slope limiters for conservative interpolation with slopes.
 

Protected Member Functions

virtual void defineWeights () noexcept
 Define weights for cut-cell conservative regridding.
 
virtual void interpolatePWC (EBCellFAB &a_fineData, const EBCellFAB &a_coarData, const DataIndex &a_dit, const int &a_fineVar, const int &a_coarVar) const noexcept
 Piecewise constant interpolation of an EBCellFAB. This ignores the volume fraction. This sets the fine-grid data to the coarse-grid data, so it is not conservative. More...
 
virtual void interpolateConservativePWC (EBCellFAB &a_fineData, const EBCellFAB &a_coarData, const DataIndex &a_dit, const int &a_fineVar, const int &a_coarVar) const noexcept
 Piecewise constant interpolation of an EBCellFAB. Does not use slopes. More...
 
virtual void interpolateConservativeSlope (EBCellFAB &a_fineData, const EBCellFAB &a_coarData, const DataIndex &a_dit, const int &a_fineVar, const int &a_coarVar, const SlopeLimiter &a_limiter) const noexcept
 Sloped interpolation of an EBCellFAB. Uses specified input slope. More...
 
virtual void interpolatePWC (BaseIVFAB< Real > &a_fineData, const BaseIVFAB< Real > &a_coarData, const DataIndex &a_dit, const int &a_fineVar, const int &a_coarVar) const noexcept
 Piecewise constant interpolation of an EB-data. This ignores the area fraction. This sets the fine-grid data to the coarse-grid data. More...
 
virtual void interpolateConservativePWC (BaseIVFAB< Real > &a_fineData, const BaseIVFAB< Real > &a_coarData, const DataIndex &a_dit, const int &a_fineVar, const int &a_coarVar) const noexcept
 Piecewise constant interpolation of an EB-data. This includes the area fraction and is therefore conservative. More...
 
virtual void checkConservation (const EBCellFAB &a_fineData, const EBCellFAB &a_coarData, const DataIndex &a_dit, const int a_fineVar, const int a_coarVar) const noexcept
 Check if the interpolation conserved. This will print an error message if it didn't. More...
 
virtual void checkConservation (const BaseIVFAB< Real > &a_fineData, const BaseIVFAB< Real > &a_coarData, const DataIndex &a_dit, const int a_fineVar, const int a_coarVar) const noexcept
 Check if the interpolation conserved. This will print an error message if it didn't. More...
 

Protected Attributes

bool m_isDefined
 Is defined or not.
 
int m_refRat
 Refinement factor.
 
Copier m_ebCopier
 Copier for making copying from m_eblg to m_eblgCoFi go faster.
 
std::map< IntVect, Copier > m_cellCopiers
 Map of Copiers that we need for going from valid+ghost -> valid+ghost.
 
EBLevelGrid m_eblgFine
 Fine grid.
 
EBLevelGrid m_eblgCoar
 Coarse grid.
 
EBLevelGrid m_eblgCoFi
 Coarsened fine grid (i.e., has same ProblemDomain as m_eblgCoar);.
 
LevelData< BaseIVFAB< Real > > m_volumeWeights
 Weights in cut-cells when regridding conservatively. More...
 
LevelData< BaseIVFAB< Real > > m_areaWeights
 Weights in cut-cells when regridding conservatively. More...
 
LevelData< BaseIVFAB< Real > > m_irregCoFi
 Data holder for holding data on the coarsened fine grids. More...
 
LayoutData< VoFIterator > m_fineVoFs
 Iterator for valid cut-cells. More...
 
LayoutData< VoFIterator > m_coarVoFs
 Iterator for coarse grid cells.
 

Detailed Description

Class for interpolating data to fine grids. Can use constant interpolation or include limiters.

This class should be used through the interpolate methods. The methods will switch between various supported interpolation methods for the data types. For EBCellFAB-type data we support PWC, ConservativePWC, ConservativeMinMod, ConservativeMonotonizedCentral, ConservativeSuperbee For BASEIVFAB-type data we support PWC and ConservativePWC

Constructor & Destructor Documentation

◆ EBCoarseToFineInterp()

EBCoarseToFineInterp::EBCoarseToFineInterp ( const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const EBLevelGrid &  a_eblgCoar,
const int &  a_refRat 
)
noexcept

Constructor. Constructs a valid object which can be used for regridding.

Parameters
[in]a_eblgFineThe fine grid.
[in]a_eblgCoFiCoarsened fine grid.
[in]a_eblgCoarThe coarse grid.
[in]a_refRatRefinement ratio between fine and coarse.
[in]a_nCompNumber of components.
[in]a_ebisPtrEB index space.

Member Function Documentation

◆ checkConservation() [1/2]

void EBCoarseToFineInterp::checkConservation ( const BaseIVFAB< Real > &  a_fineData,
const BaseIVFAB< Real > &  a_coarData,
const DataIndex &  a_dit,
const int  a_fineVar,
const int  a_coarVar 
) const
protectedvirtualnoexcept

Check if the interpolation conserved. This will print an error message if it didn't.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

◆ checkConservation() [2/2]

void EBCoarseToFineInterp::checkConservation ( const EBCellFAB &  a_fineData,
const EBCellFAB &  a_coarData,
const DataIndex &  a_dit,
const int  a_fineVar,
const int  a_coarVar 
) const
protectedvirtualnoexcept

Check if the interpolation conserved. This will print an error message if it didn't.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

◆ define()

void EBCoarseToFineInterp::define ( const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const EBLevelGrid &  a_eblgCoar,
const int &  a_refRat 
)
virtualnoexcept

Define operation. Puts object in usable state.

Parameters
[in]a_eblgFineThe fine grid.
[in]a_eblgCoFiCoarsened fine grid.
[in]a_eblgCoarThe coarse grid.
[in]a_refRatRefinement ratio between fine and coarse.
[in]a_nCompNumber of components.
[in]a_ebisPtrEB index space.

◆ interpolate() [1/2]

void EBCoarseToFineInterp::interpolate ( LevelData< BaseIVFAB< Real >> &  a_fineData,
const LevelData< BaseIVFAB< Real >> &  a_coarData,
const Interval &  a_variables,
const EBCoarseToFineInterp::Type a_interpType 
) const
virtualnoexcept

Interpolate to the fine grid using the specified method.

Parameters
[out]a_fineDataFine-grid data
[in]a_coarDataCoarse data
[in]a_variablesVariables to interpolate to the fine grid.
[in]a_interpTypeInterpolation type

◆ interpolate() [2/2]

void EBCoarseToFineInterp::interpolate ( LevelData< EBCellFAB > &  a_fineData,
const LevelData< EBCellFAB > &  a_coarData,
const Interval &  a_variables,
const EBCoarseToFineInterp::Type a_interpType 
) const
virtualnoexcept

Interpolate to the fine grid using the specified method.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_variablesVariables to interpolate to the fine grid.
[in]a_interpTypeInterpolation type

◆ interpolateConservativePWC() [1/2]

void EBCoarseToFineInterp::interpolateConservativePWC ( BaseIVFAB< Real > &  a_fineData,
const BaseIVFAB< Real > &  a_coarData,
const DataIndex &  a_dit,
const int &  a_fineVar,
const int &  a_coarVar 
) const
protectedvirtualnoexcept

Piecewise constant interpolation of an EB-data. This includes the area fraction and is therefore conservative.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

◆ interpolateConservativePWC() [2/2]

void EBCoarseToFineInterp::interpolateConservativePWC ( EBCellFAB &  a_fineData,
const EBCellFAB &  a_coarData,
const DataIndex &  a_dit,
const int &  a_fineVar,
const int &  a_coarVar 
) const
protectedvirtualnoexcept

Piecewise constant interpolation of an EBCellFAB. Does not use slopes.

Parameters
[out]a_fineDataPiecewise constant interpolation of the coarse data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

◆ interpolateConservativeSlope()

void EBCoarseToFineInterp::interpolateConservativeSlope ( EBCellFAB &  a_fineData,
const EBCellFAB &  a_coarData,
const DataIndex &  a_dit,
const int &  a_fineVar,
const int &  a_coarVar,
const SlopeLimiter a_limiter 
) const
protectedvirtualnoexcept

Sloped interpolation of an EBCellFAB. Uses specified input slope.

Parameters
[out]a_fineDataPiecewise constant interpolation of the coarse data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable
[in]a_limiterWhich slope limiter to use.

◆ interpolatePWC() [1/2]

void EBCoarseToFineInterp::interpolatePWC ( BaseIVFAB< Real > &  a_fineData,
const BaseIVFAB< Real > &  a_coarData,
const DataIndex &  a_dit,
const int &  a_fineVar,
const int &  a_coarVar 
) const
protectedvirtualnoexcept

Piecewise constant interpolation of an EB-data. This ignores the area fraction. This sets the fine-grid data to the coarse-grid data.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

◆ interpolatePWC() [2/2]

void EBCoarseToFineInterp::interpolatePWC ( EBCellFAB &  a_fineData,
const EBCellFAB &  a_coarData,
const DataIndex &  a_dit,
const int &  a_fineVar,
const int &  a_coarVar 
) const
protectedvirtualnoexcept

Piecewise constant interpolation of an EBCellFAB. This ignores the volume fraction. This sets the fine-grid data to the coarse-grid data, so it is not conservative.

Parameters
[out]a_fineDataFine-grid data.
[in]a_coarDataCoarse data
[in]a_ditGrid index.
[in]a_fineVarFine-grid variable
[in]a_coarVarCoarse-grid variable

Member Data Documentation

◆ m_areaWeights

LevelData<BaseIVFAB<Real> > EBCoarseToFineInterp::m_areaWeights
protected

Weights in cut-cells when regridding conservatively.

Defined over the fine layout.

◆ m_fineVoFs

LayoutData<VoFIterator> EBCoarseToFineInterp::m_fineVoFs
mutableprotected

Iterator for valid cut-cells.

This iterator runs over the valid fine cells.

◆ m_irregCoFi

LevelData<BaseIVFAB<Real> > EBCoarseToFineInterp::m_irregCoFi
mutableprotected

Data holder for holding data on the coarsened fine grids.

Note
I'm letting this live as a permanent buffer, simply because its memory footprint is so small.

◆ m_volumeWeights

LevelData<BaseIVFAB<Real> > EBCoarseToFineInterp::m_volumeWeights
protected

Weights in cut-cells when regridding conservatively.

Defined over the fine layout.


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