chombo-discharge
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
PolyhedralEBGraph Class Reference

The cut cells of one level of the polyhedral geometry, and what they connect to. More...

#include <CD_PolyhedralEBGraph.H>

Public Member Functions

 PolyhedralEBGraph ()
 Constructor. Leaves the graph undefined.
 
virtual ~PolyhedralEBGraph ()
 Destructor.
 
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)
 Build the graph of one level over its cut tiles.
 
virtual void define (const PolyhedralEBGraph &a_source, const DisjointBoxLayout &a_grids, const BaseIF &a_function)
 Build the graph of a level over a given layout, from another graph of the same level.
 
bool equals (const PolyhedralEBGraph &a_other) const
 Whether another graph over the same layout holds the same cells, faces, mask and surfaces, bit for bit.
 
bool isDefined () const noexcept
 Whether define has run.
 
const ProblemDomain & getDomain () const noexcept
 The level's domain.
 
Real getDx () const noexcept
 The level's grid spacing.
 
const DisjointBoxLayout & getGrids () const noexcept
 The layout over the cut tiles.
 
const LayoutData< IntVectSet > & getCutCells () const noexcept
 The cut cells of every box, its own and those of its ghost region that some tile carries.
 
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. A signed char per cell, which is what the three values need. A ghost cell no tile carries is classified from its corners alone and has no surface even when cut; the face onto it is s_faceCoarser.
 
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.
 
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 has run.
 
const LevelData< IVSFAB< PolyhedralEB::CutCellSurface > > & getSurfaces () const noexcept
 The surface every cut cell is reconstructed from, in the box's own cells and in its ghost cells.
 

Static Public Member Functions

static void link (PolyhedralEBGraph &a_coarse, const PolyhedralEBGraph &a_fine)
 Mark, on the coarse level, the cells the fine level carries and the faces that open onto them.
 
static void findUnresolvedCells (const BaseFab< Real > &a_nodeValues, const Box &a_region, const Vector< Box > &a_covered, BaseFab< bool > &a_unresolved)
 Find the cells of a region that hold more than one sheet of interface.
 

Static Public Attributes

static constexpr int s_covered = -1
 Cell states, in the convention the polyhedral generator hands the index space.
 
static constexpr int s_cut = 0
 Cell states, in the convention the polyhedral generator hands the index space.
 
static constexpr int s_regular = 1
 Cell states, in the convention the polyhedral generator hands the index space.
 
static constexpr int s_faceClosed = 0
 Face states: the face is closed, no fluid crosses it.
 
static constexpr int s_faceSameLevel = 1
 Face states: the face opens onto a cell of this level.
 
static constexpr int s_faceFiner = 2
 Face states: the face opens onto cells the finer level carries, and is described by them.
 
static constexpr int s_faceCoarser = 3
 Face states: the face opens onto a cell no tile of this level carries, which the coarser level does.
 
static constexpr int s_faceBoundary = 4
 Face states: the face lies in the domain boundary and is open.
 

Protected Member Functions

void defineGrids (const Vector< Box > &a_cutTiles)
 Build the layout over the tiles, load balanced by cell count.
 
void defineData ()
 Allocate the per-cell containers over m_grids: the cut-cell sets, the cell states, the face states and the refined mask. The surfaces wait for the sets.
 
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 cells some tile carries into each box's cut-cell set.
 
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 another tile covers, zero elsewhere.
 
void defineCells (const BaseIF &a_function, const LevelData< BaseFab< signed char > > &a_carried)
 Reconstruct and classify every cell of every box and its ghost region, keep the cut cells' surfaces with ghost cells, and set the face states the apertures decide.
 
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 carries.
 

Protected Attributes

bool m_isDefined
 Whether define has run.
 
int m_numGhost
 Ghost cells the cell states are kept for.
 
Real m_dx
 Grid spacing of the level.
 
RealVect m_probLo
 Lower-left corner of the domain.
 
ProblemDomain m_domain
 Domain of the level.
 
DisjointBoxLayout m_grids
 Layout over the cut tiles.
 
Vector< Box > m_covered
 Cells of this level the finer level carries, coarsened onto this level.
 
LayoutData< IntVectSet > m_cutCells
 Cut cells of every box.
 
LevelData< BaseFab< signed char > > m_cellStates
 State of every cell, with ghost cells.
 
LevelData< BaseFab< signed char > > m_faceStates
 State of every face of every cell, component 2 * dir + side.
 
LevelData< BaseFab< signed char > > m_refined
 One where the finer level carries the cell.
 
LevelData< IVSFAB< PolyhedralEB::CutCellSurface > > m_surfaces
 Surface of every cut cell.
 

Detailed Description

