LevelGridMetrics Class Reference

#include <LevelGridMetrics.H>

List of all members.


Detailed Description

Grid metrics for a level.

This class adds infrastructure for mapped grids to the fourth-order Cartesian AMRLevel class. The interface closely follows that of AMRLevel. Typically this class is a member of the user's derived AMRLevel and the member functions of LevelGridData should be called from member functions of the derived AMRLevel that have the same name.

This class provides m_N, the metric terms $\mathbf(N)$ on each face, and m_J, the determinant (physical cell volume divided by computational cell volume). These quantities are appropriately maintained during all aspects of an AMR solution.

GHOSTS --- The determinants, (J), are defined on all ghost cells at the domain interior and 1 layer of ghost cells outside a non-periodic domain. Hence, gradients of J are available everywhere an application may store data. To achieve this, it is assumed that the metrics can be evaluated everywhere in $\mathcal(G)(\Gamma,2)$. HOWEVER, metrics that are consistent between levels are only maintained in the valid region of the finer level. A valid cell on a coarse level will have metrics computed separately from any overlapping ghost cells from a finer level (i.e., the volumes of the fine ghost cells may not sum to the volume of the valid coarse cell). Consistency between levels everywhere could be achieved by treating all ghost cells as part of the valid region --- this would simply (probably simply) require some modifications to the "averagers". However we do not do this because:

Any ghost cell that is covered by a valid cell on that level is consistent with the metrics from any finer level by means of the copiers (used in the averagers) copying to both the invalid and valid regions of a destination.

Transverse terms in N are determined only on the faces of grow(N.box(), -1) if obtained by averaging, i.e., on one less layer than where the normal components are known. If obtained by analytic methods, they are available everywhere.

Normally, N is calculated using script N to ensure freestream preservation. But in some cases, e.g., a 2-D solution on the surface of a sphere, there is no definition of script N. In those cases, m_useScriptN should be set to false and N will be calculated and averaged directly. The averaging ensures conservation but freestream-preservation is sacrificed. The value of m_useScriptN is obtained from the MultiBlockCoordSys and should be set to 'false' in the constructor of coordinate systems derived from class MultiBlockCoordSys. Otherwise, by default, it is set to true.

The following routines should be called from the corresponding routines with the same name derived AMRLevel:

Setup for the class is as follows:

  1. Call define to setup the class members -- metrics are still undefined.
  2. Optionally call initialGrid to set the new box layout on a level. This can be deferred until postInitialGrid if desired.
  3. Call postInitialGrid to set the new box layout (if not done in previous step) and define the metrics.

During a run, be sure to:

  1. Call postTimeStep to average down the metric terms from finer levels. This only has an effect if they changed on the finer level

For a regrid do the following:

  1. Call preRegrid to compute the new metrics and correct the solution on the old mesh to the metrics of the new mesh (snapback).
  2. Optionally call regrid to interpolate from the coarse mesh to the new fine mesh. This can be done is user code but must use FourthOrderMappedFineInterp to ensure a conservative and free-stream preserving interpolation on the mapped grid.

Note:
  • To facilitate products that involve gradients, the metrics (N) are determined on the faces of boxes with size ghostBox+2. This is labeled an 'NReqGhostBox' herein. At domain boundaries, the boxes for 'N' extend by 2 cells outside the physical domain and it is assumed that the mappings exist there. The determinants (J) are determined on the cells of boxes with size ghostBox+1. This is labeled a 'JReqGhostBox' herein. At domain boundaries, the boxes for 'J' extends by 1 cell outside the physical domain
  • Averages of fluxes. Most of the fluxes, <F>\ are stored as average quantities to be applied to a face and do not include area information. I.e., the actual flux across a 2-D face is $\langle F\rangle h^2$ Hence when correcting from fine to coarse, you want to average the fine <F> and then muliply by the area of the coarse face (although in most equations, the area cancels out with another term). However, the $\mathcal(N)^s$, which are a type of flux, are stored differently in that they have already been multiplied by the length term (equivalent to $\langle F\rangle h^2$ in the example above). Hence, these fluxes needed to be summed when correcting from coarse to fine.
  • WARNING! If transverse components of <N> are computed analytically, they are only averaged down when finer levels have changed before entering a postTimeStep (along with normal components). Consequently, it is currently difficult to know if they have been computed or averaged from a finer level at any given point. But note that if transverse components of <N> are computed by averaging from normal components, then they should always be consistent. **FIXME -- probably the best fix is to only average the normal components if transverse are computed analytically.

