The polyhedral graph as an AMR hierarchy of any layout holds it: every cell of every box, ghost cells included, described by the geometry level that owns it.
More...
|
|
| AMRPolyhedralEBGraph () noexcept |
| | Constructor. Holds nothing until define.
|
|
virtual | ~AMRPolyhedralEBGraph () noexcept |
| | Destructor.
|
| void | define (const std::vector< DisjointBoxLayout > &a_grids, const std::vector< ProblemDomain > &a_domains, const std::vector< int > &a_geometryLevels, const int a_numSourceLevels, const int a_ghost, const std::function< GeometryService::InOut(const Box &, const ProblemDomain &)> &a_classify) |
| | Set the destination hierarchy, holding nothing of the graph yet.
|
| bool | isDefined () const noexcept |
| | Whether define has run.
|
| int | getNumLevels () const noexcept |
| | Number of destination levels.
|
| int | getNumSourceLevels () const noexcept |
| | Number of geometry levels.
|
| int | getGhost () const noexcept |
| | Ghost width every destination box is filled to.
|
| const DisjointBoxLayout & | getGrids (const int a_level) const noexcept |
| | Layout of a destination level.
|
| const ProblemDomain & | getDomain (const int a_level) const noexcept |
| | Domain of a destination level.
|
| int | getGeometryLevel (const int a_level) const noexcept |
| | Geometry level a destination level lives on.
|
| void | getCutCells (std::vector< PolyhedralEB::CutCellDescription > &a_cells, const int a_level, const DataIndex &a_dit, const IntVect &a_cell) const |
| | The cut cells of the geometry that intersect a cell of a destination box, each with everything its polyhedron is built from.
|
| int | getState (const int a_level, const DataIndex &a_dit, const IntVect &a_cell) const |
| | What a cell of a destination box is: cut if any geometry cell owning part of it is, or if it holds both regular and covered fluid, regular or covered if all of it is, and s_unowned if the box holds nothing of it.
|
| bool | holds (const int a_level, const DataIndex &a_dit, const IntVect &a_cell) const |
| | Whether a destination box holds a cell: within its ring and the domain, and not under the next finer destination level.
|
| void | fillNodes (BaseFab< int > &a_regIrregCovered, Vector< IrregNode > &a_nodes, long long &a_numCollapsed, long long &a_numFiner, const int a_level, const DataIndex &a_dit, const BaseFab< bool > &a_compute, const bool a_cutRing) const |
| | Fill a destination box's index-space data from the copied graph: what each cell is, and a node with the moments of each cut cell, as GeometryService::fillGraph hands them to the index space.
|
| const std::vector< Box > & | getPieces (const int a_level, const DataIndex &a_dit, const int a_sourceLevel) const noexcept |
| | The pieces a destination box holds of a geometry level: boxes of cells, each owned by one of its tiles.
|
| int | getSourceState (const int a_level, const DataIndex &a_dit, const int a_sourceLevel, const IntVect &a_sourceCell) const |
| | The state of a geometry cell, as a destination box holds it.
|
| const std::vector< IntVect > & | getSurfaceCells (const int a_level, const DataIndex &a_dit, const int a_sourceLevel) const noexcept |
| | The geometry cells of a level that a destination box holds a surface for, in increasing order.
|
| const PolyhedralEB::CutCellSurface * | getSourceSurface (const int a_level, const DataIndex &a_dit, const int a_sourceLevel, const IntVect &a_sourceCell) const |
| | The surface of a geometry cell, as a destination box holds it.
|
| const PolyhedralEB::CutCellFaceOverrides & | getFaceOverrides (const int a_level, const DataIndex &a_dit, const int a_sourceLevel) const noexcept |
| | The face overrides of a geometry level's cells, as a destination box holds them.
|
| void | addPiece (const int a_level, const DataIndex &a_dit, const int a_sourceLevel, const Box &a_region, const signed char *a_states) |
| | Add a piece to a destination box.
|
| void | addSurface (const int a_level, const DataIndex &a_dit, const int a_sourceLevel, const IntVect &a_sourceCell, const PolyhedralEB::CutCellSurface &a_surface) |
| | Add the surface of a geometry cell to a destination box. Surfaces may come in any order; finish puts them in order before any is read.
|
| void | finish () |
| | Put every box's surfaces in cell order and index its pieces, after the last addPiece and addSurface and before anything is read.
|
| PolyhedralEB::CutCellFaceOverrides & | getFaceOverrides (const int a_level, const DataIndex &a_dit, const int a_sourceLevel) noexcept |
| | The face overrides of a geometry level's cells in a destination box, to be filled.
|
|
|
bool | m_isDefined |
| | Whether define has run.
|
|
int | m_ghost |
| | Ghost width every destination box is filled to.
|
|
int | m_numSourceLevels |
| | Number of geometry levels.
|
|
std::function< GeometryService::InOut(const Box &, const ProblemDomain &)> | m_classify |
| | Classifies the boxes no tile holds, on a given domain.
|
|
std::vector< DisjointBoxLayout > | m_grids |
| | Destination layout of every level.
|
|
std::vector< ProblemDomain > | m_domains |
| | Domain of every destination level.
|
|
std::vector< int > | m_geometryLevels |
| | Geometry level of every destination level.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< Box > > > > > | m_pieces |
| | The pieces of every box, per destination level and geometry level.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< int > > > > > | m_pieceOffsets |
| | Where each piece's states begin in m_states, and one past the last piece's end.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< signed char > > > > > | m_states |
| | The pieces' states, one piece after another, each in the order a BoxIterator meets its cells.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< IntVect > > > > > | m_surfaceCells |
| | The cells that hold a surface, in increasing order once finish has run.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< PolyhedralEB::CutCellSurface > > > > > | m_surfaces |
| | Their surfaces, in the same order.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< PolyhedralEB::CutCellFaceOverrides > > > > | m_faceOverrides |
| | The face overrides of the cells whose surfaces are overridden.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< int > > > > | m_binSize |
| | Width of the bins each box's pieces are indexed by.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< Box > > > > | m_binBox |
| | The bins of each box's index, on the geometry level coarsened by the bin width.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< int > > > > > | m_binOffsets |
| | Where each bin's pieces begin in m_binPieces, the bins in the order a BoxIterator meets them, and one past the last bin's end.
|
|
std::vector< std::vector< RefCountedPtr< LayoutData< std::vector< int > > > > > | m_binPieces |
| | The pieces that reach each bin, one bin after another.
|
The polyhedral graph as an AMR hierarchy of any layout holds it: every cell of every box, ghost cells included, described by the geometry level that owns it.
The geometry's graph lives on its own levels and its own tiles. A consumer lives on its own hierarchy – one DisjointBoxLayout per level, each box filled to a ghost width, less what the next finer level covers – and a cell of it may be owned by the geometry level at its own resolution, by a finer one, or by a coarser one. Each box keeps the part of the graph that intersects it and nothing else: per geometry level, the pieces it received – boxes of cells one tile of that level owns, with their states – and the surfaces and face overrides of the cells among them that hold any. Nothing here is recomputed from the implicit function; PolyhedralGeometryShop::copyGraphs fills it from the graphs alone.
A consumer asks a destination cell for the cut cells that intersect it, getCutCells, each as a CutCellDescription from which CutCellBody::define builds its polyhedron, and asks getState what a cell with none is.
| void AMRPolyhedralEBGraph::fillNodes |
( |
BaseFab< int > & | a_regIrregCovered, |
|
|
Vector< IrregNode > & | a_nodes, |
|
|
long long & | a_numCollapsed, |
|
|
long long & | a_numFiner, |
|
|
const int | a_level, |
|
|
const DataIndex & | a_dit, |
|
|
const BaseFab< bool > & | a_compute, |
|
|
const bool | a_cutRing ) const |
Fill a destination box's index-space data from the copied graph: what each cell is, and a node with the moments of each cut cell, as GeometryService::fillGraph hands them to the index space.
The graph decides what a cell is, and nothing overrides it: a cell it calls regular is regular, one it calls covered is covered. A cut cell owned at the box's level takes its stitched body. A cell cut from a coarser ancestor takes the child the ancestor's body subdivides down to; a child holding no fluid is covered, a child that is all fluid with no interface is regular, and a child the subdivision leaves in more than one piece is kept as one node whose moments are the sums over its pieces, its volume centroid the summed first moment, and is counted. A cell a finer level owns is not filled yet: it is marked irregular, gets no node, and is counted.
The flags cover the box grown by two cells, within the domain; a cell the copy holds nothing for – one the next finer destination level covers – is marked irregular and gets no node. Nodes are written for the box and its first ghost cell, so that every face of a node has the cell across it in hand. A face beside a regular cell is open over all of it. A face two cut cells share takes its aperture and centroid from one body, on both sides, so every box writes it with the same bits: from the cell owned at the box's level where the other is cut from an ancestor, and from the low cell otherwise.
A caller that keeps the moments of the box only can leave the ring alone, and needs the copy only one ghost cell wide; a ring cut as the box is needs it two. The cells beyond the first ghost ring are then marked covered without being looked at, and a cut cell of the first ghost ring that would have to be cut from an ancestor is marked s_ringFromCoarser and gets no body or node; the box's own cells write their faces beside it from their own bodies.
A cut from an ancestor that fails, or that gives a child in one piece that does not close, has lost fluid its parent holds, and stops the run.
- Parameters
-
| [out] | a_regIrregCovered | One for regular, minus one for covered, zero for irregular, per cell. |
| [out] | a_nodes | One node per irregular cell the box fills. |
| [out] | a_numCollapsed | Incremented for every child a subdivision left in more than one piece. |
| [out] | a_numFiner | Incremented for every cut cell a finer level owns. |
| [in] | a_level | Destination level. |
| [in] | a_dit | Destination box. |
| [in] | a_compute | The cells to fill, over at least the box grown by two cells within the domain. A cell left out is marked irregular, gets no node and builds no body, so a cell filled beside it does not read its faces from it: a caller that keeps a node must fill every cell across its faces too. |
| [in] | a_cutRing | Whether the ghost cells are filled as the box's own cells are. If false, only the box's own cells are filled in full, and the ring is left as described above. |