The cut cells of one level of the polyhedral geometry, and what they connect to.

Holds, over the level's cut tiles, the classification of every cell, the surface every cut cell is reconstructed from, and for every face of every cell what lies across it: nothing, a cell of this level, a cell of the finer level, a cell of the coarser level, or the domain boundary. The surface is the source of everything else about a cut cell – its polyhedron and moments are rebuilt from it on demand – and it regrids: a coarse surface's corners are fine nodes and its crossings are the children's, and children are reconstructed from the implicit function. A cell whose face lies across a level boundary is not described by its own surface alone: the face is described by the level across it, which is what the face state records.

The graph covers the cut tiles only. A cell outside every tile is regular or covered, never cut, and which of the two is the geometry's box classification rather than the graph's business.

Built in two steps: define makes one level from its implicit function and its tiles, and knows about the domain boundary and about faces that open onto no tile of its own level; link, given two adjacent levels, marks the coarse cells the fine level carries and the coarse faces that open onto them.

Member Function Documentation

◆ define() [1/2]

void PolyhedralEBGraph::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 
)
virtual

Build the graph of one level over its cut tiles.

Load balances the tiles by cell count, reconstructs every cell of every tile and its ghost region from the implicit function, classifies it as the polyhedral generator does, keeping every cell that holds anything – a body with nothing in it is a regular cell, and nothing else is discarded, since a cell's interface is what closes the surface against its neighbours – keeps the surface of every cut cell, and sets the face states this level can know by itself: closed or open from the apertures, open onto the domain boundary, and open onto a cell no tile of this level carries. Collective.

Parameters
[in]a_functionImplicit function of the phase.
[in]a_cutTilesThe level's cut tiles, identical on every rank.
[in]a_domainDomain of the level.
[in]a_probLoLower-left corner of the domain.
[in]a_dxGrid spacing of the level.
[in]a_numGhostGhost cells the cell states are kept for.
[in]a_coveredCells of this level the finer level will carry, coarsened onto this level. A cell in them is described up there and is not filled down here.

◆ define() [2/2]

void PolyhedralEBGraph::define ( const PolyhedralEBGraph &  a_source,
const DisjointBoxLayout &  a_grids,
const BaseIF &  a_function 
)
virtual

Build the graph of a level over a given layout, from another graph of the same level.

The other graph's cell states, face states and surfaces are copied onto the new layout's valid cells, and exchanged into its ghost cells; the ghost cells no tile of the new layout carries are classified from the implicit function by their corners, as define classifies them. The new layout must cover the same cells as the other graph's, since the surfaces of the cut cells come from it alone; a layout of another cell count stops the run. The refined mask is not copied: it is the finer level's to set, so link the copy to its finer level afterwards as the original was. Collective.

Parameters
[in]a_sourceGraph to copy from.
[in]a_gridsLayout to copy onto, covering the same cells as a_source's.
[in]a_functionImplicit function of the phase, for the ghost cells no tile carries.

◆ defineCells()

void PolyhedralEBGraph::defineCells ( const BaseIF &  a_function,
const LevelData< BaseFab< signed char > > &  a_carried 
)
protected

Reconstruct and classify every cell of every box and its ghost region, keep the cut cells' surfaces with ghost cells, and set the face states the apertures decide.

Parameters
[in]a_functionImplicit function.
[in]a_carriedThe marker from markCarried.

◆ defineGhostCells()

void PolyhedralEBGraph::defineGhostCells ( const BaseIF &  a_function,
const LevelData< BaseFab< signed char > > &  a_carried 
)
protected

Classify the ghost cells no tile of this level carries from their corners, and take the ghost cut cells some tile carries into each box's cut-cell set.

The cells another tile carries are expected to hold that tile's state already, by exchange.

Parameters
[in]a_functionImplicit function.
[in]a_carriedThe marker from markCarried.

◆ defineGrids()

void PolyhedralEBGraph::defineGrids ( const Vector< Box > &  a_cutTiles)
protected

Build the layout over the tiles, load balanced by cell count.

Parameters
[in]a_cutTilesThe tiles.

◆ defineOuterFaces()

void PolyhedralEBGraph::defineOuterFaces ( const LevelData< BaseFab< signed char > > &  a_carried)
protected

Mark the open faces that lie in the domain boundary, and those onto cells no tile of this level carries.

Parameters
[in]a_carriedThe marker from markCarried.

◆ equals()

bool PolyhedralEBGraph::equals ( const PolyhedralEBGraph &  a_other) const

Whether another graph over the same layout holds the same cells, faces, mask and surfaces, bit for bit.

Compares valid and ghost cells alike, on every rank; the answer is reduced so that every rank gets the same one. Collective.