Easier access to AMRLevel data

const ProblemDomainproblemDomain () const
int level () const
int refRatio () const

Public Types

enum  AgeType { AgeOld = 0, AgeNew = 1, AgeNum = 2 }
 Age of metric terms during a regrid. More...
enum  TransverseNOpType { TransverseNOpNone, TransverseNOpAnalytic, TransverseNOpAverage }
 Type of operation for computing transverse terms in N. More...

Public Member Functions

 LevelGridMetrics (const int a_nComp, const int a_spaceOrder)
 Constructor.
virtual ~LevelGridMetrics ()
 Destructor.
void clear ()
 Free memory.
bool hasFiner () const
 Does a finer level exist?
bool hasCoarser () const
 Does a coarser level exist?
void define (AMRLevel *const a_AMRLevel, MultiBlockCoordSysFactory *const a_coordSysFact, LevelGridMetrics *const a_coarserLevelGridMetrics, const RealVect &a_dxVect, const IntVect &a_ghostVect, const TransverseNOpType a_transverseNOpType=TransverseNOpNone, const bool a_haveMultiBlockVectorData=true, const int a_numBlocks=1)
 Define the class. No metrics terms are yet available.
void define (AMRLevel *const a_AMRLevel, MultiBlockCoordSys *const a_coordSys, LevelGridMetrics *const a_coarserLevelGridMetrics, const RealVect &a_dxVect, const IntVect &a_ghostVect, const TransverseNOpType a_transverseNOpType=TransverseNOpNone, const bool a_haveMultiBlockVectorData=true, const int a_numBlocks=1)
 Define the class. No metrics terms are yet available.
bool metricsDefined () const
 Are the metrics defined on this level?
bool didFinerChange () const
 Did the metrics change on the finer mesh?
const MultiBlockCoordSysgetCoordSys () const
 Retrieve the multi-block coordinate system.
const NewCoordSysgetCoordSys2 (const Box &box) const
 Get the coordinate system.
const NewFourthOrderCoordSysgetCoordSys (const Box &box) const
int getBlock (const Box &a_box) const
 Get the block index.
const ProblemDomainblockDomain (const Box &a_box, const int a_numGhost=0)
 Get a problem domain representing a block.
const RealVectdxVect () const
 Get the computational mesh spacing.
void postTimeStep ()
 After a time step, average down $N$ and $J$.
virtual void initialGrid (const DisjointBoxLayout *const a_newGrid)
 Set up initial grid.
void postInitialGrid (const DisjointBoxLayout *const a_newGrid)
 Set up the initial metric terms.
void preRegrid (const int a_baseLevel, const DisjointBoxLayout &a_newGrid, const LevelData< FArrayBox > *const a_coarseUOldPtr, LevelData< FArrayBox > &a_UOld, LevelData< FArrayBox > &a_JUOld)
 Compute new metrics and correct the solution on the coarser meshes.
virtual void regrid (LevelData< FArrayBox > &a_JU, const LevelData< FArrayBox > &a_CrU, const LevelData< FArrayBox > &a_CrJU, const Interval &a_vectorIntv)
 Regrid operations -- performs a coarse to fine interpolation.
virtual void fillFineGhostCells (LevelData< FArrayBox > &a_U, LevelData< FArrayBox > &a_JU, Real a_time=-1)
 Fill invalid fine ghost cells (with preset CrFnU).
void computeValidU (LevelData< FArrayBox > &a_U, const LevelData< FArrayBox > &a_JU)
 Computes <U> in valid cells.
