chombo-discharge
Loading...
Searching...
No Matches
PolyhedralEB::CutCellSurface Class Reference

The values a cut cell's embedded boundary is reconstructed from. More...

#include <CD_CutCellSurface.H>

Public Member Functions

 CutCellSurface () noexcept
 Constructor. Leaves every edge without a crossing, every corner at zero, no face joining its fluid corners, and the role native.
 ~CutCellSurface () noexcept=default
 Destructor.
bool hasCrossing (const int a_edge) const noexcept
 Whether the edge carries a crossing.
int linearSize () const noexcept
 Number of bytes the surface occupies in a linear buffer, as Chombo's containers ask of their payload.
void linearOut (void *a_buffer) const noexcept
 Write the surface into a linear buffer, as Chombo's containers ask of their payload.
void linearIn (const void *a_buffer) noexcept
 Read the surface from a linear buffer written by linearOut.

Public Attributes

Real m_crossing [s_numEdges]
 Position along an edge where the implicit function changes sign.
Real m_corner [s_numCorners]
 Implicit function at the cell corners, ordered so that corner c has offset ((c >> d) & 1) in direction d.
int m_fluidJoined
 Which faces join their fluid corners, one bit per face whose corners alternate in sign.
int m_role
 How the cell's body is built from this surface: s_native, s_overridden or s_invalid.

Static Public Attributes

static constexpr int s_numEdges = 2 * SpaceDim * (SpaceDim - 1)
 Number of cell edges a crossing can sit on.
static constexpr int s_numCorners = 1 << SpaceDim
 Number of cell corners.
static constexpr Real s_noCrossing = -1.0
 Marks an edge whose endpoints lie on the same side of the interface.
static constexpr int s_native = 0
 Role of a stored surface: the cell's body is built from the surface alone.
static constexpr int s_overridden = 1
 Role of a stored surface: some faces of the cell's body are the cell's face overrides rather than its own chords.
static constexpr int s_invalid = 2
 Role of a surface: the cell is covered by a finer grid. Never stored or copied; a receiver that finds it has been handed a cell it should not describe.

Detailed Description

The values a cut cell's embedded boundary is reconstructed from.

Holds the implicit function at the cell's corners and the parameter along each cell edge where it changes sign, both in the cell's own [-1/2, 1/2]^SpaceDim frame. Neither value belongs to the cell alone: a corner is shared by the 2^SpaceDim cells meeting there and an edge by the four cells meeting along it, so two neighbouring cells reconstruct the same surface bit for bit rather than to within a tolerance. That is what makes a face aperture agree when it is computed from either side.

That agreement is between cells of one level. A cell's chords are straight at its own spacing, so on a face shared with cells of a finer level they are not what that level describes the face with, and the polyhedron this surface alone reconstructs is the level-local one. Which faces those are is not the surface's to know: it is recorded by the cut-cell connectivity of the level, and CutCellBody::restrictFace replaces such a face with the chords of the children covering it.

Member Function Documentation

◆ hasCrossing()

bool PolyhedralEB::CutCellSurface::hasCrossing ( const int a_edge) const
inlinenoexcept

Whether the edge carries a crossing.

Parameters
[in]a_edgeEdge index in [0, s_numEdges).
Returns
True if the implicit function changes sign along the edge.

◆ linearIn()

void PolyhedralEB::CutCellSurface::linearIn ( const void * a_buffer)
inlinenoexcept

Read the surface from a linear buffer written by linearOut.

Parameters
[in]a_bufferBuffer written by linearOut.

◆ linearOut()

void PolyhedralEB::CutCellSurface::linearOut ( void * a_buffer) const
inlinenoexcept

Write the surface into a linear buffer, as Chombo's containers ask of their payload.

Parameters
[out]a_bufferBuffer of at least linearSize() bytes.

◆ linearSize()

int PolyhedralEB::CutCellSurface::linearSize ( ) const
inlinenoexcept

Number of bytes the surface occupies in a linear buffer, as Chombo's containers ask of their payload.

Returns
sizeof the crossings, the corners, the face decisions and the role together.

Member Data Documentation

◆ m_crossing

Real PolyhedralEB::CutCellSurface::m_crossing[s_numEdges]

Position along an edge where the implicit function changes sign.

Parameterised from the edge's low corner, so that both cells sharing the edge read the same value. Only meaningful where hasCrossing is true.

◆ m_fluidJoined

int PolyhedralEB::CutCellSurface::m_fluidJoined

Which faces join their fluid corners, one bit per face whose corners alternate in sign.

Bit 2 * dir + side in three dimensions, bit 0 for the cell itself in two. Four alternating corners cannot say whether the face's two fluid corners or its two solid ones meet across it; the implicit function at the centre of the face does, and is read where the surface is built, so that every cell sharing the face pairs its chords alike and a receiver of the surface never evaluates the function.


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