|
| 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.
|
| |
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.
| 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 bilinear interpolant of the four corner values decides it. The saddle shares its side with exactly one of the two diagonals: that diagonal meets through the middle, and the other is the pair the chords cut off. Both cells adjoining the face hold the same four values, 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. |