void multiblockExchangeU (LevelData< FArrayBox > &a_U, const Interval &a_vectorIntv) const
 Exchange <U> across multiblock boundaries.
void timeIntermediate (const TimeInterpolatorRK4 &a_timeInterpolator, const Real &a_timeInterpCoeff, const int &a_stage, const Interval &a_vectorIntv)
 Supports a call to TimeInterpolatorRK4::intermediate for multi-block grids.
LevelData< FArrayBox > & presetCr2ThisInterpolatorCrFnLevU ()
 Set the coarsened-fine <U> used by the interpolator (CrFn access).
LevelData< FArrayBox > & presetCr2ThisInterpolatorCrFnLevJU ()
 Set the coarsened-fine <JU> used by the interpolator (CrFn access).
void presetThis2FnInterpolatorCrFnLevU (const LevelData< FArrayBox > &a_CrLevU, const Interval &a_vectorIntv)
 Set the coarsened-fine <U> used by the interpolator.
void invalidateCr2ThisInterpolatorCrFnLevData ()
 Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.
void invalidateThis2FnInterpolatorCrFnLevData ()
 Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.
const IntVectinterpolatorCrFnNumGhost (const bool a_force=false) const
 Number of ghosts used to build the coarsened-fine data in the interpolator.
bool isMultiblock () const
 Is this a multiblock grid.
Consistent access to structural boxes
There are several places to get the boxes and interators from but all should be the same. These functions provide consistent access with sizes relevant to the metrics.

const DisjointBoxLayoutgetBoxes () const
 Get the boxes.
DataIterator getDataIterator () const
 Get a level iterator.
Box resizeWithGhosts (const Box &box) const
 Resize a box to include the ghost cells.
virtual IntVect getJReqGhostVect () const
 Determine the ghost vector required for $J$.
virtual IntVect getNReqGhostVect () const
 Determine the ghost vector required for $N$.
Box resizeWithJReqGhosts (const Box &box) const
 Resize a box to the size required for $J$.
Box resizeWithNReqGhosts (const Box &box) const
 Resize a box to the size required for $N$.

Static Public Member Functions

static int bufferSize4thO (const std::vector< int > &a_refRatio, const int a_maxLevel, const int a_numGhost)
 Compute the minimum grid buffer size for a fourth-order interpolation.

Public Attributes

LevelData< FluxBoxm_N
 $\mathbf(N)$ on each face
LevelData< FArrayBoxm_J

Protected Member Functions

void defineMetrics ()
 Completely define the metrics for this level.
void undefineMetrics ()
 Label this and all finer levels as having undefined metrics.
void faceNormalN (LevelData< FluxBox > &a_N, const LevelData< CodimBox< FArrayBox > > &a_scrN)
 Compute $N$ on the hyperfaces from $\mathcal{N}^s$.
void getN (LevelData< FluxBox > &a_N)
 Compute $N$ on the hyperfaces from $\mathcal{N}^s$.
void faceTransverseN (LevelData< FluxBox > &a_N)
 Add transverse components to $N$.
void getScriptN (LevelData< CodimBox< FArrayBox > > &a_scrN)
 Integrate $\mathcal{N}^s$ on each hyperedge.
void averageScriptN (const bool a_isBase, LevelData< CodimBox< FArrayBox > > &a_scrN)
 Average $\mathcal{N}^s$.
void averageN (const bool a_isBase, LevelData< FluxBox > &a_N)
 Average $N$ directly if $\mathcal{N}^s$ doesn't exist.
void getVolFlux (LevelData< FluxBox > &a_NtX, const LevelData< FluxBox > &a_N)
 Compute the volume flux.
virtual void setAvgJfromNtX (LevelData< FluxBox > &a_NtX)
 Take divergence of $N^T X$ to set m_J.
void averageVolFlux (const bool a_isBase, LevelData< FluxBox > &a_NtX, const AgeType a_age)
 Average the volume flux $N^T X$.
void volFluxCascade ()
 Compute $N^T X$ on all finer levels and average down.
