12 #ifndef CD_EBGradient_H
13 #define CD_EBGradient_H
16 #include <EBLevelGrid.H>
17 #include <AggStencil.H>
21 #include <CD_NamespaceHeader.H>
73 const EBLevelGrid& a_eblgFine,
74 const EBLevelGrid& a_eblgFiCo,
79 const int a_weighting,
80 const IntVect a_ghostVector) noexcept;
100 define(const EBLevelGrid& a_eblg,
101 const EBLevelGrid& a_eblgFine,
102 const EBLevelGrid& a_eblgFiCo,
103 const
bool a_hasFine,
107 const
int a_weighting,
108 const IntVect a_ghostVector) noexcept;
116 computeLevelGradient(LevelData<EBCellFAB>& a_gradient, const LevelData<EBCellFAB>& a_phi) const noexcept;
137 const LevelData<EBCellFAB>& a_phi,
138 const LevelData<EBCellFAB>& a_phiFine) const noexcept;
267 defineMasks(LevelData<FArrayBox>& a_coarMaskCF, LevelData<FArrayBox>& a_coarMaskInvalid) noexcept;
275 defineIteratorsEBCF(const LevelData<FArrayBox>& a_coarMaskCF, const LevelData<FArrayBox>& a_coarMaskInvalid) noexcept;
300 const VolIndex& a_vof,
301 const EBISBox& a_ebisBox,
302 const DenseIntVectSet& a_invalidRegion,
303 const Real a_dx) const noexcept;
323 VoFStencil& a_stencilFine,
324 const VolIndex& a_vofCoar,
326 const EBISLayout& a_ebislCoar,
327 const EBISLayout& a_ebislFine,
328 const DataIndex& a_dit,
329 const DenseIntVectSet& a_validCellsCoar,
330 const DenseIntVectSet& a_validCellsFine,
331 const Real& a_dxCoar,
332 const Real& a_dxFine,
334 const
int& a_weight) const noexcept;
345 const EBISBox& a_ebisBox,
346 const FArrayBox& a_invalidRegion) const noexcept;
355 #include <CD_NamespaceFooter.H>
Declaration of cell positions.
Class for computing gradients in an EBAMR context.
Definition: CD_EBGradient.H:43
virtual ~EBGradient() noexcept
Destructor (does nothing)
Definition: CD_EBGradient.cpp:122
EBGradient(const EBGradient &a_other)=delete
Disallowed copy constructor.
virtual void makeAggStencils() noexcept
Turn raw stencils into optimized AggStencils.
Definition: CD_EBGradient.cpp:1080
virtual bool isFiniteDifferenceStencilValid(const IntVect &a_ivCoar, const EBISBox &a_ebisBox, const FArrayBox &a_invalidRegion) const noexcept
Check if a cell can produce valid finite difference stencils.
Definition: CD_EBGradient.cpp:521
bool m_hasEBCF
True if we have EBCF crossings that require special stencils.
Definition: CD_EBGradient.H:184
virtual void computeLevelGradient(LevelData< EBCellFAB > &a_gradient, const LevelData< EBCellFAB > &a_phi) const noexcept
Compute gradient using data on the input level only.
Definition: CD_EBGradient.cpp:128
EBLevelGrid m_eblgFine
Fine grids.
Definition: CD_EBGradient.H:164
virtual void define(const EBLevelGrid &a_eblg, const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgFiCo, const bool a_hasFine, const Real a_dx, const int a_refRat, const int a_order, const int a_weighting, const IntVect a_ghostVector) noexcept
Define function.
Definition: CD_EBGradient.cpp:49
EBLevelGrid m_eblgFiCo
Refined coarse grids.
Definition: CD_EBGradient.H:169
Real m_dxFine
Resolution on finer level.
Definition: CD_EBGradient.H:194
virtual void computeAMRGradient(LevelData< EBCellFAB > &a_gradient, const LevelData< EBCellFAB > &a_phi, const LevelData< EBCellFAB > &a_phiFine) const noexcept
Compute gradient using two-level stencils (matching at EBCF).
Definition: CD_EBGradient.cpp:282
bool m_isDefined
Is defined or not.
Definition: CD_EBGradient.H:174
virtual void defineStencilsEBCF(const LevelData< FArrayBox > &a_coarMaskInvalid) noexcept
Define stencils for interpolation across the EBCF refinement boundary.
Definition: CD_EBGradient.cpp:663
Real m_dx
Resolution on this level.
Definition: CD_EBGradient.H:189
virtual bool getLeastSquaresStencil(VoFStencil &a_stencilCoar, VoFStencil &a_stencilFine, const VolIndex &a_vofCoar, const CellLocation &a_dataLocation, const EBISLayout &a_ebislCoar, const EBISLayout &a_ebislFine, const DataIndex &a_dit, const DenseIntVectSet &a_validCellsCoar, const DenseIntVectSet &a_validCellsFine, const Real &a_dxCoar, const Real &a_dxFine, const int &a_order, const int &a_weight) const noexcept
Build a gradient stencil using least squares.
Definition: CD_EBGradient.cpp:864
int m_weighting
Weight (for least squares)
Definition: CD_EBGradient.H:204
LayoutData< BaseIVFAB< VoFStencil > > m_ebcfStencilsFine
Part of EBCF gradient stencil which reaches into the coarse level.
Definition: CD_EBGradient.H:235
bool m_hasFine
True if we have a finer level (m_eblgFine is defined)
Definition: CD_EBGradient.H:179
LayoutData< BaseIVFAB< VoFStencil > > m_levelStencils
Stencils for boundaries and cut-cells.
Definition: CD_EBGradient.H:225
LayoutData< RefCountedPtr< AggStencil< EBCellFAB, EBCellFAB > > > m_aggLevelStencils[SpaceDim]
AggStencils for boundaries and cut-cells. Provides faster application of m_levelStencils.
Definition: CD_EBGradient.H:241
Copier m_copier
Pre-built copier for making copying from m_eblg to m_eblgFiCo go faster.
Definition: CD_EBGradient.H:219
virtual void defineIteratorsEBCF(const LevelData< FArrayBox > &a_coarMaskCF, const LevelData< FArrayBox > &a_coarMaskInvalid) noexcept
Define iterators and cells that need modified stencils.
Definition: CD_EBGradient.cpp:566
int m_refRat
Refinement factor between fine and coarse level.
Definition: CD_EBGradient.H:209
int m_order
Desired order for least squares stencils.
Definition: CD_EBGradient.H:199
EBLevelGrid m_eblg
Grids.
Definition: CD_EBGradient.H:159
static constexpr int m_comp
Scalar component to reach into.
Definition: CD_EBGradient.H:144
IntVect m_ghostVector
Number of ghost cells in incoming data holders.
Definition: CD_EBGradient.H:214
virtual void defineBuffers() noexcept
Define buffer data.
Definition: CD_EBGradient.cpp:772
virtual void computeNormalDerivative(LevelData< EBFluxFAB > &a_gradient, const LevelData< EBCellFAB > &a_phi) const noexcept
Compute the gradient component which is normal to the face, using centered differencing.
Definition: CD_EBGradient.cpp:211
EBGradient()=delete
Disallowed constructor.
virtual void defineMasks(LevelData< FArrayBox > &a_coarMaskCF, LevelData< FArrayBox > &a_coarMaskInvalid) noexcept
Make masks.
Definition: CD_EBGradient.cpp:430
LayoutData< VoFIterator > m_ebcfIterator
Iterator for EBCF cells.
Definition: CD_EBGradient.H:253
CellLocation m_dataLocation
How to interpret data locations.
Definition: CD_EBGradient.H:154
LayoutData< BaseIVFAB< VoFStencil > > m_ebcfStencilsCoar
Part of EBCF gradient stencil which reaches into the coarse level.
Definition: CD_EBGradient.H:230
LayoutData< VoFIterator > m_levelIterator
Iterator for boundary cells (either domain or EB)
Definition: CD_EBGradient.H:247
virtual bool getFiniteDifferenceStencil(VoFStencil &a_stencil, const VolIndex &a_vof, const EBISBox &a_ebisBox, const DenseIntVectSet &a_invalidRegion, const Real a_dx) const noexcept
Get a finite difference stencil, assuming that the data is cell-centered.
Definition: CD_EBGradient.cpp:780
virtual void defineLevelStencils() noexcept
Define level stencils.
Definition: CD_EBGradient.cpp:357
static constexpr int m_nComp
Number of components that are supported.
Definition: CD_EBGradient.H:149
Cell
Enum for distinguishing between cell locations.
Definition: CD_Location.H:30