11 #ifndef _LEVELGRIDMETRICS_H_ 12 #define _LEVELGRIDMETRICS_H_ 34 #include "NamespaceHeader.H" 254 const int a_spaceOrder);
276 bool hasFiner()
const;
279 bool hasCoarser()
const;
289 const bool a_haveMultiBlockVectorData =
true,
291 const int a_numBlocks = 1);
301 const bool a_haveMultiBlockVectorData =
true,
303 const int a_numBlocks = 1);
306 bool metricsDefined()
const;
309 bool didFinerChange()
const;
325 int getBlock(
const Box& a_box)
const;
328 const ProblemDomain& blockDomain(
const Box& a_box,
const int a_numGhost = 0);
345 void preRegrid(
const int a_baseLevel,
372 static int bufferSize4thO(
const std::vector<int>& a_refRatio,
373 const int a_maxLevel,
374 const int a_numGhost);
378 const Interval& a_vectorIntv)
const;
382 const Real& a_timeInterpCoeff,
395 Box resizeWithGhosts(
const Box&
box)
const;
398 virtual IntVect getJReqGhostVect()
const;
401 virtual IntVect getNReqGhostVect()
const;
404 Box resizeWithJReqGhosts(
const Box&
box)
const;
407 Box resizeWithNReqGhosts(
const Box&
box)
const;
435 void presetThis2FnInterpolatorCrFnLevU(
445 void invalidateCr2ThisInterpolatorCrFnLevData();
448 void invalidateThis2FnInterpolatorCrFnLevData();
451 const IntVect& interpolatorCrFnNumGhost(
const bool a_force =
false)
const;
454 bool isMultiblock()
const;
467 int refRatio()
const;
470 static int verbosity();
475 void defineMetrics();
478 void undefineMetrics();
497 void averageScriptN(
const bool a_isBase,
502 void averageN(
const bool a_isBase,
513 void averageVolFlux(
const bool a_isBase,
518 void volFluxCascade();
521 void averageSnapbackSolFlux(
const bool a_isBase,
655 return m_metricsDefined;
666 return m_finerLevelGridMetrics->m_metricsChanged;
677 return m_coordSys->getCoordSys(box);
695 return m_coordSys->getCoordSys(m_grids[dit()]);
732 return m_coordSys->whichBlock(a_box);
759 const int iBlock = getBlock(a_box);
761 if (iBlock != m_cachedBlockIdx || a_numGhost != m_cachedBlockNG)
763 m_cachedBlockIdx = iBlock;
764 m_cachedBlockNG = a_numGhost;
767 grow(m_coordSys->mappingBlocks()[iBlock], a_numGhost);
770 m_coordSys->keepInDomain(grownBlock, iBlock);
772 m_cachedBlockDomain.
define(grownBlock);
775 return m_cachedBlockDomain;
817 return grow(box, m_ghostVect);
844 return grow(box, getJReqGhostVect());
851 return grow(box, getNReqGhostVect());
864 return m_parentAMRLevel->level();
870 return m_parentAMRLevel->refRatio();
876 return m_parentAMRLevel->problemDomain();
891 return m_coarserLevelGridMetrics->m_interpolator->presetCrFnLevU();
905 return m_coarserLevelGridMetrics->m_interpolator->presetCrFnLevJU();
952 m_interpolator->presetCrFnLevU(a_CrLevU, a_vectorIntv);
984 m_coarserLevelGridMetrics->m_interpolator->invalidateCrFnLevData();
999 m_interpolator->invalidateCrFnLevData();
1025 return m_interpolator->CrFnNumGhost();
1036 return m_isMultiblock;
1039 #include "NamespaceFooter.H" IntersectionAverageFace(const LevelData< FluxBox > &a_A, const int a_nRef)
Constructor.
The class MultiBlockLevelGeom stores topological and geometric information.
Definition: MultiBlockLevelGeom.H:29
LevelData< FArrayBox > & presetCr2ThisInterpolatorCrFnLevU()
Set the coarsened-fine <U> used by the interpolator (CrFn access)
Definition: LevelGridMetrics.H:888
void presetThis2FnInterpolatorCrFnLevU(const LevelData< FArrayBox > &a_CrLevU, const Interval &a_vectorIntv)
Set the coarsened-fine <U> used by the interpolator.
Definition: LevelGridMetrics.H:947
Class to interpolate from coarse to valid fine cells on mapped grids.
void invalidateThis2FnInterpolatorCrFnLevData()
Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.
Definition: LevelGridMetrics.H:997
MultiBlockLevelExchangeAverage m_mbex
Definition: LevelGridMetrics.H:598
bool m_isMultiblock
T - A multiblock coordinates system.
Definition: LevelGridMetrics.H:631
const int m_spaceOrder
Spatial-order of accuracy - must be 4.
Definition: LevelGridMetrics.H:579
#define CH_assert(cond)
Definition: CHArray.H:37
FourthOrderMappedFineInterp * m_interpolator
Definition: LevelGridMetrics.H:583
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
const ProblemDomain & blockDomain(const Box &a_box, const int a_numGhost=0)
Get a problem domain representing a block.
Definition: LevelGridMetrics.H:754
IntVect m_ghostVect
Ghost cell vector.
Definition: LevelGridMetrics.H:571
Box resizeWithJReqGhosts(const Box &box) const
Resize a box to the size required for .
Definition: LevelGridMetrics.H:842
const ProblemDomain & problemDomain() const
Definition: LevelGridMetrics.H:874
Definition: MultiBlockFaceRegister.H:21
DisjointBoxLayout m_grids
Grid layout.
Definition: LevelGridMetrics.H:572
Definition: LevelGridMetrics.H:240
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewFourthOrderCoordSys.H:77
Abstract base class for time-dependent data at a level of refinement.
Definition: AMRLevel.H:47
IntersectionAverageFace * m_NtFDiffAverager
Definition: LevelGridMetrics.H:555
bool m_useScriptN
Definition: LevelGridMetrics.H:620
AgeType
Age of metric terms during a regrid.
Definition: LevelGridMetrics.H:229
Definition: DataIterator.H:190
bool metricsDefined() const
Are the metrics defined on this level?
Definition: LevelGridMetrics.H:653
CoarseAverageFace m_averager
Definition: LevelGridMetrics.H:92
void define(const IntVect &small, const IntVect &big)
CoarseAverageFace * m_NAverager
Definition: LevelGridMetrics.H:548
TransverseNOpType
Type of operation for computing transverse terms in N.
Definition: LevelGridMetrics.H:237
static int s_verbosity
Definition: LevelGridMetrics.H:636
IntersectionAverageFace & operator=(const IntersectionAverageFace &)
Box resizeWithNReqGhosts(const Box &box) const
Resize a box to the size required for .
Definition: LevelGridMetrics.H:849
Definition: EBInterface.H:45
bool didFinerChange() const
Did the metrics change on the finer mesh?
Definition: LevelGridMetrics.H:664
virtual IntVect getJReqGhostVect() const
Determine the ghost vector required for .
Definition: LevelGridMetrics.H:825
DisjointBoxLayout m_gridsNP
Definition: LevelGridMetrics.H:573
void getBoxes(Vector< Vector< Box > > &a_boxes, Vector< int > &a_refRat, const Box &a_domain)
Definition: CoarseAverageCodim.H:27
const DisjointBoxLayout & getBoxes() const
Get the boxes.
Definition: LevelGridMetrics.H:801
Structure for passing component ranges in code.
Definition: Interval.H:23
static const IntVect Unit
Definition: IntVect.H:663
DataIterator getDataIterator() const
Get a level iterator.
Definition: LevelGridMetrics.H:808
Average from fine intersections.
Definition: LevelGridMetrics.H:67
double Real
Definition: REAL.H:33
Grid metrics for a level.
Definition: LevelGridMetrics.H:223
const int m_nComp
Number of components in A (same as C)
Definition: LevelGridMetrics.H:89
int getBlock(const Box &a_box) const
Get the block index.
Definition: LevelGridMetrics.H:730
bool m_metricsDefined
Definition: LevelGridMetrics.H:618
Box grow(const Box &b, int i)
Definition: Box.H:2277
Box resizeWithGhosts(const Box &box) const
Resize a box to include the ghost cells.
Definition: LevelGridMetrics.H:815
void invalidateCr2ThisInterpolatorCrFnLevData()
Invalidate the CrFn data, both <U> and <JU>\, used by the interpolator.
Definition: LevelGridMetrics.H:981
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
Time interpolator class using 4th-order Runge-Kutta.
Definition: TimeInterpolatorRK4.H:24
int m_cachedBlockNG
Definition: LevelGridMetrics.H:595
replaces face-centered coarse-level data w/ averaged fine-level data
Definition: CoarseAverageFace.H:24
int m_cachedBlockIdx
Index of the cached block.
Definition: LevelGridMetrics.H:594
LevelData< FArrayBox > & presetCr2ThisInterpolatorCrFnLevJU()
Set the coarsened-fine <JU> used by the interpolator (CrFn access)
Definition: LevelGridMetrics.H:902
ProblemDomain m_cachedBlockDomain
Definition: LevelGridMetrics.H:591
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
CoarseAverageCodim * m_scrNAverager
Definition: LevelGridMetrics.H:546
bool m_metricsChanged
Definition: LevelGridMetrics.H:616
int refRatio() const
Definition: LevelGridMetrics.H:868
LevelData< FluxBox > m_N
on each face
Definition: LevelGridMetrics.H:537
bool m_haveMultiBlockVectorData
Definition: LevelGridMetrics.H:632
Definition: LevelGridMetrics.H:239
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
bool isMultiblock() const
Is this a multiblock grid.
Definition: LevelGridMetrics.H:1034
An FArrayBox container for storage on the codimensions of a box.
Definition: CodimBox.H:65
LevelGridMetrics * m_finerLevelGridMetrics
Grid metrics on the next finer level.
Definition: LevelGridMetrics.H:563
MultiBlockCoordSys * m_coordSys
The multi-block coordinate system.
Definition: LevelGridMetrics.H:561
void copyTo(LevelData< FluxBox > &a_C, const DisjointBoxLayout &a_dblB)
Copy the average using a mask.
virtual IntVect getNReqGhostVect() const
Determine the ghost vector required for .
Definition: LevelGridMetrics.H:835
const int m_nRef
Refinement between A & C.
Definition: LevelGridMetrics.H:90
int level() const
Definition: LevelGridMetrics.H:862
const NewCoordSys * getCoordSys2(const Box &box) const
Get the coordinate system.
Definition: LevelGridMetrics.H:675
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
pure-virtual base class defining factory interface for MultiBlockCoordSys
Definition: MultiBlockCoordSys.H:409
LevelGridMetrics * m_coarserLevelGridMetrics
Definition: LevelGridMetrics.H:565
TransverseNOpType m_transverseNOpType
Definition: LevelGridMetrics.H:613
const RealVect & dxVect() const
Get the computational mesh spacing.
Definition: LevelGridMetrics.H:784
Interpolate from coarse cells to valid fine cells on mapped grids.
Definition: FourthOrderMappedFineInterp.H:153
const IntVect & interpolatorCrFnNumGhost(const bool a_force=false) const
Number of ghosts used to build the coarsened-fine data in the interpolator.
Definition: LevelGridMetrics.H:1019
The class MultiBlockLevelExchangeAverage stores topological and geometric information for cell-averag...
Definition: MultiBlockLevelExchangeAverage.H:25
const MultiBlockCoordSys & getCoordSys() const
Retrieve the multi-block coordinate system.
Definition: LevelGridMetrics.H:681
MultiBlockLevelGeom m_mbgeo
Topology of the multiblock layout.
Definition: LevelGridMetrics.H:597
MultiBlockFaceRegister * m_Nmbreg
Definition: LevelGridMetrics.H:601
DisjointBoxLayout m_crDblA
Coarsened layout for A.
Definition: LevelGridMetrics.H:91
RealVect m_dxVect
Mesh spacing in each direction.
Definition: LevelGridMetrics.H:578
Virtual base class encapsulating mapped-grid coordinate systems.
Definition: NewCoordSys.H:30
AMRLevel * m_parentAMRLevel
The AMR level we are attached to.
Definition: LevelGridMetrics.H:569
LevelData< FArrayBox > m_J
Definition: LevelGridMetrics.H:538