void averageSnapbackSolFlux (const bool a_isBase, LevelData< FluxBox > &a_NtFDiff)
 Average the snapback solution flux, $N^T F$.
virtual void defineGrids (const DisjointBoxLayout &a_grids)
 Store the DisjointBoxLayout and define multiblock structures.
void defineGridsNP (const DisjointBoxLayout &a_grids)
 Create a non-periodic DisjointBoxLayout.

Static Protected Member Functions

static int verbosity ()

Protected Attributes

CoarseAverageCodimm_scrNAverager
CoarseAverageFacem_NAverager
CoarseAverageFacem_NtXAverager [AgeNum]
IntersectionAverageFacem_NtFDiffAverager
MultiBlockCoordSysm_coordSys
 The multi-block coordinate system.
LevelGridMetricsm_finerLevelGridMetrics
 Grid metrics on the next finer level.
LevelGridMetricsm_coarserLevelGridMetrics
AMRLevelm_parentAMRLevel
 The AMR level we are attached to.
IntVect m_ghostVect
 Ghost cell vector.
DisjointBoxLayout m_grids
 Grid layout.
DisjointBoxLayout m_gridsNP
RealVect m_dxVect
 Mesh spacing in each direction.
const int m_spaceOrder
 Spatial-order of accuracy - must be 4.
FourthOrderMappedFineInterpm_interpolator
ProblemDomain m_cachedBlockDomain
int m_cachedBlockIdx
 Index of the cached block.
int m_cachedBlockNG
MultiBlockLevelGeom m_mbgeo
 Topology of the multiblock layout.
MultiBlockLevelExchangeAverage m_mbex
MultiBlockFaceRegisterm_Nmbreg
MultiBlockFaceRegisterm_NtXmbreg [AgeNum]
TransverseNOpType m_transverseNOpType
bool m_metricsChanged
bool m_metricsDefined
bool m_useScriptN
bool m_isMultiblock
 T - A multiblock coordinates system.
bool m_haveMultiBlockVectorData

Static Protected Attributes

static int s_verbosity

Private Member Functions

 LevelGridMetrics (const LevelGridMetrics &)
LevelGridMetricsoperator= (const LevelGridMetrics &)

Member Enumeration Documentation

Age of metric terms during a regrid.

Enumerator:
AgeOld 
AgeNew 
AgeNum 

Type of operation for computing transverse terms in N.

Enumerator:
TransverseNOpNone 
TransverseNOpAnalytic 
TransverseNOpAverage 


Constructor & Destructor Documentation

LevelGridMetrics::LevelGridMetrics ( const int  a_nComp,
const int  a_spaceOrder 
)

Constructor.

virtual LevelGridMetrics::~LevelGridMetrics (  )  [virtual]

Destructor.

LevelGridMetrics::LevelGridMetrics ( const LevelGridMetrics  )  [private]


Member Function Documentation

LevelGridMetrics& LevelGridMetrics::operator= ( const LevelGridMetrics  )  [private]

void LevelGridMetrics::clear (  ) 

Free memory.

bool LevelGridMetrics::hasFiner (  )  const

Does a finer level exist?

Referenced by interpolatorCrFnNumGhost(), and presetThis2FnInterpolatorCrFnLevU().

bool LevelGridMetrics::hasCoarser (  )  const

void LevelGridMetrics::define ( AMRLevel *const   a_AMRLevel,
MultiBlockCoordSysFactory *const   a_coordSysFact,
LevelGridMetrics *const   a_coarserLevelGridMetrics,
const RealVect a_dxVect,
const IntVect a_ghostVect,
const TransverseNOpType  a_transverseNOpType = TransverseNOpNone,
const bool  a_haveMultiBlockVectorData = true,
const int  a_numBlocks = 1 
)

Define the class. No metrics terms are yet available.

