13#ifndef CD_CUTCELLSURFACEIMPLEM_H
14#define CD_CUTCELLSURFACEIMPLEM_H
21#include <CD_NamespaceHeader.H>
23namespace PolyhedralEB {
27 for (
int edge = 0; edge <
s_numEdges; edge++) {
39 return m_crossing[a_edge] != s_noCrossing;
51 char* buffer =
static_cast<char*
>(a_buffer);
53 std::memcpy(buffer, m_crossing,
sizeof(m_crossing));
54 std::memcpy(buffer +
sizeof(m_crossing), m_corner,
sizeof(m_corner));
60 const char* buffer =
static_cast<const char*
>(a_buffer);
62 std::memcpy(m_crossing, buffer,
sizeof(m_crossing));
63 std::memcpy(m_corner, buffer +
sizeof(m_crossing),
sizeof(m_corner));
68#include <CD_NamespaceFooter.H>
Declaration of the data a cut cell's embedded boundary is reconstructed from.
void linearIn(const void *a_buffer) noexcept
Read the surface from a linear buffer written by linearOut.
Definition CD_CutCellSurfaceImplem.H:58
int linearSize() const noexcept
Number of bytes the surface occupies in a linear buffer, as Chombo's containers ask of their payload.
Definition CD_CutCellSurfaceImplem.H:43
bool hasCrossing(const int a_edge) const noexcept
Whether the edge carries a crossing.
Definition CD_CutCellSurfaceImplem.H:37
Real m_corner[s_numCorners]
Implicit function at the cell corners, ordered so that corner c has offset ((c >> d) & 1) in directio...
Definition CD_CutCellSurface.H:108
static constexpr int s_numEdges
Number of cell edges a crossing can sit on.
Definition CD_CutCellSurface.H:46
static constexpr Real s_noCrossing
Marks an edge whose endpoints lie on the same side of the interface.
Definition CD_CutCellSurface.H:56
static constexpr int s_numCorners
Number of cell corners.
Definition CD_CutCellSurface.H:51
Real m_crossing[s_numEdges]
Position along an edge where the implicit function changes sign.
Definition CD_CutCellSurface.H:102
CutCellSurface() noexcept
Constructor. Leaves every edge without a crossing and every corner at zero.
Definition CD_CutCellSurfaceImplem.H:25
void linearOut(void *a_buffer) const noexcept
Write the surface into a linear buffer, as Chombo's containers ask of their payload.
Definition CD_CutCellSurfaceImplem.H:49