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

Class which can do refluxing across a coarse-fine interface. More...

#include <CD_EBReflux.H>

Public Member Functions

 EBReflux () noexcept
 Disallowed constructor.
 
 EBReflux (const EBReflux &a_other)=delete
 Disallowed copy constructor.
 
 EBReflux (const EBLevelGrid &a_eblg, const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const int a_refRat) noexcept
 Full constructor. Calls the define function. More...
 
virtual ~EBReflux () noexcept
 Destructor (does nothing)
 
virtual void define (const EBLevelGrid &a_eblg, const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const int a_refRat) noexcept
 Define method. Puts object in usable state. More...
 
virtual void reflux (LevelData< EBCellFAB > &a_Lphi, const LevelData< EBFluxFAB > &a_flux, const LevelData< EBFluxFAB > &a_fineFlux, const Interval a_variables, const Real a_scaleCoarFlux, const Real a_scaleFineFlux) const noexcept
 Reflux into the coarse data. More...
 

Protected Member Functions

virtual void defineRegionsCF () noexcept
 Define coarse-fine interface regions so that we can compute things later.
 
virtual void defineStencils () noexcept
 Define the stencils required for coarsening the fine-grid fluxes onto the coarse grid.
 
virtual void defineBuffers () noexcept
 Define buffers.
 
virtual void coarsenFluxesCF (LevelData< EBFluxFAB > &a_coarFluxes, const LevelData< EBFluxFAB > &a_fineFluxes, const int a_coarVar, const int a_fineVar) const noexcept
 Coarsen the input fine fluxes onto the coarse fluxes. More...
 
virtual void refluxIntoCoarse (LevelData< EBCellFAB > &a_Lphi, const LevelData< EBFluxFAB > &a_oldFluxes, const LevelData< EBFluxFAB > &a_newFluxes, const int a_phiVar, const int a_oldFluxVar, const int a_newFluxVar, const Real a_scaleCoarFlux, const Real a_scaleFineFlux) const noexcept
 Reflux data into a_Lphi. More...
 

Protected Attributes

bool m_isDefined
 Is defined or not.
 
int m_refRat
 Refinement factor between fine and coarse level.
 
EBLevelGrid m_eblgFine
 Fine grids.
 
EBLevelGrid m_eblg
 Grid on this level.
 
EBLevelGrid m_eblgCoFi
 Coarsened fine grids.
 
Copier m_copier
 Copier for copying from the coarsened fine grids to the coarse grids.
 
LayoutData< std::map< std::pair< int, Side::LoHiSide >, BaseIFFAB< FaceStencil > > > m_fluxCoarseningStencils
 Stencils for conservatively coarsening fine-grid fluxes onto the coarse grid.
 
LayoutData< std::map< std::pair< int, Side::LoHiSide >, DenseIntVectSet > > m_regularCoarseFineRegions
 Regular coarse-fine regions for coarse-grid patches.
 
LayoutData< std::map< std::pair< int, Side::LoHiSide >, FaceIterator > > m_fluxCoarseningRegions
 Stencils for conservatively coarsening fine-grid fluxes onto the coarse grid.
 
LayoutData< std::map< std::pair< int, Side::LoHiSide >, VoFIterator > > m_irregularCoarseFineRegions
 Cut-cells in each patch that lie on the coarse-fine interface. More...
 

Detailed Description

Class which can do refluxing across a coarse-fine interface.

This is like Chombos EBReflux, but trimmed for being faster & cheaper. This class will only reflux on the coarse-fine interface. If the user wants to accumulate fluxes, he/she should do it outside of this routine and only call the reflux method at the very end (only relevant for subcycling).

This reflux method operates slightly different from Chombo in that the coarse-grid fluxes are first constructed by conservatively coarsening the fine-grid fluxes. Then we do as we always do, subtracting the originan coarse-grid fluxes and adding in the corresponding fine-grid fluxes. Standard scaling factor for scaling the coarse/fine flux contributions are present, as always.