void LevelGridMetrics::define ( AMRLevel *const   a_AMRLevel,
MultiBlockCoordSys *const   a_coordSys,
LevelGridMetrics *const   a_coarserLevelGridMetrics,
const RealVect a_dxVect,
const IntVect a_ghostVect,
const TransverseNOpType  a_transverseNOpType = TransverseNOpNone,
const bool  a_haveMultiBlockVectorData = true,
const int  a_numBlocks = 1 
)

Define the class. No metrics terms are yet available.

bool LevelGridMetrics::metricsDefined (  )  const [inline]

Are the metrics defined on this level?

After preRegrid, this also indicates if a level is used.

Returns:
T - yes.

References m_metricsDefined.

bool LevelGridMetrics::didFinerChange (  )  const [inline]

Did the metrics change on the finer mesh?

Returns:
T - yes.

References m_finerLevelGridMetrics, and m_metricsChanged.

const MultiBlockCoordSys & LevelGridMetrics::getCoordSys (  )  const [inline]

Retrieve the multi-block coordinate system.

References m_coordSys.

const NewCoordSys * LevelGridMetrics::getCoordSys2 ( const Box box  )  const [inline]

Get the coordinate system.

Parameters:
[in] box Assigned to this box

References MultiBlockCoordSys::getCoordSys(), and m_coordSys.

const NewFourthOrderCoordSys * LevelGridMetrics::getCoordSys ( const Box box  )  const [inline]

Parameters:
[in] box Assigned to this box

References MultiBlockCoordSys::getCoordSys(), and m_coordSys.

int LevelGridMetrics::getBlock ( const Box a_box  )  const [inline]

Get the block index.

Parameters:
[in] a_box Assigned to this interior box
Returns:
Block index

References m_coordSys, and MultiBlockCoordSys::whichBlock().

Referenced by blockDomain().

const ProblemDomain & LevelGridMetrics::blockDomain ( const Box a_box,
const int  a_numGhost = 0 
) [inline]

Get a problem domain representing a block.

Parameters:
[in] a_box Assigned to this interior box
[in] a_numGhost The number of ghosts that the box representing the block should be grown by before cropping. Cropping *only* occurs at boundaries defined by the physical domain
Returns:
If singleblock, the problem domain. If multiblock, non-periodic problem domain representing the block
Note:
  • If single block, the problem domain must be cached when the coordSys is defined

References CH_assert, ProblemDomain::define(), getBlock(), grow(), isMultiblock(), MultiBlockCoordSys::keepInDomain(), m_cachedBlockDomain, m_cachedBlockIdx, m_cachedBlockNG, m_coordSys, and MultiBlockCoordSys::mappingBlocks().

const RealVect & LevelGridMetrics::dxVect (  )  const [inline]

Get the computational mesh spacing.

Returns:
Mesh spacing in each direction

References m_dxVect.

void LevelGridMetrics::postTimeStep (  ) 

After a time step, average down $N$ and $J$.

virtual void LevelGridMetrics::initialGrid ( const DisjointBoxLayout *const   a_newGrid  )  [virtual]

Set up initial grid.

void LevelGridMetrics::postInitialGrid ( const DisjointBoxLayout *const   a_newGrid  ) 

Set up the initial metric terms.

void LevelGridMetrics::preRegrid ( const int  a_baseLevel,
const DisjointBoxLayout a_newGrid,
const LevelData< FArrayBox > *const   a_coarseUOldPtr,
LevelData< FArrayBox > &  a_UOld,
LevelData< FArrayBox > &  a_JUOld 
)

Compute new metrics and correct the solution on the coarser meshes.

virtual void LevelGridMetrics::regrid ( LevelData< FArrayBox > &  a_JU,
const LevelData< FArrayBox > &  a_CrU,
const LevelData< FArrayBox > &  a_CrJU,
const Interval a_vectorIntv 
) [virtual]

Regrid operations -- performs a coarse to fine interpolation.

virtual void LevelGridMetrics::fillFineGhostCells ( LevelData< FArrayBox > &  a_U,
LevelData< FArrayBox > &  a_JU,
Real  a_time = -1 
) [virtual]

