#include <EBFluxRegister.H>
A EBFluxRegister handles all the data choreography necessary to create a levels worth of flux registers.
Public Member Functions | |
EBFluxRegister () | |
EBFluxRegister (const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &ebislFine, const EBISLayout &a_ebislCoar, const Box &a_domainCoar, const int &a_nref, const int &a_nvar, const EBIndexSpace *ebisPtr) | |
~EBFluxRegister () | |
void | define (const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, const EBISLayout &a_ebislFine, const EBISLayout &a_ebislCoar, const ProblemDomain &a_domainCoar, const int &a_nref, const int &a_nvar, const EBIndexSpace *ebisPtr) |
void | setToZero () |
void | incrementCoarseRegular (const EBFaceFAB &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir) |
void | incrementCoarseBoth (const EBFaceFAB &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir) |
void | incrementCoarse (const EBFaceFAB &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_varSrc, const Interval &a_varDst, const int &a_dir) |
void | incrementCoarseRegulRZ (const EBFaceFAB &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir, const Real &a_dx) |
void | incrementCoarseIrregular (const BaseIFFAB< Real > &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir) |
void | incrementCoarseIrregular (const EBFaceFAB &a_coarFlux, const Real &a_scale, const DataIndex &a_coarDatInd, const Interval &a_variables, const int &a_dir) |
void | incrementCoarseIrregulRZ (const BaseIFFAB< Real > &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir, const Real &a_dx) |
void | incrementFineRegular (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd) |
void | incrementFineBoth (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd) |
void | incrementFine (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_varSrc, const Interval &a_varDst, const int &a_dir) |
void | incrementFineRegulRZ (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd, const Real &a_dx) |
void | incrementFineIrregular (const BaseIFFAB< Real > &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd) |
void | incrementFineIrregular (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd) |
void | incrementFineBothRZ (const EBFaceFAB &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd, const Real &a_dx) |
void | incrementCoarseBothRZ (const EBFaceFAB &a_coarseFlux, const Real &a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_variables, const int &a_dir, const Real &a_dx) |
void | incrementFineIrregulRZ (const BaseIFFAB< Real > &a_fineFlux, const Real &a_scale, const DataIndex &a_fineDataIndex, const Interval &a_variables, const int &a_dir, const Side::LoHiSide &a_sd, const Real &a_dx) |
void | reflux (LevelData< EBCellFAB > &a_uCoarse, const Interval &a_variables, const Real &a_scale) |
void | reflux (LevelData< EBCellFAB > &a_uCoarse, const Interval &a_variables, const Real &a_scale, const LevelData< EBCellFAB > &a_beta) |
void | reflux (LevelData< EBCellFAB > &a_uCoarse, const Interval &a_variables, const Real &a_scale, const int &a_refluxDir) |
void | reflux (LevelData< EBCellFAB > &a_uCoarse, const Interval &a_variables, const Real &a_scale, const int &a_refluxDir, const LevelData< EBCellFAB > &a_beta) |
void | incrementRedistRegister (EBCoarToFineRedist &a_register, const Interval &a_variables, const Real &a_scale) |
void | incrementRedistRegister (EBCoarToCoarRedist &a_register, const Interval &a_variables, const Real &a_scale) |
void | incrementRedistRegistRZ (EBCoarToCoarRedist &a_register, const Interval &a_variables, const Real &a_dx) |
void | incrementDensityArray (LevelData< EBCellFAB > &a_coarMass, const Interval &a_variables, const Real &a_scale) |
bool | isDefined () const |
void | dumpCoar (const int &a_idir, const Side::LoHiSide &a_sd) |
void | dumpFine (const int &a_idir, const Side::LoHiSide &a_sd) |
void | dumpBIVF (const BaseIVFAB< Real > ®, const EBISBox &a_ebisBox) |
Protected Member Functions | |
void | setDefaultValues () |
Static Protected Member Functions | |
static int | index (int a_dir, Side::LoHiSide a_side) |
Protected Attributes | |
DisjointBoxLayout | m_gridsFine |
DisjointBoxLayout | m_gridsCoar |
DisjointBoxLayout | m_bufGridsFine [SpaceDim *2] |
DisjointBoxLayout | m_bufGridsCoar [SpaceDim *2] |
LevelData< BaseIVFAB< Real > > | m_regsCoar [SpaceDim *2] |
LevelData< BaseIVFAB< Real > > | m_regsFine [SpaceDim *2] |
LevelData< BaseIVFAB< Real > > | m_scratchc [SpaceDim *2] |
LayoutData< IntVectSet > | m_cfivsFine [SpaceDim *2] |
LayoutData< IntVectSet > | m_cfivsCoar [SpaceDim *2] |
EBISLayout | m_ebislFine |
EBISLayout | m_ebislCoar |
EBISLayout | m_ebislBufCoar [2 *SpaceDim] |
EBISLayout | m_ebislBufFine [2 *SpaceDim] |
LayoutData< Vector< DataIndex > > | m_coarIndexMap [SpaceDim *2] |
bool | m_isDefined |
int | m_nComp |
int | m_refRat |
ProblemDomain | m_domainCoar |
Private Member Functions | |
void | operator= (const EBFluxRegister &) |
EBFluxRegister (const EBFluxRegister &) |
EBFluxRegister::EBFluxRegister | ( | ) |
Default constructor. Leaves object undefined.
EBFluxRegister::EBFluxRegister | ( | const DisjointBoxLayout & | a_dblFine, | |
const DisjointBoxLayout & | a_dblCoar, | |||
const EBISLayout & | ebislFine, | |||
const EBISLayout & | a_ebislCoar, | |||
const Box & | a_domainCoar, | |||
const int & | a_nref, | |||
const int & | a_nvar, | |||
const EBIndexSpace * | ebisPtr | |||
) |
Full constructor. Calls the define function which creates a levels worth of flux registers.
EBFluxRegister::~EBFluxRegister | ( | ) |
EBFluxRegister::EBFluxRegister | ( | const EBFluxRegister & | ) | [inline, private] |
References MayDay::Error().
void EBFluxRegister::define | ( | const DisjointBoxLayout & | a_dblFine, | |
const DisjointBoxLayout & | a_dblCoar, | |||
const EBISLayout & | a_ebislFine, | |||
const EBISLayout & | a_ebislCoar, | |||
const ProblemDomain & | a_domainCoar, | |||
const int & | a_nref, | |||
const int & | a_nvar, | |||
const EBIndexSpace * | ebisPtr | |||
) |
Full define function. Creates a levels worth of flux registers.
void EBFluxRegister::setToZero | ( | ) |
Initialize values of registers to zero.
void EBFluxRegister::incrementCoarseRegular | ( | const EBFaceFAB & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir | |||
) |
increments the register with data from coarseFlux, multiplied by scale. Increment coarse buffer with the area-weighted sum of the fluxes on the faces. buf += -scale*sum(areaFrac*flux) CoarseFlux must contain the coarse fluxes in the dir direction for the grid m_coarseLayout[coarseDataIndex].
void EBFluxRegister::incrementCoarseBoth | ( | const EBFaceFAB & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir | |||
) |
Referenced by incrementCoarse().
void EBFluxRegister::incrementCoarse | ( | const EBFaceFAB & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_varSrc, | |||
const Interval & | a_varDst, | |||
const int & | a_dir | |||
) | [inline] |
References incrementCoarseBoth().
void EBFluxRegister::incrementCoarseRegulRZ | ( | const EBFaceFAB & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Real & | a_dx | |||
) |
Here is the story on flux registers for RZ. (1) You do need to multiply the radius into the flux before you send them to the flux register increment functions. See LevelGodunov calls EBPatchGodunov::assembleFluxReg which does this:
newflux = radius*godunovflux(chf_ix[i;j;k], iv) if( ((iv .eq. CMOMX).and.(idir.eq.0)).or. & ((iv .eq. CMOMY).and.(idir.eq.1))) then newflux = newflux + & radius*godunovflux(chf_ix[i;j;k], CPRES) endif
fluxregflux(chf_ix[i;j;k], iv) = newflux
You will have to do something similar.
(2) The math of what happens in the RZ functions of flux register is in section 5.3 of the ChomboDoc/EBAMRGodunov document. I will here (and in EBFluxRegister.H) explain what each function is doing. In all of this kvol = (1/2*cellvol)*(r^2 nr dl), the integral volume fraction of the cell.
(2.1) EBFluxRegister::incrementCoarse{reg,irreg}lRZ, coarsebuffer = dt*area*fluxregflux*volFrac/(kvol*rad) The time step is the scale sent in. coarReg += dt_c*volFrac*areaFrac*fluxregflux/(kvol*rad_cell_center);
(2.2) EBFluxRegister::incrementFine{reg,irreg}RZ. f subscripts are from the fine level, c from the coarse. fineBuffer += dt_f*volFrac_coar*areaFrac_f*flux/(kvol_c*rad_c_cell*nref^{D-1});
void EBFluxRegister::incrementCoarseIrregular | ( | const BaseIFFAB< Real > & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir | |||
) |
increments the register with data from coarseFlux, multiplied by scale. Increment coarse buffer with the area-weighted sum of the fluxes on the faces. buf += -scale*sum(areaFrac*flux) CoarseFlux must contain the coarse fluxes in the dir direction for the grid m_coarseLayout[coarseDataIndex].
void EBFluxRegister::incrementCoarseIrregulRZ | ( | const BaseIFFAB< Real > & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Real & | a_dx | |||
) |
Here is the story on flux registers for RZ. (1) You do need to multiply the radius into the flux before you send them to the flux register increment functions. See LevelGodunov calls EBPatchGodunov::assembleFluxReg which does this:
newflux = radius*godunovflux(chf_ix[i;j;k], iv) if( ((iv .eq. CMOMX).and.(idir.eq.0)).or. & ((iv .eq. CMOMY).and.(idir.eq.1))) then newflux = newflux + & radius*godunovflux(chf_ix[i;j;k], CPRES) endif
fluxregflux(chf_ix[i;j;k], iv) = newflux
You will have to do something similar.
(2) The math of what happens in the RZ functions of flux register is in section 5.3 of the ChomboDoc/EBAMRGodunov document. I will here (and in EBFluxRegister.H) explain what each function is doing. In all of this kvol = (1/2*cellvol)*(r^2 nr dl), the integral volume fraction of the cell.
(2.1) EBFluxRegister::incrementCoarse{reg,irreg}lRZ, coarsebuffer = dt*area*fluxregflux*volFrac/(kvol*rad) The time step is the scale sent in. coarReg += dt_c*volFrac*areaFrac*fluxregflux/(kvol*rad_cell_center);
(2.2) EBFluxRegister::incrementFine{reg,irreg}RZ. f subscripts are from the fine level, c from the coarse. fineBuffer += dt_f*volFrac_coar*areaFrac_f*flux/(kvol_c*rad_c_cell*nref^{D-1});
void EBFluxRegister::incrementFineRegular | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd | |||
) |
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.
void EBFluxRegister::incrementFineBoth | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd | |||
) |
Referenced by incrementFine().
void EBFluxRegister::incrementFine | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_varSrc, | |||
const Interval & | a_varDst, | |||
const int & | a_dir | |||
) | [inline] |
References incrementFineBoth().
void EBFluxRegister::incrementFineRegulRZ | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd, | |||
const Real & | a_dx | |||
) |
Here is the story on flux registers for RZ. (1) You do need to multiply the radius into the flux before you send them to the flux register increment functions. See LevelGodunov calls EBPatchGodunov::assembleFluxReg which does this:
newflux = radius*godunovflux(chf_ix[i;j;k], iv) if( ((iv .eq. CMOMX).and.(idir.eq.0)).or. & ((iv .eq. CMOMY).and.(idir.eq.1))) then newflux = newflux + & radius*godunovflux(chf_ix[i;j;k], CPRES) endif
fluxregflux(chf_ix[i;j;k], iv) = newflux
You will have to do something similar.
(2) The math of what happens in the RZ functions of flux register is in section 5.3 of the ChomboDoc/EBAMRGodunov document. I will here (and in EBFluxRegister.H) explain what each function is doing. In all of this kvol = (1/2*cellvol)*(r^2 nr dl), the integral volume fraction of the cell.
(2.1) EBFluxRegister::incrementCoarse{reg,irreg}lRZ, coarsebuffer = dt*area*fluxregflux*volFrac/(kvol*rad) The time step is the scale sent in. coarReg += dt_c*volFrac*areaFrac*fluxregflux/(kvol*rad_cell_center);
(2.2) EBFluxRegister::incrementFine{reg,irreg}RZ. f subscripts are from the fine level, c from the coarse. fineBuffer += dt_f*volFrac_coar*areaFrac_f*flux/(kvol_c*rad_c_cell*nref^{D-1});
void EBFluxRegister::incrementFineIrregular | ( | const BaseIFFAB< Real > & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd | |||
) |
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.
void EBFluxRegister::incrementFineIrregular | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd | |||
) |
void EBFluxRegister::incrementFineBothRZ | ( | const EBFaceFAB & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd, | |||
const Real & | a_dx | |||
) |
void EBFluxRegister::incrementCoarseBothRZ | ( | const EBFaceFAB & | a_coarseFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_coarseDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Real & | a_dx | |||
) |
void EBFluxRegister::incrementFineIrregulRZ | ( | const BaseIFFAB< Real > & | a_fineFlux, | |
const Real & | a_scale, | |||
const DataIndex & | a_fineDataIndex, | |||
const Interval & | a_variables, | |||
const int & | a_dir, | |||
const Side::LoHiSide & | a_sd, | |||
const Real & | a_dx | |||
) |
Here is the story on flux registers for RZ. (1) You do need to multiply the radius into the flux before you send them to the flux register increment functions. See LevelGodunov calls EBPatchGodunov::assembleFluxReg which does this:
newflux = radius*godunovflux(chf_ix[i;j;k], iv) if( ((iv .eq. CMOMX).and.(idir.eq.0)).or. & ((iv .eq. CMOMY).and.(idir.eq.1))) then newflux = newflux + & radius*godunovflux(chf_ix[i;j;k], CPRES) endif
fluxregflux(chf_ix[i;j;k], iv) = newflux
You will have to do something similar.
(2) The math of what happens in the RZ functions of flux register is in section 5.3 of the ChomboDoc/EBAMRGodunov document. I will here (and in EBFluxRegister.H) explain what each function is doing. In all of this kvol = (1/2*cellvol)*(r^2 nr dl), the integral volume fraction of the cell.
(2.1) EBFluxRegister::incrementCoarse{reg,irreg}lRZ, coarsebuffer = dt*area*fluxregflux*volFrac/(kvol*rad) The time step is the scale sent in. coarReg += dt_c*volFrac*areaFrac*fluxregflux/(kvol*rad_cell_center);
(2.2) EBFluxRegister::incrementFine{reg,irreg}RZ. f subscripts are from the fine level, c from the coarse. fineBuffer += dt_f*volFrac_coar*areaFrac_f*flux/(kvol_c*rad_c_cell*nref^{D-1});
void EBFluxRegister::reflux | ( | LevelData< EBCellFAB > & | a_uCoarse, | |
const Interval & | a_variables, | |||
const Real & | a_scale | |||
) |
increments uCoarse with the reflux divergence of the contents of the flux register. This operation is global and blocking.
void EBFluxRegister::reflux | ( | LevelData< EBCellFAB > & | a_uCoarse, | |
const Interval & | a_variables, | |||
const Real & | a_scale, | |||
const LevelData< EBCellFAB > & | a_beta | |||
) |
increments uCoarse with the reflux divergence of the contents of the flux register. beta is a pointwise multiplier to scale This operation is global and blocking.
void EBFluxRegister::reflux | ( | LevelData< EBCellFAB > & | a_uCoarse, | |
const Interval & | a_variables, | |||
const Real & | a_scale, | |||
const int & | a_refluxDir | |||
) |
void EBFluxRegister::reflux | ( | LevelData< EBCellFAB > & | a_uCoarse, | |
const Interval & | a_variables, | |||
const Real & | a_scale, | |||
const int & | a_refluxDir, | |||
const LevelData< EBCellFAB > & | a_beta | |||
) |
void EBFluxRegister::incrementRedistRegister | ( | EBCoarToFineRedist & | a_register, | |
const Interval & | a_variables, | |||
const Real & | a_scale | |||
) |
Increments redistribution register with left-over mass from reflux divergence.
void EBFluxRegister::incrementRedistRegister | ( | EBCoarToCoarRedist & | a_register, | |
const Interval & | a_variables, | |||
const Real & | a_scale | |||
) |
Increments redistribution register with left-over mass from reflux divergence.
void EBFluxRegister::incrementRedistRegistRZ | ( | EBCoarToCoarRedist & | a_register, | |
const Interval & | a_variables, | |||
const Real & | a_dx | |||
) |
void EBFluxRegister::incrementDensityArray | ( | LevelData< EBCellFAB > & | a_coarMass, | |
const Interval & | a_variables, | |||
const Real & | a_scale | |||
) |
Increments mass array with left-over mass from reflux divergence.
bool EBFluxRegister::isDefined | ( | ) | const |
void EBFluxRegister::dumpCoar | ( | const int & | a_idir, | |
const Side::LoHiSide & | a_sd | |||
) |
void EBFluxRegister::dumpFine | ( | const int & | a_idir, | |
const Side::LoHiSide & | a_sd | |||
) |
static int EBFluxRegister::index | ( | int | a_dir, | |
Side::LoHiSide | a_side | |||
) | [static, protected] |
void EBFluxRegister::setDefaultValues | ( | ) | [protected] |
void EBFluxRegister::operator= | ( | const EBFluxRegister & | ) | [inline, private] |
References MayDay::Error().
DisjointBoxLayout EBFluxRegister::m_gridsFine [protected] |
DisjointBoxLayout EBFluxRegister::m_gridsCoar [protected] |
DisjointBoxLayout EBFluxRegister::m_bufGridsFine[SpaceDim *2] [protected] |
DisjointBoxLayout EBFluxRegister::m_bufGridsCoar[SpaceDim *2] [protected] |
LevelData<BaseIVFAB<Real> > EBFluxRegister::m_regsCoar[SpaceDim *2] [protected] |
LevelData<BaseIVFAB<Real> > EBFluxRegister::m_regsFine[SpaceDim *2] [protected] |
LevelData<BaseIVFAB<Real> > EBFluxRegister::m_scratchc[SpaceDim *2] [protected] |
LayoutData<IntVectSet> EBFluxRegister::m_cfivsFine[SpaceDim *2] [protected] |
LayoutData<IntVectSet> EBFluxRegister::m_cfivsCoar[SpaceDim *2] [protected] |
EBISLayout EBFluxRegister::m_ebislFine [protected] |
EBISLayout EBFluxRegister::m_ebislCoar [protected] |
EBISLayout EBFluxRegister::m_ebislBufCoar[2 *SpaceDim] [protected] |
EBISLayout EBFluxRegister::m_ebislBufFine[2 *SpaceDim] [protected] |
LayoutData<Vector<DataIndex> > EBFluxRegister::m_coarIndexMap[SpaceDim *2] [protected] |
bool EBFluxRegister::m_isDefined [protected] |
int EBFluxRegister::m_nComp [protected] |
int EBFluxRegister::m_refRat [protected] |
ProblemDomain EBFluxRegister::m_domainCoar [protected] |