|
| int | edgeDirection (const int a_edge) noexcept |
| | Direction a cell edge runs along.
|
| void | edgeOrigin (const int a_edge, int a_offset[SpaceDim]) noexcept |
| | Corner offsets of a cell edge's low end.
|
| void | edgeCorners (const int a_edge, int &a_lo, int &a_hi) noexcept |
| | The corners a cell edge joins, low end first.
|
| RealVect | cornerPosition (const int a_corner) noexcept |
| | Position of a cell corner in the cell's own frame.
|
| void | faceCorners (const int a_dir, const int a_side, int a_corner[1<<(SpaceDim - 1)]) noexcept |
| | The corners of a cell face, in circuit order around the face.
|
| int | edgeIndex (const int a_dir, const int a_offset[SpaceDim]) noexcept |
| | Index of the edge running along a_dir whose low corner has the given offsets.
|
| RealVect | crossingPosition (const CutCellSurface &a_surface, const int a_edge, const Real a_tolerance) noexcept |
| | Position of an edge crossing in the cell's own frame.
|
| void | faceEdges (const int a_dir, const int a_side, int a_edge[4]) noexcept |
| | The edges of a cell face, edge i joining face corners i and i+1.
|
| void | polygonMoments (const RealVect *a_vertex, const int a_num, Real &a_area, RealVect &a_vector, RealVect &a_centroid) noexcept |
| | Area vector, area and centroid of a planar polygon given in circuit order.
|
| int | facePairs (const int a_dir, const int a_side, const CutCellSurface &a_surface, int a_pair[2][2]) noexcept |
| | The chords on a cell face, each an unordered pair of edge indices.
|
| int | crossingLoops (const CutCellSurface &a_surface, int a_loop[CutCellSurface::s_numEdges], int a_start[CutCellSurface::s_numEdges+1]) noexcept |
| | Order the crossings into closed loops, or fail if they do not form clean cycles.
|
| bool | sameVertex (const RealVect &a_a, const RealVect &a_b) noexcept |
| | Whether two positions are the same vertex.
|
| bool | sameToRoundOff (const RealVect &a_a, const RealVect &a_b) noexcept |
| | Whether two vertices differ only by round-off.
|
| bool | withinInEveryDirection (const RealVect &a_a, const RealVect &a_b, const Real a_margin) noexcept |
| | Whether two positions differ by no more than a margin in any coordinate.
|
| RealVect | crossing (const RealVect &a_a, const RealVect &a_b, const int a_dir) noexcept |
| | Where the segment between two vertices crosses the plane x[a_dir] = 0, the same to the bit whichever way round the segment is given.
|
|
| constexpr int | s_transverse [3][2] = {{1, 2}, {0, 2}, {0, 1}} |
| | The two directions transverse to each coordinate direction, in increasing order.
|
| constexpr Real | s_weldTolerance = 1.0E-10 |
| | Distance within which two vertices are taken to be the same one.
|
|
constexpr Real | s_roundOffTolerance = 1.0E-13 |
| | Distance below which two vertices of a body cut from another are one, since they then differ only by the round-off of the arithmetic that placed them. Far below the weld tolerance, so fluid thinner than the weld keeps its vertices, and far below the tolerance to which a cut reproduces its parent's moments.
|
Cell topology and polygon geometry the cut cell classes are assembled from.
Corners, edges and faces are indexed in the cell's own [-1/2, 1/2]^SpaceDim frame. Corner c has offset ((c >> d) & 1) in direction d. Edges are numbered direction-major, with s_numEdges / SpaceDim edges running along each direction: edge e runs along direction e / (s_numEdges / SpaceDim), and the remainder holds the offsets of the edge's low corner in the transverse directions, one bit per direction in increasing order. An edge is parameterised from its low corner. Faces are indexed as 2 * dir + side with side 0 the low face and side 1 the high face. Two neighbouring cells therefore address a shared corner, edge or face identically.
| RealVect PolyhedralEB::detail::crossing |
( |
const RealVect & | a_a, |
|
|
const RealVect & | a_b, |
|
|
const int | a_dir ) |
|
inlinenoexcept |
Where the segment between two vertices crosses the plane x[a_dir] = 0, the same to the bit whichever way round the segment is given.
An endpoint on the plane is the crossing itself. Otherwise the crossing is interpolated from the endpoint below the plane and placed on it exactly, so the two children either side of a cut, and two polygons sharing the segment, put the vertex in one place.
- Parameters
-
| [in] | a_a | One endpoint. |
| [in] | a_b | The other endpoint, on the other side of the plane or on it. |
| [in] | a_dir | The direction normal to the plane. |
- Returns
- The crossing.
| void PolyhedralEB::detail::faceCorners |
( |
const int | a_dir, |
|
|
const int | a_side, |
|
|
int | a_corner[1<<(SpaceDim - 1)] ) |
|
inlinenoexcept |
The corners of a cell face, in circuit order around the face.
The circuit runs through the transverse offsets (0,0), (1,0), (1,1), (0,1). Its handedness relative to the face's outward normal depends on the direction, so a polygon assembled along it has to be oriented afterwards.
- Parameters
-
| [in] | a_dir | Coordinate direction of the face normal. |
| [in] | a_side | 0 for the low face in that direction, 1 for the high face. |
| [out] | a_corner | Face corners in circuit order. |
| int PolyhedralEB::detail::facePairs |
( |
const int | a_dir, |
|
|
const int | a_side, |
|
|
const CutCellSurface & | a_surface, |
|
|
int | a_pair[2][2] ) |
|
inlinenoexcept |
The chords on a cell face, each an unordered pair of edge indices.
A face with two crossings carries one chord. A face whose corners alternate fluid and solid carries four crossings and there are two ways to join them; the surface's face decision (CutCellSurface::m_fluidJoined, read from the implicit function at the centre of the face) says which diagonal meets through the middle, and the other is the pair the chords cut off. Both cells adjoining the face read the same point, so they cannot disagree. With four crossings each chord joins two consecutive edges of the face circuit.
- Parameters
-
| [in] | a_dir | Coordinate direction of the face normal. |
| [in] | a_side | 0 for the low face in that direction, 1 for the high face. |
| [in] | a_surface | Corner values and edge crossings of the cell. |
| [out] | a_pair | Each chord's two edge indices. Entries beyond the returned count are left untouched. |
- Returns
- Number of chords, 0, 1 or 2, or -1 if the face carries an odd number of crossings.
| void PolyhedralEB::detail::polygonMoments |
( |
const RealVect * | a_vertex, |
|
|
const int | a_num, |
|
|
Real & | a_area, |
|
|
RealVect & | a_vector, |
|
|
RealVect & | a_centroid ) |
|
inlinenoexcept |
Area vector, area and centroid of a planar polygon given in circuit order.
The area vector is the sum of the signed triangle area vectors of a fan from the first vertex, so a non-convex polygon comes out right. A face contour that is a polyline rather than a single chord leaves such a polygon, and summing unsigned triangle areas over the fan over-counts it. The centroid is the area-weighted mean of the triangle centroids with the same signs. Fewer than three vertices yield all-zero outputs.
- Parameters
-
| [in] | a_vertex | Polygon vertices in circuit order. |
| [in] | a_num | Number of vertices. |
| [out] | a_area | Magnitude of the area vector, which is the polygon area when the polygon is planar and simple. |
| [out] | a_vector | Polygon area vector, normal to the polygon with the handedness of the circuit. |
| [out] | a_centroid | Polygon centroid, zero when the area is zero. |