Fill invalid fine ghost cells (with preset CrFnU).

void LevelGridMetrics::computeValidU ( LevelData< FArrayBox > &  a_U,
const LevelData< FArrayBox > &  a_JU 
)

Computes <U> in valid cells.

static int LevelGridMetrics::bufferSize4thO ( const std::vector< int > &  a_refRatio,
const int  a_maxLevel,
const int  a_numGhost 
) [static]

Compute the minimum grid buffer size for a fourth-order interpolation.

void LevelGridMetrics::multiblockExchangeU ( LevelData< FArrayBox > &  a_U,
const Interval a_vectorIntv 
) const

Exchange <U> across multiblock boundaries.

void LevelGridMetrics::timeIntermediate ( const TimeInterpolatorRK4 a_timeInterpolator,
const Real a_timeInterpCoeff,
const int &  a_stage,
const Interval a_vectorIntv 
)

Supports a call to TimeInterpolatorRK4::intermediate for multi-block grids.

const DisjointBoxLayout & LevelGridMetrics::getBoxes (  )  const [inline]

Get the boxes.

References m_grids.

Referenced by getDataIterator().

DataIterator LevelGridMetrics::getDataIterator (  )  const [inline]

Get a level iterator.

References BoxLayout::dataIterator(), and getBoxes().

Box LevelGridMetrics::resizeWithGhosts ( const Box box  )  const [inline]

Resize a box to include the ghost cells.

References grow(), and m_ghostVect.

IntVect LevelGridMetrics::getJReqGhostVect (  )  const [inline, virtual]

Determine the ghost vector required for $J$.

This is +1 over the ghost box to allow for derivatives needed to manipulate products

References IntVect::Unit.

Referenced by resizeWithJReqGhosts().

IntVect LevelGridMetrics::getNReqGhostVect (  )  const [inline, virtual]

Determine the ghost vector required for $N$.

This is +2 over the ghost box to allow for tangential derivatives needed to compute the volume flux

References IntVect::Unit.

Referenced by resizeWithNReqGhosts().

Box LevelGridMetrics::resizeWithJReqGhosts ( const Box box  )  const [inline]

Resize a box to the size required for $J$.

References getJReqGhostVect(), and grow().

Box LevelGridMetrics::resizeWithNReqGhosts ( const Box box  )  const [inline]

Resize a box to the size required for $N$.

References getNReqGhostVect(), and grow().

LevelData< FArrayBox > & LevelGridMetrics::presetCr2ThisInterpolatorCrFnLevU (  )  [inline]

Set the coarsened-fine <U> used by the interpolator (CrFn access).

Grids must have been defined for the interpolator. Returns a coarsening of 'this' level to be filled externally using a copyTo. 'this' is the fine level. I.e., 'this' is the fine level.

References CH_assert, hasCoarser(), m_coarserLevelGridMetrics, m_interpolator, and FourthOrderMappedFineInterp::presetCrFnLevU().

LevelData< FArrayBox > & LevelGridMetrics::presetCr2ThisInterpolatorCrFnLevJU (  )  [inline]

Set the coarsened-fine <JU> used by the interpolator (CrFn access).

Grids must have been defined for the interpolator. Returns a coarsening of 'this' level to be filled externally using a copyTo. 'this' is the fine level. I.e., 'this' is the fine level.

References CH_assert, hasCoarser(), m_coarserLevelGridMetrics, m_interpolator, and FourthOrderMappedFineInterp::presetCrFnLevJU().

void LevelGridMetrics::presetThis2FnInterpolatorCrFnLevU ( const LevelData< FArrayBox > &  a_CrLevU,
const Interval a_vectorIntv 
) [inline]

Set the coarsened-fine <U> used by the interpolator.

Grids must have been defined for the interpolator. Returns a coarsening of 'this' level. I.e., 'this' is the fine level. Grids must have been defined for the interpolator. Returns a coarsening of 'this' level. I.e., 'this' is the fine level. Grids must have been defined for the interpolator. Copies the coarse data from 'this' level to the coarsened-fine representation in the interpolator. 'this' is the coarse level.

