16#ifndef EBGEOMETRY_DCEL_RECONCILE_HPP
17#define EBGEOMETRY_DCEL_RECONCILE_HPP
39namespace ReconcileDetail {
124 uint64_t m_rootId = 0;
130 uint64_t m_vertexOffset = 0;
133 uint64_t m_edgeOffset = 0;
136 uint64_t m_faceOffset = 0;
141 uint32_t m_numVertices = 0;
144 uint32_t m_numEdges = 0;
147 uint32_t m_numFaces = 0;
185namespace ReconcileDetail {
207 operator()(
const std::size_t a_i)
const
223 mutable MeshT<T> m_mesh;
231 operator()(
const std::size_t a_i)
const noexcept
248 mutable MeshT<T> m_mesh;
258 PODVector<uint32_t> m_cornerBegin;
263 PODVector<Corner> m_corners;
268 PODVector<uint32_t> m_status;
276 operator()(
const std::size_t a_i)
const noexcept
278 const auto v =
static_cast<uint32_t
>(a_i);
279 const uint32_t begin = m_cornerBegin.at(m_base, v);
280 const uint32_t end = m_cornerBegin.at(m_base, v + 1);
282 VertexT<T>& vertex = m_mesh.getVertex(v);
283 const Vec3T<T> x0 = vertex.getPosition();
288 for (uint32_t c = begin; c < end; c++) {
289 const Corner& corner = m_corners.at(m_base, c);
290 const FaceT<T>& face = m_mesh.getFace(corner.m_face);
293 if (face.getNormal().length2() == T(0)) {
297 const Vec3T<T>& x1 = m_mesh.getVertex(corner.m_first).getPosition();
298 const Vec3T<T>& x2 = m_mesh.getVertex(corner.m_second).getPosition();
301 if (x0 == x1 || x0 == x2 || x1 == x2) {
302 m_status.at(m_base, 0) = 1;
313 vertex.normalizeNormalVector();
324#include "EBGeometry_DCEL_ReconcileImplem.hpp"
Declaration of a mesh class which stores a DCEL mesh (with signed distance functions)
Declaration of a vertex class for use in DCEL descriptions of polygon tessellations.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Utility macros for EBGeometry.
Placement-independent POD array views for the GPU memory foundation.
Growable bump arena for the GPU memory foundation.
void reconcile(const Mesh &a_mesh) noexcept
Reconcile internal logic.
void reconcile(const Mesh &a_mesh)
Reconcile face. This will compute the normal vector, area, centroid, and the 2D embedding of the poly...
DCEL mesh class - stores a doubly-connected edge mesh.
Definition EBGeometry_DCEL_Mesh.hpp:102
Edge & getEdge(uint32_t a_index) noexcept
Get modifiable half-edge by index.
Face & getFace(uint32_t a_index) noexcept
Get modifiable face by index.
Which faces touch each vertex of a mesh, checked and stored once, for DCEL::reconcile().
Definition EBGeometry_DCEL_Reconcile.hpp:81
friend void reconcile(Pool &a_pool, const MeshT< T > &a_mesh, const ReconcileSchedule &a_schedule)
DCEL::reconcile() reads the arrays.
ReconcileSchedule(Pool &a_pool, const MeshT< T > &a_mesh)
Check the topology of a_mesh and store which faces touch each vertex.
Growable bump arena over a MemoryResource.
Definition EBGeometry_Pool.hpp:188
static constexpr Vec3T< T > zeros() noexcept
Return a vector with x = y = z = 0.
Vec3T< T > angleWeightedTerm(const Vec3T< T > &a_x0, const Vec3T< T > &a_x1, const Vec3T< T > &a_x2, const Vec3T< T > &a_normal) noexcept
One face's term in a vertex's angle-weighted pseudonormal: the face's normal weighted by the angle th...
Definition EBGeometry_DCEL_Vertex.hpp:366
void reconcile(Pool &a_pool, const MeshT< T > &a_mesh, const ReconcileSchedule &a_schedule)
Reconcile the copy of a_mesh that lives in a_pool, after its vertices have moved: every face's normal...
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
Vec3T< T > normal(const F &a_function, const Vec3T< T > &a_point, const T &a_delta) noexcept
Outward unit normal of a function's level set, by central finite differences.
One corner of a face, as seen from the vertex at it: the face, and the vertices before and after the ...
Definition EBGeometry_DCEL_Reconcile.hpp:46
uint32_t m_second
The second neighbor found.
Definition EBGeometry_DCEL_Reconcile.hpp:54
uint32_t m_first
The first neighbor found walking the face's loop from its half-edge.
Definition EBGeometry_DCEL_Reconcile.hpp:51
uint32_t m_face
The face.
Definition EBGeometry_DCEL_Reconcile.hpp:48
Placement-independent descriptor of a POD array inside a Pool.
Definition EBGeometry_PODVector.hpp:119