chombo-discharge
Loading...
Searching...
No Matches
CD_CutCellSurface.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_CUTCELLSURFACE_H
14#define CD_CUTCELLSURFACE_H
15
16// Chombo includes
17#include <RealVect.H>
18
19// Our includes
20#include <CD_NamespaceHeader.H>
21
22namespace PolyhedralEB {
23
41{
42public:
46 static constexpr int s_numEdges = 2 * SpaceDim * (SpaceDim - 1);
47
51 static constexpr int s_numCorners = 1 << SpaceDim;
52
56 static constexpr Real s_noCrossing = -1.0;
57
61 CutCellSurface() noexcept;
62
66 ~CutCellSurface() noexcept = default;
67
73 inline bool
74 hasCrossing(const int a_edge) const noexcept;
75
80 inline int
81 linearSize() const noexcept;
82
87 inline void
88 linearOut(void* a_buffer) const noexcept;
89
94 inline void
95 linearIn(const void* a_buffer) noexcept;
96
103
109};
110
111} // namespace PolyhedralEB
112
113#include <CD_NamespaceFooter.H>
114
116
117#endif
Implementation of CD_CutCellSurface.H.
The values a cut cell's embedded boundary is reconstructed from.
Definition CD_CutCellSurface.H:41
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