Parameters:
[in] a_CrU <U> on the coarse level
[in] a_vectorIntv An interval in components of U consisting of vector data

References CH_assert, hasFiner(), m_interpolator, and FourthOrderMappedFineInterp::presetCrFnLevU().

void LevelGridMetrics::invalidateCr2ThisInterpolatorCrFnLevData (  )  [inline]

Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.

Grids must have been defined for the interpolator. Copies the coarse data from 'this' level to the coarsened-fine representation in the interpolator. 'this' is the coarse level. 'this' is the fine level. If data goes out-of-date on the coarser level, then the interpolator, for interpolating to 'this' level, has out-of-date coarsened-fine data. There must be a coarser level

References CH_assert, hasCoarser(), FourthOrderMappedFineInterp::invalidateCrFnLevData(), m_coarserLevelGridMetrics, and m_interpolator.

void LevelGridMetrics::invalidateThis2FnInterpolatorCrFnLevData (  )  [inline]

Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.

'this' is the coarse level. If data goes out-of-date on 'this' level, then the interpolator, for interpolating to the next finer level, has out-of-date coarsened-fine data. You can invalidate even if there is no finer level.

References FourthOrderMappedFineInterp::invalidateCrFnLevData(), and m_interpolator.

const IntVect & LevelGridMetrics::interpolatorCrFnNumGhost ( const bool  a_force = false  )  const [inline]

Number of ghosts used to build the coarsened-fine data in the interpolator.

Parameters:
[in] a_force T - avoid assertion checking. F - (default)
Note:
  • The caller should ensure that a finer level exists if the assertion is disabled. Commonly, the return value is required inbetween initialGrid() and postInitialGrid() where the metrics have not yet been defined (so the assertion would fail) but the grid has been defined (so this value is known).

References CH_assert, FourthOrderMappedFineInterp::CrFnNumGhost(), hasFiner(), and m_interpolator.

bool LevelGridMetrics::isMultiblock (  )  const [inline]

Is this a multiblock grid.

Returns:
T - Yes

References m_isMultiblock.

Referenced by blockDomain().

const ProblemDomain & LevelGridMetrics::problemDomain (  )  const [inline]

int LevelGridMetrics::level (  )  const [inline, protected]

int LevelGridMetrics::refRatio (  )  const [inline, protected]

static int LevelGridMetrics::verbosity (  )  [static, protected]

void LevelGridMetrics::defineMetrics (  )  [protected]

Completely define the metrics for this level.

void LevelGridMetrics::undefineMetrics (  )  [protected]

Label this and all finer levels as having undefined metrics.

void LevelGridMetrics::faceNormalN ( LevelData< FluxBox > &  a_N,
const LevelData< CodimBox< FArrayBox > > &  a_scrN 
) [protected]

Compute $N$ on the hyperfaces from $\mathcal{N}^s$.

void LevelGridMetrics::getN ( LevelData< FluxBox > &  a_N  )  [protected]

Compute $N$ on the hyperfaces from $\mathcal{N}^s$.

void LevelGridMetrics::faceTransverseN ( LevelData< FluxBox > &  a_N  )  [protected]

Add transverse components to $N$.

void LevelGridMetrics::getScriptN ( LevelData< CodimBox< FArrayBox > > &  a_scrN  )  [protected]

Integrate $\mathcal{N}^s$ on each hyperedge.

void LevelGridMetrics::averageScriptN ( const bool  a_isBase,
LevelData< CodimBox< FArrayBox > > &  a_scrN 
) [protected]

Average $\mathcal{N}^s$.

void LevelGridMetrics::averageN ( const bool  a_isBase,
LevelData< FluxBox > &  a_N 
) [protected]

Average $N$ directly if $\mathcal{N}^s$ doesn't exist.

void LevelGridMetrics::getVolFlux ( LevelData< FluxBox > &  a_NtX,
const LevelData< FluxBox > &  a_N 
) [protected]

Compute the volume flux.

