#include <LevelFluxRegister.H>
A LevelFluxRegister handles all the data choreography necessary to create a levels worth of flux registers.
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) | |
LevelFluxRegister (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 constructor - do not use if at all possible. | |
~LevelFluxRegister () | |
void | define (const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const ProblemDomain &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=true) |
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. | |
void | undefine () |
void | setToZero () |
void | incrementCoarse (FArrayBox &a_coarseFlux, Real a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir) |
void | incrementCoarse (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) |
void | incrementFine (FArrayBox &a_fineFlux, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir) |
void | incrementFine (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) |
void | reflux (LevelData< FArrayBox > &a_uCoarse, Real a_scale) |
void | reflux (LevelData< FArrayBox > &a_uCoarse, const Interval &a_coarse_interval, const Interval &a_flux_interval, Real a_scale) |
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 | |
bool | hasCF (const DataIndex &a_fineDataIndex, Side::LoHiSide) const |
bool | hasCF (const DataIndex &a_coarseIndex) const |
bool | isDefined () const |
void | poutCoarseRegisters () const |
void | poutFineRegisters () const |
Protected Attributes | |
LevelData< FArrayBox > | m_coarFlux |
LevelData< FArrayBox > | m_fineFlux |
LayoutData< Vector< Box > > | m_coarseLocations [CH_SPACEDIM *2] |
ProblemDomain | m_domain |
bool | m_isDefined |
int | m_nRefine |
bool | m_scaleFineFluxes |
Copier | m_reverseCopier |
Private Member Functions | |
void | operator= (const LevelFluxRegister &) |
there is no operator= for this class | |
LevelFluxRegister (const LevelFluxRegister &) | |
there is no copy constructor for this class |
LevelFluxRegister::LevelFluxRegister | ( | ) |
Default constructor. Creates an uninitialized levelfluxregister.
LevelFluxRegister::LevelFluxRegister | ( | const DisjointBoxLayout & | a_dbl, | |
const DisjointBoxLayout & | a_dblCoarse, | |||
const ProblemDomain & | a_dProblem, | |||
int | a_nRefine, | |||
int | a_nComp, | |||
bool | a_scaleFineFluxes = true | |||
) |
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::LevelFluxRegister | ( | 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 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::~LevelFluxRegister | ( | ) |
LevelFluxRegister::LevelFluxRegister | ( | const LevelFluxRegister & | ) | [private] |
there is no copy constructor for this class
void LevelFluxRegister::define | ( | const DisjointBoxLayout & | a_dbl, | |
const DisjointBoxLayout & | a_dblCoarse, | |||
const ProblemDomain & | a_dProblem, | |||
int | a_nRefine, | |||
int | a_nComp, | |||
bool | a_scaleFineFluxes = true | |||
) |
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.
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 | |||
) |
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.
void LevelFluxRegister::undefine | ( | ) |
Modifies this LevelFluxRegister so that it is returned to the uninitialized state. User must now call the full define() before using it.
void LevelFluxRegister::setToZero | ( | ) |
Initialize values of registers to zero.
void LevelFluxRegister::incrementCoarse | ( | FArrayBox & | a_coarseFlux, | |
Real | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_srcInterval, | |||
const Interval & | a_dstInterval, | |||
int | a_dir | |||
) |
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".
void LevelFluxRegister::incrementCoarse | ( | 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 | |||
) |
Same as above, except you only increment the a_sd side.
void LevelFluxRegister::incrementFine | ( | FArrayBox & | a_fineFlux, | |
Real | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_srcInterval, | |||
const Interval & | a_dstInterval, | |||
int | a_dir | |||
) |
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".
void LevelFluxRegister::incrementFine | ( | 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 | |||
) |
Same as above, except you only increment the a_sd side.
increments uCoarse with the reflux divergence of the contents of the flux register. Note that there is no srccomp etc crap 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
void LevelFluxRegister::reflux | ( | LevelData< FArrayBox > & | a_uCoarse, | |
const Interval & | a_coarse_interval, | |||
const Interval & | a_flux_interval, | |||
Real | a_scale | |||
) |
increments uCoarse with the reflux divergence of the contents of the flux register. This operation is global and blocking. Reflux does cellValue -= refluxScale*registerContents
void LevelFluxRegister::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
bool LevelFluxRegister::hasCF | ( | const DataIndex & | a_fineDataIndex, | |
Side::LoHiSide | ||||
) | const |
bool LevelFluxRegister::hasCF | ( | const DataIndex & | a_coarseIndex | ) | const |
bool LevelFluxRegister::isDefined | ( | ) | const |
has full define function been called? return true if so.
void LevelFluxRegister::poutCoarseRegisters | ( | ) | const |
void LevelFluxRegister::poutFineRegisters | ( | ) | const |
void LevelFluxRegister::operator= | ( | const LevelFluxRegister & | ) | [private] |
there is no operator= for this class
LevelData<FArrayBox> LevelFluxRegister::m_coarFlux [protected] |
LevelData<FArrayBox> LevelFluxRegister::m_fineFlux [protected] |
LayoutData< Vector<Box> > LevelFluxRegister::m_coarseLocations[CH_SPACEDIM *2] [protected] |
ProblemDomain LevelFluxRegister::m_domain [protected] |
bool LevelFluxRegister::m_isDefined [protected] |
int LevelFluxRegister::m_nRefine [protected] |
bool LevelFluxRegister::m_scaleFineFluxes [protected] |
Copier LevelFluxRegister::m_reverseCopier [protected] |