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

Class which replaces data at coarse level of refinement with average at fine level of refinement. More...

#include <CD_EBCoarAve.H>

Public Types

enum class  Type { Arithmetic , Conservative , Harmonic }
 Type of coarsening supported.
 

Public Member Functions

 EBCoarAve () noexcept
 Default constructor. Must call define afterwards.
 
 EBCoarAve (const EBCoarAve &a_other)=delete
 Copy constructor not allowed.
 
 EBCoarAve (const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislFine, const EBISLayout &a_ebislCoar, const ProblemDomain &a_domainCoar, const int &a_refRat, const EBIndexSpace *a_ebisPtr) noexcept
 Defining constructor. More...
 
 EBCoarAve (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgCoFi, const int &a_refRat) noexcept
 Defining constructor. Calls the define function. More...
 
virtual ~EBCoarAve () noexcept
 Destructor (does nothing)
 
virtual void define (const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgCoFi, const int &a_refRat) noexcept
 Define function – puts operator in usable state. More...
 
virtual void operator= (const EBCoarAve &fabin)=delete
 Assignement not allowed.
 
virtual void averageData (LevelData< EBCellFAB > &a_coarData, const LevelData< EBCellFAB > &a_fineData, const Interval &a_variables, const Average &a_average) const noexcept
 Do an average of cell data. More...
 
virtual void averageData (LevelData< EBFluxFAB > &a_coarData, const LevelData< EBFluxFAB > &a_fineData, const Interval &a_variables, const Average &a_average) const noexcept
 Do an average of face data. More...
 
virtual void averageData (LevelData< BaseIVFAB< Real >> &a_coarData, const LevelData< BaseIVFAB< Real >> &a_fineData, const Interval &a_variables, const Average &a_average) const noexcept
 Do an average of EB data. More...
 

Protected Member Functions

virtual void defineCellStencils () noexcept
 Define stencils for the various coarsening functions of cell data.
 
virtual void defineFaceStencils () noexcept
 Define stencils for the various coarsening functions of face data.
 
virtual void defineEBStencils () noexcept
 Define stencils for the various coarsening functions of EB data.
 
virtual void defineBuffers () noexcept
 Define buffer storage.
 