virtual void LevelGridMetrics::setAvgJfromNtX ( LevelData< FluxBox > &  a_NtX  )  [protected, virtual]

Take divergence of $N^T X$ to set m_J.

void LevelGridMetrics::averageVolFlux ( const bool  a_isBase,
LevelData< FluxBox > &  a_NtX,
const AgeType  a_age 
) [protected]

Average the volume flux $N^T X$.

void LevelGridMetrics::volFluxCascade (  )  [protected]

Compute $N^T X$ on all finer levels and average down.

void LevelGridMetrics::averageSnapbackSolFlux ( const bool  a_isBase,
LevelData< FluxBox > &  a_NtFDiff 
) [protected]

Average the snapback solution flux, $N^T F$.

virtual void LevelGridMetrics::defineGrids ( const DisjointBoxLayout a_grids  )  [protected, virtual]

Store the DisjointBoxLayout and define multiblock structures.

void LevelGridMetrics::defineGridsNP ( const DisjointBoxLayout a_grids  )  [protected]

Create a non-periodic DisjointBoxLayout.


Member Data Documentation

$\mathbf(N)$ on each face

Physical cell volume divided by computational cell volume

Averager for $\mathcal(N)^s$. Only used if m_useScriptN == true

Averager for $N$ Only used if m_useScriptN == false

This averages the volume flux from a finer level. Averagers exist for old "AgeOld" and new "AgeNew" meshes during a regrid

Averager for the snapback solution flux. This averager only operates on the intersections of three layouts.

The multi-block coordinate system.

Referenced by blockDomain(), getBlock(), getCoordSys(), and getCoordSys2().

Grid metrics on the next finer level.

Referenced by didFinerChange().

The AMR level we are attached to.

Referenced by level(), problemDomain(), and refRatio().

Ghost cell vector.

Referenced by resizeWithGhosts().

Grid layout.

Referenced by getBoxes().

Non-periodic grid layout. This is a shallow copy of m_grids, with a non- periodic problem domain and a new neighbor iterator if problemDomain() is periodic.

Mesh spacing in each direction.

Referenced by dxVect().

const int LevelGridMetrics::m_spaceOrder [protected]

Spatial-order of accuracy - must be 4.

Constrained least-squares interpolator for interpolating <JU> from coarse to fine meshes. 'This' mesh is the coarse mesh.

Referenced by interpolatorCrFnNumGhost(), invalidateCr2ThisInterpolatorCrFnLevData(), invalidateThis2FnInterpolatorCrFnLevData(), presetCr2ThisInterpolatorCrFnLevJU(), presetCr2ThisInterpolatorCrFnLevU(), and presetThis2FnInterpolatorCrFnLevU().

Representing only the block (it is assumed periodic boundaries are not used for multiblock)

Referenced by blockDomain().

Index of the cached block.

Referenced by blockDomain().

Number of ghosts that the cached block was grown by.

Referenced by blockDomain().

Topology of the multiblock layout.

To exchange information across multiblock boundaries

Flux-like register for resolving $\mathbf{N}$ on faces at coarse- fine interfaces that overlap multiblock boundaries

Flux-like register for resolving $\mathbf{N}^T\mathbf{X}$ on faces at coarse-fine interfaces that overlap multiblock boundaries

Type of operatation for computing transverse terms in N

T - The metrics on this level have changed

Referenced by didFinerChange().

T - The metrics have been defined for this level

Referenced by metricsDefined().

For some mappings, it is not possible to define scriptN. In those cases, N is calculated and averaged directly. The solution is conservative but freestream- preservation is lost across coarse- fine interfaces. T - Script N is used (default). F - Script N is not used. N is calculated directly and freestream preservation is lost

T - A multiblock coordinates system.

Referenced by isMultiblock().

T - Space vector data will be exchanged across multiblock boundaries

int LevelGridMetrics::s_verbosity [static, protected]


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

Generated on Mon Mar 27 03:27:14 2017 for Chombo + EB + MF by  doxygen 1.5.5