13#ifndef CD_POLYHEDRALEBGRAPH_H
14#define CD_POLYHEDRALEBGRAPH_H
19#include <DisjointBoxLayout.H>
21#include <IntVectSet.H>
22#include <LayoutData.H>
24#include <ProblemDomain.H>
30#include <CD_NamespaceHeader.H>
142 define(
const BaseIF& a_function,
143 const Vector<Box>& a_cutTiles,
144 const ProblemDomain& a_domain,
145 const RealVect& a_probLo,
147 const int a_numGhost,
148 const Vector<Box>& a_covered,
150 const bool a_fillSplitFluid);
270 const BaseIF& a_function,
271 const BaseFab<Real>& a_nodeValues,
273 const Vector<Box>& a_covered,
274 const RealVect& a_probLo,
276 const bool a_fillSplitFluid);
290 isFilled(
const BaseFab<signed char>& a_states,
291 const BaseFab<signed char>& a_refined,
292 const IntVectSet& a_withSurface,
293 const IVSFAB<PolyhedralEB::CutCellSurface>& a_surfaces,
294 const IntVect& a_cell);
315 getDx() const noexcept;
321 const DisjointBoxLayout&
328 const LayoutData<IntVectSet>&
337 const LevelData<BaseFab<
signed char>>&
344 const LevelData<BaseFab<
signed char>>&
352 const LevelData<BaseFab<
signed char>>&
360 const LevelData<IVSFAB<PolyhedralEB::CutCellSurface>>&
367 LevelData<IVSFAB<PolyhedralEB::CutCellSurface>>&
377 const LayoutData<IntVectSet>&
385 const LayoutData<PolyhedralEB::CutCellFaceOverrides>&
392 LayoutData<PolyhedralEB::CutCellFaceOverrides>&
401 markCarried(LevelData<BaseFab<
signed char>>& a_carried) const;
415 const
int a_ghost) const;
427 promoteToCut(const DataIndex& a_dit, const IntVect& a_cell);
436 markSurfaces(LevelData<BaseFab<
signed char>>& a_mask) const;
549 defineGhostCells(const BaseIF& a_function, const LevelData<BaseFab<
signed char>>& a_carried);
579 const LevelData<BaseFab<
signed char>>& a_carried,
580 const LevelData<BaseFab<
signed char>>* a_coarserFilled,
581 const
bool a_fillSplitFluid);
591#include <CD_NamespaceFooter.H>
Declaration of the faces of a box's cut cells that their own surfaces do not describe.
Declaration of the data a cut cell's embedded boundary is reconstructed from.
void beginAnchoring(const LevelData< BaseFab< signed char > > &a_carried)
Record which cells anchor fluid before any of it is spread, for fillSealedCells.
Definition CD_PolyhedralEBGraph.cpp:630
static constexpr int s_cut
Cell states, in the convention the polyhedral generator hands the index space.
Definition CD_PolyhedralEBGraph.H:62
void addGhostSurfaceCells()
Put into every box's surface set the ghost cells whose owning tile keeps a surface for them.
Definition CD_PolyhedralEBGraph.cpp:1471
bool isDefined() const noexcept
Whether define has run.
Definition CD_PolyhedralEBGraph.cpp:1676
void defineOuterFaces(const LevelData< BaseFab< signed char > > &a_carried)
Mark the open faces that lie in the domain boundary, and those onto cells no tile of this level carri...
Definition CD_PolyhedralEBGraph.cpp:1533
static constexpr int s_filledPieces
Why a cell was filled: its fluid falls into more than one piece, which one body cannot hold.
Definition CD_PolyhedralEBGraph.H:102
const LevelData< BaseFab< signed char > > & getRefinedMask() const noexcept
Whether the finer level carries a cell, one where it does, with two ghost cells; all zero until link ...
Definition CD_PolyhedralEBGraph.cpp:1718
const LayoutData< PolyhedralEB::CutCellFaceOverrides > & getFaceOverrides() const noexcept
The faces of every box's cut cells, own and ghost, that their surfaces do not describe.
Definition CD_PolyhedralEBGraph.cpp:1742
const DisjointBoxLayout & getGrids() const noexcept
The layout over the cut tiles.
Definition CD_PolyhedralEBGraph.cpp:1694
virtual ~PolyhedralEBGraph()
Destructor.
Definition CD_PolyhedralEBGraph.cpp:37
LevelData< BaseFab< signed char > > m_anchored
Anchoring, from beginAnchoring until fillSealedCells: one where a cell's fluid reaches a regular cell...
Definition CD_PolyhedralEBGraph.H:503
void markSurfaces(LevelData< BaseFab< signed char > > &a_mask) const
Mark the cells that hold a surface.
Definition CD_PolyhedralEBGraph.cpp:1407
const ProblemDomain & getDomain() const noexcept
The level's domain.
Definition CD_PolyhedralEBGraph.cpp:1682
bool m_isDefined
Whether define has run.
Definition CD_PolyhedralEBGraph.H:442
static constexpr int s_faceSameLevel
Face states: the face opens onto a cell of this level.
Definition CD_PolyhedralEBGraph.H:77
void defineGhostCells(const BaseIF &a_function, const LevelData< BaseFab< signed char > > &a_carried)
Classify the ghost cells no tile of this level carries from their corners, and take the ghost cut cel...
Definition CD_PolyhedralEBGraph.cpp:1006
LayoutData< IntVectSet > m_cutCells
Cut cells of every box.
Definition CD_PolyhedralEBGraph.H:480
void markCarried(LevelData< BaseFab< signed char > > &a_carried) const
Mark the cells some tile of this level carries: one in every valid cell and in every ghost cell anoth...
Definition CD_PolyhedralEBGraph.cpp:1384
virtual void define(const BaseIF &a_function, const Vector< Box > &a_cutTiles, const ProblemDomain &a_domain, const RealVect &a_probLo, const Real a_dx, const int a_numGhost, const Vector< Box > &a_covered, const PolyhedralEBGraph *a_coarser, const bool a_fillSplitFluid)
Build the graph of one level over its cut tiles.
Definition CD_PolyhedralEBGraph.cpp:43
static bool isFilled(const BaseFab< signed char > &a_states, const BaseFab< signed char > &a_refined, const IntVectSet &a_withSurface, const IVSFAB< PolyhedralEB::CutCellSurface > &a_surfaces, const IntVect &a_cell)
Whether the graph filled a cell: covered, with corners that disagree, and not carried by the finer le...
Definition CD_PolyhedralEBGraph.cpp:345
const LayoutData< IntVectSet > & getCutCells() const noexcept
The cut cells of every box, its own and those of its ghost region that some tile carries.
Definition CD_PolyhedralEBGraph.cpp:1700
bool equals(const PolyhedralEBGraph &a_other) const
Whether another graph over the same layout holds the same cells, faces, mask and surfaces,...
Definition CD_PolyhedralEBGraph.cpp:1222
static long long anchorAcrossLevels(PolyhedralEBGraph &a_coarse, PolyhedralEBGraph &a_fine)
Carry anchoring across a level boundary, both ways.
Definition CD_PolyhedralEBGraph.cpp:778
void defineCells(const BaseIF &a_function, const LevelData< BaseFab< signed char > > &a_carried, const LevelData< BaseFab< signed char > > *a_coarserFilled, const bool a_fillSplitFluid)
Reconstruct and classify every cell of every box and its ghost region, keep the cut cells' surfaces w...
Definition CD_PolyhedralEBGraph.cpp:367
ProblemDomain m_domain
Domain of the level.
Definition CD_PolyhedralEBGraph.H:462
Real m_dx
Grid spacing of the level.
Definition CD_PolyhedralEBGraph.H:452
static constexpr int s_regular
Cell states, in the convention the polyhedral generator hands the index space.
Definition CD_PolyhedralEBGraph.H:67
void markCoarserFilled(LevelData< BaseFab< signed char > > &a_filled, const PolyhedralEBGraph &a_coarser, const int a_ghost) const
Mark the cells of this level, valid and ghost, that lie under a cell the coarser level filled.
Definition CD_PolyhedralEBGraph.cpp:1300
static constexpr int s_faceCoarser
Face states: the face opens onto a cell no tile of this level carries, which the coarser level does.
Definition CD_PolyhedralEBGraph.H:87
void promoteToCut(const DataIndex &a_dit, const IntVect &a_cell)
Make a regular or covered cell of a box, own or ghost, a cut cell of this level.
Definition CD_PolyhedralEBGraph.cpp:1438
static constexpr int s_filledGap
Why a cell was filled: its one piece of fluid is the smaller part of it, a gap between pieces of soli...
Definition CD_PolyhedralEBGraph.H:107
void markRefined()
Set m_refined from m_covered, over every box and its ghost cells.
Definition CD_PolyhedralEBGraph.cpp:1503
static void link(PolyhedralEBGraph &a_coarse, const PolyhedralEBGraph &a_fine)
Mark, on the coarse level, the faces that open onto cells the fine level carries.
Definition CD_PolyhedralEBGraph.cpp:1577
LevelData< IVSFAB< PolyhedralEB::CutCellSurface > > m_surfaces
Surface of every cell of m_surfaceCells.
Definition CD_PolyhedralEBGraph.H:513
int m_numGhost
Ghost cells the cell states are kept for.
Definition CD_PolyhedralEBGraph.H:447
void anchorUncarriedCells()
Anchor every cut ghost cell no tile carries, for a level with no coarser graph to answer for them.
Definition CD_PolyhedralEBGraph.cpp:901
LayoutData< PolyhedralEB::CutCellFaceOverrides > m_faceOverrides
Faces of every box's cut cells that their surfaces do not describe.
Definition CD_PolyhedralEBGraph.H:518
PolyhedralEBGraph()
Constructor. Leaves the graph undefined.
Definition CD_PolyhedralEBGraph.cpp:31
const LevelData< BaseFab< signed char > > & getFaceStates() const noexcept
The state of every face of every cell, one of the s_face constants; component 2 * dir + side.
Definition CD_PolyhedralEBGraph.cpp:1712
void defineGrids(const Vector< Box > &a_cutTiles)
Build the layout over the tiles, load balanced by cell count.
Definition CD_PolyhedralEBGraph.cpp:90
static constexpr int s_faceClosed
Face states: the face is closed, no fluid crosses it.
Definition CD_PolyhedralEBGraph.H:72
RealVect m_probLo
Lower-left corner of the domain.
Definition CD_PolyhedralEBGraph.H:457
LayoutData< IntVectSet > m_surfaceCells
Cells of every box that hold a surface.
Definition CD_PolyhedralEBGraph.H:508
static constexpr int s_faceBoundary
Face states: the face lies in the domain boundary and is open.
Definition CD_PolyhedralEBGraph.H:92
static constexpr int s_faceFiner
Face states: the face opens onto cells the finer level carries, and is described by them.
Definition CD_PolyhedralEBGraph.H:82
long long fillSealedCells()
Fill every cut cell anchoring did not reach, and let go of the anchoring.
Definition CD_PolyhedralEBGraph.cpp:925
long long spreadAnchors()
Spread anchoring through the open faces of this level until it stops.
Definition CD_PolyhedralEBGraph.cpp:675
static constexpr int s_notFilled
Why a cell was filled: it was not.
Definition CD_PolyhedralEBGraph.H:97
LevelData< BaseFab< signed char > > m_refined
One where the finer level carries the cell, with at least two ghost cells.
Definition CD_PolyhedralEBGraph.H:497
const LevelData< IVSFAB< PolyhedralEB::CutCellSurface > > & getSurfaces() const noexcept
The surface every cell of the surface sets is reconstructed from, in the box's own cells and in its g...
Definition CD_PolyhedralEBGraph.cpp:1724
const LayoutData< IntVectSet > & getSurfaceCells() const noexcept
The cells of every box that hold a surface: every cut cell of its set, and every cell,...
Definition CD_PolyhedralEBGraph.cpp:1736
static void findUnresolvedCells(BaseFab< signed char > &a_unresolved, const BaseIF &a_function, const BaseFab< Real > &a_nodeValues, const Box &a_region, const Vector< Box > &a_covered, const RealVect &a_probLo, const Real a_dx, const bool a_fillSplitFluid)
Find the cells of a region that one body cannot describe, or that are mostly a gap of fluid.
Definition CD_PolyhedralEBGraph.cpp:141
LevelData< BaseFab< signed char > > m_faceStates
State of every face of every cell, component 2 * dir + side.
Definition CD_PolyhedralEBGraph.H:490
static constexpr int s_covered
Cell states, in the convention the polyhedral generator hands the index space.
Definition CD_PolyhedralEBGraph.H:57
void defineData()
Allocate the per-cell containers over m_grids: the cut-cell sets, the cell states,...
Definition CD_PolyhedralEBGraph.cpp:112
Vector< Box > m_covered
Cells of this level the finer level carries, coarsened onto this level.
Definition CD_PolyhedralEBGraph.H:475
LevelData< BaseFab< signed char > > m_cellStates
State of every cell, with ghost cells.
Definition CD_PolyhedralEBGraph.H:485
Real getDx() const noexcept
The level's grid spacing.
Definition CD_PolyhedralEBGraph.cpp:1688
const LevelData< BaseFab< signed char > > & getCellStates() const noexcept
The state of every cell, s_covered, s_cut or s_regular, with ghost cells filled from the geometry....
Definition CD_PolyhedralEBGraph.cpp:1706
DisjointBoxLayout m_grids
Layout over the cut tiles.
Definition CD_PolyhedralEBGraph.H:467