Chombo + EB  3.2
Public Member Functions | Static Public Attributes | Protected Types | Protected Attributes | Private Member Functions | List of all members
LevelFluxRegister Class Reference

LevelFluxRegister-A class to encapsulate a levels worth of flux registers. More...

#include <LevelFluxRegister.H>

Public Member Functions

 LevelFluxRegister ()
 
 LevelFluxRegister (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const ProblemDomain &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=true, int a_unrefinedDirection=-1)
 
 LevelFluxRegister (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const Box &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=true, int a_unrefinedDirection=-1)
 This is an old style constructor - do not use if at all possible. More...
 
virtual ~LevelFluxRegister ()
 
virtual void define (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const ProblemDomain &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes, int a_unrefinedDirection=-1)
 
virtual void define (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const ProblemDomain &a_dProblem, int a_nRefine, int a_nComp)
 
virtual void define (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const Box &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=true)
 This is an old style define - do not use if at all possible. More...
 
virtual void undefine ()
 
virtual void setToZero ()
 
virtual void incrementCoarse (const FArrayBox &a_coarseFlux, Real a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir)
 
virtual void incrementCoarse (const FArrayBox &a_coarseFlux, Real a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
 
virtual void incrementFine (const FArrayBox &a_fineFlux, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir)
 
virtual void incrementFine (const FArrayBox &a_fineFlux, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
 
virtual void reflux (LevelData< FArrayBox > &a_uCoarse, Real a_scale)
 
virtual void reflux (LevelData< FArrayBox > &a_uCoarse, const Interval &a_coarseVectorIntv, Real a_scale)
 
virtual void reflux (LevelData< FArrayBox > &a_uCoarse, const Interval &a_coarse_interval, const Interval &a_flux_interval, Real a_scale)
 
virtual void reflux (LevelData< FArrayBox > &a_uCoarse, Real a_scale, const Interval &a_coarseInterv, const Interval &a_fluxInterval, const LevelData< FArrayBox > &a_beta)
 same as above with a variable scale multiplied in More...
 
bool hasCF (const DataIndex &a_fineDataIndex, Side::LoHiSide) const
 
bool hasCF (const DataIndex &a_coarseIndex) const
 
bool isDefined () const
 
bool isAllDefined () const
 
void poutCoarseRegisters () const
 
void poutFineRegisters () const
 
LayoutData< Vector< Box > > & getCoarseLocations (int a_idir, Side::LoHiSide a_sd)
 
CopiergetReverseCopier ()
 

Static Public Attributes

static bool s_verbose
 

Protected Types

enum  FluxRegDefineStatus {
  FluxRegUndefined = 0, FluxRegDefined = (1 << 0), FluxRegFineDefined = (1 << 1), FluxRegCoarseDefined = (1 << 2),
  FluxRegAllDefined = (1 << 3) - 1
}
 Define status. More...
 

Protected Attributes

LevelData< FArrayBoxm_coarFlux
 
LevelData< FArrayBoxm_fineFlux
 
LayoutData< Vector< Box > > m_coarseLocations [CH_SPACEDIM *2]
 
ProblemDomain m_domain
 
int m_isDefined
 
IntVect m_nRefine
 
bool m_scaleFineFluxes
 
int m_unrefinedDirection
 
Copier m_reverseCopier
 
bool m_noRealCoarseFineInterface
 

Private Member Functions

void operator= (const LevelFluxRegister &)
 there is no operator= for this class More...
 
 LevelFluxRegister (const LevelFluxRegister &)
 there is no copy constructor for this class More...
 

Detailed Description

LevelFluxRegister-A class to encapsulate a levels worth of flux registers.

A LevelFluxRegister handles all the data choreography necessary to create a levels worth of flux registers.

Member Enumeration Documentation

◆ FluxRegDefineStatus

Define status.

Enumerator
FluxRegUndefined 
FluxRegDefined 
FluxRegFineDefined 
FluxRegCoarseDefined 
FluxRegAllDefined 

Constructor & Destructor Documentation

◆ LevelFluxRegister() [1/4]

LevelFluxRegister::LevelFluxRegister ( )

Default constructor. Creates an uninitialized levelfluxregister.

◆ LevelFluxRegister() [2/4]

LevelFluxRegister::LevelFluxRegister ( const DisjointBoxLayout a_dbl,
const DisjointBoxLayout a_dblCoarse,
const ProblemDomain a_dProblem,
int  a_nRefine,
int  a_nComp,
bool  a_scaleFineFluxes = true,
int  a_unrefinedDirection = -1 
)

Full constructor. Calls the define function which creates a levels worth of flux registers. a_dProblem is fine-level domain.

If a_scaleFineFluxes is true (default then all fine fluxes are scaled by 1/a_nRefine^(SpaceDim-1). Otherwise, no scaling is done.

◆ LevelFluxRegister() [3/4]

LevelFluxRegister::LevelFluxRegister ( const DisjointBoxLayout a_dbl,
const DisjointBoxLayout a_dblCoarse,
const Box a_dProblem,
int  a_nRefine,
int  a_nComp,
bool  a_scaleFineFluxes = true,
int  a_unrefinedDirection = -1 
)

This is an old style constructor - do not use if at all possible.

Full constructor. Calls the define function which creates a levels worth of flux registers. a_dProblem is fine-level domain.

If a_scaleFineFluxes is true (default then all fine fluxes are scaled by 1/a_nRefine^(SpaceDim-1). Otherwise, no scaling is done.

◆ ~LevelFluxRegister()

virtual LevelFluxRegister::~LevelFluxRegister ( )
virtual

◆ LevelFluxRegister() [4/4]

LevelFluxRegister::LevelFluxRegister ( const LevelFluxRegister )
private

there is no copy constructor for this class

Member Function Documentation

◆ define() [1/3]

virtual void LevelFluxRegister::define ( const DisjointBoxLayout a_dbl,
const DisjointBoxLayout a_dblCoarse,
const ProblemDomain a_dProblem,
int  a_nRefine,
int  a_nComp,
bool  a_scaleFineFluxes,
int  a_unrefinedDirection = -1 
)
virtual

Full define function. Creates a levels worth of flux registers. The values in the flux registers are still undefined, however. To zero the fluxregisters, you must call setToZero(). a_dProblem is fine-level domain. This method may be overridden by a subclass.

If a_scaleFineFluxes is true then all fine fluxes are scaled by 1/a_nRefine^(SpaceDim-1). Otherwise, no scaling is done.

◆ define() [2/3]

virtual void LevelFluxRegister::define ( const DisjointBoxLayout a_dbl,
const DisjointBoxLayout a_dblCoarse,
const ProblemDomain a_dProblem,
int  a_nRefine,
int  a_nComp 
)
virtual

This define function calls the above define(), setting a_scaleFineFluxes to true.

◆ define() [3/3]

virtual void LevelFluxRegister::define ( const DisjointBoxLayout a_dbl,
const DisjointBoxLayout a_dblCoarse,
const Box a_dProblem,
int  a_nRefine,
int  a_nComp,
bool  a_scaleFineFluxes = true 
)
virtual

This is an old style define - do not use if at all possible.

Full define function. Creates a levels worth of flux registers. The values in the flux registers are still undefined, however. To zero the fluxregisters, you must call setToZero(). a_dProblem is fine-level domain.

If a_scaleFineFluxes is true (default then all fine fluxes are scaled by 1/a_nRefine^(SpaceDim-1). Otherwise, no scaling is done.

◆ undefine()

virtual void LevelFluxRegister::undefine ( )
virtual

Modifies this LevelFluxRegister so that it is returned to the uninitialized state. User must now call the full define() before using it.

◆ setToZero()

virtual void LevelFluxRegister::setToZero ( )
virtual

Initialize values of registers to zero.

◆ incrementCoarse() [1/2]

virtual void LevelFluxRegister::incrementCoarse ( const FArrayBox a_coarseFlux,
Real  a_scale,
const DataIndex a_coarseDataIndex,
const Interval a_srcInterval,
const Interval a_dstInterval,
int  a_dir 
)
virtual

increments the register with data from coarseFlux, multiplied by scale. coarseFlux must contain the coarse fluxes in the dir direction for the grid m_coarseLayout[coarseDataIndex]. This operation is local. Increment coarse does register += -sign(side)*incrScale*coarseFlux for both Lo and Hi "side".

◆ incrementCoarse() [2/2]

virtual void LevelFluxRegister::incrementCoarse ( const FArrayBox a_coarseFlux,
Real  a_scale,
const DataIndex a_coarseDataIndex,
const Interval a_srcInterval,
const Interval a_dstInterval,
int  a_dir,
Side::LoHiSide  a_sd 
)
virtual

This method implements the register's coarse increment on a single side. It may be overridden by a subclass.

◆ incrementFine() [1/2]

virtual void LevelFluxRegister::incrementFine ( const FArrayBox a_fineFlux,
Real  a_scale,
const DataIndex a_fineDataIndex,
const Interval a_srcInterval,
const Interval a_dstInterval,
int  a_dir 
)
virtual

increments the register with data from fineFlux, multiplied by scale. fineFlux must contain the coarse fluxes in the dir direction for the grid m_fineLayout[fineDataIndex]. This operation is local. Increment fine does register += sign(side)*incrScale*Ave(fineFlux) for both Lo and Hi "side".

◆ incrementFine() [2/2]

virtual void LevelFluxRegister::incrementFine ( const FArrayBox a_fineFlux,
Real  a_scale,
const DataIndex a_fineDataIndex,
const Interval a_srcInterval,
const Interval a_dstInterval,
int  a_dir,
Side::LoHiSide  a_sd 
)
virtual

This method implements the register's fine increment on one side. It may be overridden by a subclass.

◆ reflux() [1/4]

virtual void LevelFluxRegister::reflux ( LevelData< FArrayBox > &  a_uCoarse,
Real  a_scale 
)
virtual

increments uCoarse with the reflux divergence of the contents of the flux register. Note that there is no srccomp etc here. this is done for all components so uCoarse has to have the same number of components as input nComp. This operation is global and blocking.

Reflux does cellValue -= refluxScale*registerContents

◆ reflux() [2/4]

virtual void LevelFluxRegister::reflux ( LevelData< FArrayBox > &  a_uCoarse,
const Interval a_coarseVectorIntv,
Real  a_scale 
)
virtual

Interface for multiblock algorithms where, if an interval of the components represents a vector, it must be specially handled. If called from a singleblock code, the vector interval is just ignored.

◆ reflux() [3/4]

virtual void LevelFluxRegister::reflux ( LevelData< FArrayBox > &  a_uCoarse,
const Interval a_coarse_interval,
const Interval a_flux_interval,
Real  a_scale 
)
virtual

increments uCoarse with the reflux divergence of the contents of the flux register. This can be overridden by a subclass. This operation is global and blocking. Reflux does cellValue -= refluxScale*registerContents

◆ reflux() [4/4]

virtual void LevelFluxRegister::reflux ( LevelData< FArrayBox > &  a_uCoarse,
Real  a_scale,
const Interval a_coarseInterv,
const Interval a_fluxInterval,
const LevelData< FArrayBox > &  a_beta 
)
virtual

same as above with a variable scale multiplied in

◆ hasCF() [1/2]

bool LevelFluxRegister::hasCF ( const DataIndex a_fineDataIndex,
Side::LoHiSide   
) const

◆ hasCF() [2/2]

bool LevelFluxRegister::hasCF ( const DataIndex a_coarseIndex) const

◆ isDefined()

bool LevelFluxRegister::isDefined ( ) const

has full define function been called? return true if so.

Referenced by getCoarseLocations().

◆ isAllDefined()

bool LevelFluxRegister::isAllDefined ( ) const

◆ poutCoarseRegisters()

void LevelFluxRegister::poutCoarseRegisters ( ) const

◆ poutFineRegisters()

void LevelFluxRegister::poutFineRegisters ( ) const

◆ getCoarseLocations()

LayoutData< Vector<Box> >& LevelFluxRegister::getCoarseLocations ( int  a_idir,
Side::LoHiSide  a_sd 
)
inline

◆ getReverseCopier()

Copier& LevelFluxRegister::getReverseCopier ( )
inline

References m_reverseCopier.

◆ operator=()

void LevelFluxRegister::operator= ( const LevelFluxRegister )
private

there is no operator= for this class

Member Data Documentation

◆ s_verbose

bool LevelFluxRegister::s_verbose
static

◆ m_coarFlux

LevelData<FArrayBox> LevelFluxRegister::m_coarFlux
protected

◆ m_fineFlux

LevelData<FArrayBox> LevelFluxRegister::m_fineFlux
protected

◆ m_coarseLocations

LayoutData< Vector<Box> > LevelFluxRegister::m_coarseLocations[CH_SPACEDIM *2]
protected

Referenced by getCoarseLocations().

◆ m_domain

ProblemDomain LevelFluxRegister::m_domain
protected

◆ m_isDefined

int LevelFluxRegister::m_isDefined
protected

◆ m_nRefine

IntVect LevelFluxRegister::m_nRefine
protected

◆ m_scaleFineFluxes

bool LevelFluxRegister::m_scaleFineFluxes
protected

◆ m_unrefinedDirection

int LevelFluxRegister::m_unrefinedDirection
protected

◆ m_reverseCopier

Copier LevelFluxRegister::m_reverseCopier
protected

Referenced by getReverseCopier().

◆ m_noRealCoarseFineInterface

bool LevelFluxRegister::m_noRealCoarseFineInterface
protected

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