Constructor & Destructor Documentation

◆ EBReflux()

EBReflux::EBReflux ( const EBLevelGrid &  a_eblg,
const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const int  a_refRat 
)
noexcept

Full constructor. Calls the define function.

Parameters
[in]a_eblgGrids
[in]a_eblgFineFine grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_refRatRefinement ratio between grids.

Member Function Documentation

◆ coarsenFluxesCF()

void EBReflux::coarsenFluxesCF ( LevelData< EBFluxFAB > &  a_coarFluxes,
const LevelData< EBFluxFAB > &  a_fineFluxes,
const int  a_coarVar,
const int  a_fineVar 
) const
protectedvirtualnoexcept

Coarsen the input fine fluxes onto the coarse fluxes.

This replaces the coarse fluxes along the coarse-fine interface by the conservative average of the fine fluxes.

Parameters
[in,out]a_coarFluxesCoarse-grid fluxes
[in]a_fineFluxesFine-grid fluxes
[in]a_coarVarCoarse-flux variable
[in]a_fineVarFine-flux variable

◆ define()

void EBReflux::define ( const EBLevelGrid &  a_eblg,
const EBLevelGrid &  a_eblgFine,
const EBLevelGrid &  a_eblgCoFi,
const int  a_refRat 
)
virtualnoexcept

Define method. Puts object in usable state.

Parameters
[in]a_eblgGrids on this level
[in]a_eblgFineFine grids
[in]a_eblgCoFiCoarsened fine grids
[in]a_refRatRefinement ratio between coarse and fine grids.

◆ reflux()

void EBReflux::reflux ( LevelData< EBCellFAB > &  a_Lphi,
const LevelData< EBFluxFAB > &  a_flux,
const LevelData< EBFluxFAB > &  a_fineFlux,
const Interval  a_variables,
const Real  a_scaleCoarFlux,
const Real  a_scaleFineFlux 
) const
virtualnoexcept

Reflux into the coarse data.

This subtracts the coarse-fluxes from the EB and adds in the sum offine-grid fluxes. Multiplication by area fractions and grid resolutions are done in this routine.

Parameters
[in,out]a_dataData
[in]a_fluxFluxes
[in]a_fineFluxFine-grid flux.
[in]a_variablesVariables to reflux.
[in]a_scaleCoarFluxScaling constant for fine-grid fluxes
[in]a_scaleFineFluxScaling constant for fine-grid fluxes

◆ refluxIntoCoarse()

void EBReflux::refluxIntoCoarse ( LevelData< EBCellFAB > &  a_Lphi,
const LevelData< EBFluxFAB > &  a_oldFluxes,
const LevelData< EBFluxFAB > &  a_newFluxes,
const int  a_phiVar,
const int  a_oldFluxVar,
const int  a_newFluxVar,
const Real  a_scaleCoarFlux,
const Real  a_scaleFineFlux 
) const
protectedvirtualnoexcept

Reflux data into a_Lphi.

This subtracts the old fluxes (scaled by a_scaleOldFlux) from a_Lphi and adds in the new fluxes (scaled by a_scaleFineFlux).

Parameters
[in,out]a_Lphi
[in]a_oldFluxesPrevious fluxes from which a_Lphi was computed
[in]a_newFluxesNew fluxes to be put into a_Lphi
[in]a_phiVarVariable in a_Lphi to reflux
[in]a_oldFluxVarVariable in a_oldFluxes to subtract
[in]a_newFluxVarVariable in a_newFluxes to add
[in]a_scaleCoarFluxScaling constant for fine-grid fluxes
[in]a_scaleFineFluxScaling constant for fine-grid fluxes

Member Data Documentation

◆ m_irregularCoarseFineRegions

LayoutData<std::map<std::pair<int, Side::LoHiSide>, VoFIterator> > EBReflux::m_irregularCoarseFineRegions
mutableprotected

Cut-cells in each patch that lie on the coarse-fine interface.

Note
Defined over the coarse grids

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