|
| void | PolyhedralEB::fillNodeValues (BaseFab< Real > &a_nodeValues, const BaseIF &a_function, const Box &a_region, const RealVect &a_probLo, const Real &a_dx) |
| | Evaluate the implicit function at every node of a region.
|
| void | PolyhedralEB::defineIntercepts (BaseFab< Real > a_intercept[SpaceDim], const Box &a_region) |
| | Size the edge-crossing cache for a region and mark every edge as not yet bisected.
|
| Real | PolyhedralEB::edgeCrossing (const BaseIF &a_function, BaseFab< Real > a_intercept[SpaceDim], const IntVect &a_cell, const int a_edge, const Real a_lo, const Real a_hi, const RealVect &a_probLo, const Real &a_dx) |
| | Find where the implicit function changes sign along a cell edge.
|
| bool | PolyhedralEB::isDust (const PolyhedralEB::CutCellBody &a_body) noexcept |
| | Whether a cut body holds nothing at all and is therefore a regular cell.
|
| Real | PolyhedralEB::snappedValue (const BaseIF &a_function, const RealVect &a_point, const Real a_dx) noexcept |
| | Read the implicit function at a point, with a value within s_snapTolerance of a cell width of zero read as exactly zero, and a zero that is a tangency read from beside the point instead.
|
| Real | PolyhedralEB::resolveTangency (const BaseIF &a_function, const RealVect &a_point, const Real a_dx) noexcept |
| | Read the implicit function beside a point where it is zero, when no surface passes through the point.
|
| Real | PolyhedralEB::edgeRoot (const BaseIF &a_function, const IntVect &a_edgeIV, const int a_dir, const Real a_loValue, const Real a_hiValue, const RealVect &a_probLo, const Real a_dx) noexcept |
| | Bisect one cell edge for the crossing on it.
|
| void | PolyhedralEB::fillCorners (PolyhedralEB::CutCellSurface &a_surface, const BaseFab< Real > &a_nodeValues, const IntVect &a_cell) |
| | Read one cell's corner values off the node values.
|
| void | PolyhedralEB::buildSurface (BaseFab< Real > a_intercept[SpaceDim], PolyhedralEB::CutCellSurface &a_surface, const BaseIF &a_function, const BaseFab< Real > &a_nodeValues, const IntVect &a_cell, const RealVect &a_probLo, const Real &a_dx) |
| | Gather the corner values and edge crossings one cell's surface is built from.
|
| void | PolyhedralEB::decideFaces (PolyhedralEB::CutCellSurface &a_surface, const BaseIF &a_function, const IntVect &a_cell, const RealVect &a_probLo, const Real a_dx) noexcept |
| | Decide, for every face of a cell whose corners alternate in sign, whether its fluid corners or its solid ones meet across it.
|
Implementation of CD_PolyhedralEBUtils.H.
- Author
- Robert Marskar
| void PolyhedralEB::decideFaces |
( |
PolyhedralEB::CutCellSurface & | a_surface, |
|
|
const BaseIF & | a_function, |
|
|
const IntVect & | a_cell, |
|
|
const RealVect & | a_probLo, |
|
|
const Real | a_dx ) |
|
noexcept |
Decide, for every face of a cell whose corners alternate in sign, whether its fluid corners or its solid ones meet across it.
Four alternating corners admit both readings, and the bilinear interpolant of the corners picks the one its saddle falls on, which for a feature thinner than the face is the wrong one: the large values at two corners outweigh the small ones of a thin plate at the other two, and the chords pierce the plate. The implicit function at the centre of the face is read instead, with the value snap of a grid twice as fine, so that it is the very node a finer level holds there. Every cell sharing the face reads the same point. A centre that reads exactly zero falls back to the bilinear saddle. In two dimensions the face is the cell itself.
- Parameters
-
| [in,out] | a_surface | Surface whose corners are filled; its face decisions are set. |
| [in] | a_function | Implicit function. |
| [in] | a_cell | The cell. |
| [in] | a_probLo | Lower-left corner of the domain. |
| [in] | a_dx | Grid spacing. |
| Real PolyhedralEB::edgeCrossing |
( |
const BaseIF & | a_function, |
|
|
BaseFab< Real > | a_intercept[SpaceDim], |
|
|
const IntVect & | a_cell, |
|
|
const int | a_edge, |
|
|
const Real | a_lo, |
|
|
const Real | a_hi, |
|
|
const RealVect & | a_probLo, |
|
|
const Real & | a_dx ) |
Find where the implicit function changes sign along a cell edge.
Bisection between the two endpoints, looked up in a cache first. Every cut edge is reached from both of its adjoining faces and from each neighbouring cell, always with the same endpoints, so the root is found once and reused. That is what makes two cells agree on a shared aperture bit for bit.
- Parameters
-
| [in] | a_function | Implicit function |
| [in,out] | a_intercept | Edge-centred cache, one component per direction |
| [in] | a_cell | Cell the edge is being read from |
| [in] | a_edge | Edge index within the cell |
| [in] | a_lo | Implicit function at the edge's low corner |
| [in] | a_hi | Implicit function at the edge's high corner |
| [in] | a_probLo | Lower-left corner of computational domain |
| [in] | a_dx | Grid resolution |
- Returns
- Position along the edge, parameterised from its low corner.
| Real PolyhedralEB::edgeRoot |
( |
const BaseIF & | a_function, |
|
|
const IntVect & | a_edgeIV, |
|
|
const int | a_dir, |
|
|
const Real | a_loValue, |
|
|
const Real | a_hiValue, |
|
|
const RealVect & | a_probLo, |
|
|
const Real | a_dx ) |
|
noexcept |
Bisect one cell edge for the crossing on it.
An endpoint at exactly zero is not taken to be the crossing: the function may be zero along a stretch of the edge (a face of the geometry lying in the edge's plane), and the crossing is where it leaves that stretch. The bisection walks through zeros, which the fluid predicate reads as solid, and a root that lands within s_snapTolerance of an endpoint that is exactly zero is put exactly on it.
- Parameters
-
| [in] | a_function | Implicit function. |
| [in] | a_edgeIV | Node at the low end of the edge. |
| [in] | a_dir | Direction the edge runs in. |
| [in] | a_loValue | Implicit function at the low end. |
| [in] | a_hiValue | Implicit function at the high end. |
| [in] | a_probLo | Lower-left corner of the domain. |
| [in] | a_dx | Grid spacing. |
- Returns
- Position along the edge, in [0,1].
Whether a cut body holds nothing at all and is therefore a regular cell.
A node that lands exactly on the interface is solid by rule, so the cells around it classify as cut from their corners while their bodies hold no solid and no interface whatsoever – the reconstruction finds an empty polyhedron. Those cells are regular, and dropping them discards nothing, since there is no surface in them for a neighbour to meet. Emptiness is exact rather than thresholded: a body with any solid in it, however little, keeps its cell, because its interface is what closes the surface against its neighbours, and a rule that discarded it by size would leave a hole the size of what it discarded. A cell whose interface lies in one of its faces has no solid volume either, but it does have boundary area, and it is not dust.
- Parameters
-
| [in] | a_body | Body of the cell. |
- Returns
- True if the cell should be treated as regular.
| Real PolyhedralEB::resolveTangency |
( |
const BaseIF & | a_function, |
|
|
const RealVect & | a_point, |
|
|
const Real | a_dx ) |
|
noexcept |
Read the implicit function beside a point where it is zero, when no surface passes through the point.
A composite function can be zero over a whole region that is not its surface: a difference of two bodies sharing a face evaluates to the maximum of zero and something negative over the whole of that face. Taken at face value such a zero is material by the fluid rule, and it invents an interface where the geometry has none and displaces the interfaces of whatever else the cell holds. It is told apart from a surface by the function's sign a probe spacing off the point, along each axis in turn. A surface through the point changes the sign across it along any axis the surface is not parallel to, and since a surface has a normal there is always such an axis, so one sign change is enough to leave the zero alone. The zero is read through only on the evidence of an axis whose two readings are both away from zero and of the same sign, which is what a function that touches zero without a surface being there looks like; the largest such reading stands in for the zero. One reading of zero is not evidence of anything – it is the point's own zero again, which is what an axis along a face of the geometry returns, and what both axes along the faces meeting at a convex edge return.
- Parameters
-
| [in] | a_function | Implicit function. |
| [in] | a_point | Point the function is zero at. |
| [in] | a_dx | Grid spacing that sets the probe spacing. |
- Returns
- The reading beside the point, or exactly zero if a surface passes through it.
| Real PolyhedralEB::snappedValue |
( |
const BaseIF & | a_function, |
|
|
const RealVect & | a_point, |
|
|
const Real | a_dx ) |
|
noexcept |
Read the implicit function at a point, with a value within s_snapTolerance of a cell width of zero read as exactly zero, and a zero that is a tangency read from beside the point instead.
A face of the geometry lying in a node plane evaluates to zero there only up to round-off: the same face comes back as plus zero, minus zero and a few parts in 1e19 at neighbouring nodes, and cells on either side of it would then be classified by which of those they were handed. Reading everything within a fixed fraction of the cell width of zero as zero puts every such node on one side by rule, in the corner values and in the bisection alike. A zero that no surface passes through is then read through resolveTangency, so that nothing downstream sees it.
- Parameters
-
| [in] | a_function | Implicit function. |
| [in] | a_point | Point to evaluate at. |
| [in] | a_dx | Grid spacing that sets the scale. |
- Returns
- The value, or exactly zero.