virtual void arithmeticAverage (EBCellFAB &a_coarData, const EBCellFAB &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Do an arithmetic average of cell-centered data when coarsening. More...
 
virtual void harmonicAverage (EBCellFAB &a_coarData, const EBCellFAB &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Do a harmonic average of cell-centered data when coarsening. More...
 
virtual void conservativeAverage (EBCellFAB &a_coarData, const EBCellFAB &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Do a conservative average of cell-centered data when coarsening. More...
 
virtual void arithmeticAverage (EBFaceFAB &a_coarData, const EBFaceFAB &a_fineData, const DataIndex &a_datInd, const int &a_fineVar, const int &a_coarVar, const int &a_dir) const noexcept
 Do an arithmetic average of face-centered data when coarsening. More...
 
virtual void harmonicAverage (EBFaceFAB &a_coarData, const EBFaceFAB &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar, const int &a_dir) const noexcept
 Do a harmonic average of face-centered data when coarsening. More...
 
virtual void conservativeAverage (EBFaceFAB &a_coarData, const EBFaceFAB &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar, const int &a_dir) const noexcept
 Do a conservative average of face-centered data when coarsening. More...
 
virtual void arithmeticAverage (BaseIVFAB< Real > &a_coarData, const BaseIVFAB< Real > &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Arithmetic average data defined on irregular cells. More...
 
virtual void harmonicAverage (BaseIVFAB< Real > &a_coarData, const BaseIVFAB< Real > &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Harmonic average data defined on irregular cells. More...
 
virtual void conservativeAverage (BaseIVFAB< Real > &a_coarData, const BaseIVFAB< Real > &a_fineData, const DataIndex &a_datInd, const int &a_coarVar, const int &a_fineVar) const noexcept
 Conservatively average data defined on irregular cells. More...
 

Protected Attributes

bool m_isDefined
 Defined or not.
 
int m_refRat
 Refinement ratio.
 
EBLevelGrid m_eblgFine
 Fine grids.
 
EBLevelGrid m_eblgCoar
 Coarse grids.
 
EBLevelGrid m_eblgCoFi
 Coarsened fine grids.
 
std::map< IntVect, Copier > m_cellCopiers
 Pre-built copier for copying from m_eblgCoFi to m_eblgCoar.
 
std::map< IntVect, Copier > m_faceCopiers
 Pre-built copier for copying from m_eblgCoFi to m_eblgCoar.
 
std::map< IntVect, Copier > m_ebCopiers
 Pre-built copier for copying from m_eblgCoFi to m_eblgCoar.
 
LayoutData< IntVectSet > m_irregSetsCoFi
 Irregular cells on the coarsened fine layout.
 
LayoutData< VoFIterator > m_irregCellsCoFi
 Irregular cells on the coarsened fine layout.
 
LayoutData< std::map< int, FaceIterator > > m_irregFacesCoFi
 Irregular faces on the coarsened fine layout.
 
LayoutData< BaseIVFAB< VoFStencil > > m_cellArithmeticStencils
 Stencils for arithmetic coarsening of volume data.
 
LayoutData< BaseIVFAB< VoFStencil > > m_cellHarmonicStencils
 Stencils for harmonic coarsening of volume data. More...
 
LayoutData< BaseIVFAB< VoFStencil > > m_cellConservativeStencils
 Stencils for conservative coarsening of volume data.
 
LayoutData< std::map< int, BaseIFFAB< FaceStencil > > > m_faceArithmeticStencils
 Stencils for arithmetic coarsening of face data.
 
LayoutData< std::map< int, BaseIFFAB< FaceStencil > > > m_faceHarmonicStencils
 Stencils for harmonic coarsening of face data.
 
LayoutData< std::map< int, BaseIFFAB< FaceStencil > > > m_faceConservativeStencils
 Stencils for conservative coarsening of face data.
 
LayoutData< BaseIVFAB< VoFStencil > > m_ebArithmeticStencils
 Stencils for arithmetic coarsening of EB data.
 
LayoutData< BaseIVFAB< VoFStencil > > m_ebHarmonicStencils
 Stencils for harmonic coarsening of EB data.
 
LayoutData< BaseIVFAB< VoFStencil > > m_ebConservativeStencils
 Stencils for conservative coarsening of EB data.
 

Detailed Description

Class which replaces data at coarse level of refinement with average at fine level of refinement.

When defining this class, use the EBLevelGrid-based constructors if the coarsened grids are available.

Constructor & Destructor Documentation

◆ EBCoarAve() [1/2]

EBCoarAve::EBCoarAve ( const DisjointBoxLayout &  a_dblFine,
const DisjointBoxLayout &  a_dblCoar,
const EBISLayout &  a_ebislFine,
const EBISLayout &  a_ebislCoar,
const ProblemDomain &  a_domainCoar,
const int &  a_refRat,
const EBIndexSpace *  a_ebisPtr 
)
noexcept

Defining constructor.

This version creates it's own coarsened grids

Parameters
[in]a_dblFineFine grids
[in]a_dblCoarCoarse grids
[in]a_ebislFineFine EBISL
[in]a_ebislCoarCoarse EBISL
[in]a_domainCoarCoarse domain
[in]a_refRatRefinement ratio
[in]a_ebisPtrEBIS pointer.

◆ EBCoarAve() [2/2]

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

Defining constructor. Calls the define function.

Parameters
[in]a_eblgFineFine grids
[in]a_eblgCoarCoarse grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_refRatRefinement ratio between coarse and level

Member Function Documentation

◆ arithmeticAverage() [1/3]

void EBCoarAve::arithmeticAverage ( BaseIVFAB< Real > &  a_coarData,
const BaseIVFAB< Real > &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Arithmetic average data defined on irregular cells.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_finevarFine Variable

◆ arithmeticAverage() [2/3]

void EBCoarAve::arithmeticAverage ( EBCellFAB &  a_coarData,
const EBCellFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Do an arithmetic average of cell-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variables
[in]a_fineVarFine variable

◆ arithmeticAverage() [3/3]

void EBCoarAve::arithmeticAverage ( EBFaceFAB &  a_coarData,
const EBFaceFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_fineVar,
const int &  a_coarVar,
const int &  a_dir 
) const
protectedvirtualnoexcept

Do an arithmetic average of face-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_fineVarFine variable
[in]a_dirFace direction

◆ averageData() [1/3]

void EBCoarAve::averageData ( LevelData< BaseIVFAB< Real >> &  a_coarData,
const LevelData< BaseIVFAB< Real >> &  a_fineData,
const Interval &  a_variables,
const Average a_average 
) const
virtualnoexcept

Do an average of EB data.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_variablesVariables to coarsen
[in]a_averageAveraging method

◆ averageData() [2/3]

void EBCoarAve::averageData ( LevelData< EBCellFAB > &  a_coarData,
const LevelData< EBCellFAB > &  a_fineData,
const Interval &  a_variables,
const Average a_average 
) const
virtualnoexcept

Do an average of cell data.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_variablesVariables to coarsen
[in]a_averageAveraging method

◆ averageData() [3/3]

void EBCoarAve::averageData ( LevelData< EBFluxFAB > &  a_coarData,
const LevelData< EBFluxFAB > &  a_fineData,
const Interval &  a_variables,
const Average a_average 
) const
virtualnoexcept

Do an average of face data.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_variablesVariables to coarsen
[in]a_averageAveraging method

◆ conservativeAverage() [1/3]

void EBCoarAve::conservativeAverage ( BaseIVFAB< Real > &  a_coarData,
const BaseIVFAB< Real > &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Conservatively average data defined on irregular cells.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_finevarFine Variable

◆ conservativeAverage() [2/3]

void EBCoarAve::conservativeAverage ( EBCellFAB &  a_coarData,
const EBCellFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Do a conservative average of cell-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variables
[in]a_fineVarFine variable

◆ conservativeAverage() [3/3]

void EBCoarAve::conservativeAverage ( EBFaceFAB &  a_coarData,
const EBFaceFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar,
const int &  a_dir 
) const
protectedvirtualnoexcept

Do a conservative average of face-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_fineVarFine variable
[in]a_dirFace direction

◆ define()

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

Define function – puts operator in usable state.

Parameters
[in]a_eblgFineFine grids
[in]a_eblgCoarCoarse grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_refRatRefinement ratio between coarse and level

◆ harmonicAverage() [1/3]

void EBCoarAve::harmonicAverage ( BaseIVFAB< Real > &  a_coarData,
const BaseIVFAB< Real > &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Harmonic average data defined on irregular cells.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_finevarFine Variable

◆ harmonicAverage() [2/3]

void EBCoarAve::harmonicAverage ( EBCellFAB &  a_coarData,
const EBCellFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar 
) const
protectedvirtualnoexcept

Do a harmonic average of cell-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variables
[in]a_fineVarFine variable

◆ harmonicAverage() [3/3]

void EBCoarAve::harmonicAverage ( EBFaceFAB &  a_coarData,
const EBFaceFAB &  a_fineData,
const DataIndex &  a_datInd,
const int &  a_coarVar,
const int &  a_fineVar,
const int &  a_dir 
) const
protectedvirtualnoexcept

Do a harmonic average of face-centered data when coarsening.

Parameters
[in,out]a_coarDataCoarse data
[in]a_fineDataFine data
[in]a_datIndGrid index
[in]a_coarVarCoarse variable
[in]a_fineVarFine variable
[in]a_dirFace direction

Member Data Documentation

◆ m_cellHarmonicStencils

LayoutData<BaseIVFAB<VoFStencil> > EBCoarAve::m_cellHarmonicStencils
protected

Stencils for harmonic coarsening of volume data.

Note
This is different than the cellConservative and cellArithmetic stencils because its weights are all one and the harmonic average is applied differently.

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