Parameters
[in]a_otherGraph over the same layout.
Returns
True if nothing differs.

◆ findUnresolvedCells()

void PolyhedralEBGraph::findUnresolvedCells ( const BaseFab< Real > &  a_nodeValues,
const Box &  a_region,
const Vector< Box > &  a_covered,
BaseFab< bool > &  a_unresolved 
)
static

Find the cells of a region that hold more than one sheet of interface.

Downstream holds one body and one interface to a cell, so a cell the surface enters as several sheets cannot be described at all. Such a cell is filled rather than built, which is the only reading that stays single valued and keeps a barrier thinner than a cell a barrier instead of letting the fluid run through it. Filling is a classification and changes no value another level reads, so the children a coarse cell restricts against still agree with it about where every edge is crossed – which is what a snap of the nodes themselves cannot promise.

A cell the finer level carries is left alone: the feature is resolved up there, and this level's reading of it is not the one that gets used. Only the combinatorics are read, so no root is solved for here.

Nothing is counted here. The region a caller asks about reaches past the cells it owns, so that a cell can see whether its neighbours were filled, and those reaches overlap between neighbouring boxes; a count taken here would report a cell near a box boundary once for every box that reaches it. The caller counts over the cells it owns.

Parameters
[in]a_nodeValuesNode values of the region.
[in]a_regionCells to ask.
[in]a_coveredCells a finer level carries.
[out]a_unresolvedTrue for each cell of the region that must be filled.

◆ getCellStates()

const LevelData< BaseFab< signed char > > & PolyhedralEBGraph::getCellStates ( ) const
noexcept

The state of every cell, s_covered, s_cut or s_regular, with ghost cells filled from the geometry. A signed char per cell, which is what the three values need. A ghost cell no tile carries is classified from its corners alone and has no surface even when cut; the face onto it is s_faceCoarser.

Returns
One component per cell.

◆ getCutCells()

const LayoutData< IntVectSet > & PolyhedralEBGraph::getCutCells ( ) const
noexcept

The cut cells of every box, its own and those of its ghost region that some tile carries.

Returns
One set per box.

◆ getDomain()

const ProblemDomain & PolyhedralEBGraph::getDomain ( ) const
noexcept

The level's domain.

Returns
The domain.

◆ getDx()

Real PolyhedralEBGraph::getDx ( ) const
noexcept

The level's grid spacing.

Returns
The spacing.

◆ getFaceStates()

const LevelData< BaseFab< signed char > > & PolyhedralEBGraph::getFaceStates ( ) const
noexcept

The state of every face of every cell, one of the s_face constants; component 2 * dir + side.

Returns
2 * SpaceDim components per cell.

◆ getGrids()

const DisjointBoxLayout & PolyhedralEBGraph::getGrids ( ) const
noexcept

The layout over the cut tiles.

Returns
The layout.

◆ getRefinedMask()

const LevelData< BaseFab< signed char > > & PolyhedralEBGraph::getRefinedMask ( ) const
noexcept

Whether the finer level carries a cell, one where it does, with two ghost cells; all zero until link has run.

Returns
One component per cell.

◆ getSurfaces()

const LevelData< IVSFAB< PolyhedralEB::CutCellSurface > > & PolyhedralEBGraph::getSurfaces ( ) const
noexcept

The surface every cut cell is reconstructed from, in the box's own cells and in its ghost cells.

Returns
One surface per cut cell of every box's set.

◆ isDefined()

bool PolyhedralEBGraph::isDefined ( ) const
noexcept

Whether define has run.

Returns
True after define.

◆ link()

void PolyhedralEBGraph::link ( PolyhedralEBGraph &  a_coarse,
const PolyhedralEBGraph &  a_fine 
)
static

Mark, on the coarse level, the cells the fine level carries and the faces that open onto them.

The fine tiles are coarsened onto the coarse layout the way Realm builds its valid-cell mask: a marker on the coarsened fine layout is copied onto the coarse layout and its ghost cells. A coarse cell the marker reaches is refined; an open face of an unrefined coarse cell onto a refined neighbour is described by the fine level. The fine level's own faces onto the coarse level were set when it was defined. Collective.

Parameters
[in,out]a_coarseGraph of the coarser level.
[in]a_fineGraph of the finer level, a factor-two refinement of it.

◆ markCarried()

void PolyhedralEBGraph::markCarried ( LevelData< BaseFab< signed char > > &  a_carried) const
protected

Mark the cells some tile of this level carries: one in every valid cell and in every ghost cell another tile covers, zero elsewhere.

Parameters
[out]a_carriedThe marker, defined here over the layout with the cell states' ghost width.

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