chombo-discharge
Loading...
Searching...
No Matches
CD_Triangle.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2026 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_Triangle_H
13#define CD_Triangle_H
14
15// Std includes
16#include <array>
17
18// Chombo includes
19#include <RealVect.H>
20
21// Our includes
22#include <EBGeometry.hpp>
23#include <CD_NamespaceHeader.H>
24
28class Triangle : public EBGeometry::Triangle<Real, std::array<Real, 3>>
29{
30public:
34 using Vec3 = EBGeometry::Vec3T<Real>;
35
43
51
56
63 void
65
72 void
74
79 void
81
87 Vec3
89
101 bool
103
115 Real
117
123
134};
135
136#include <CD_NamespaceFooter.H>
137
138#endif
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
Class that represents a single triangle together with associated metadata on the vertices (one float ...
Definition CD_Triangle.H:29
void setVertexPositions(const std::array< Vec3, 3 > &a_vertexPositions) noexcept
Set vertex positions and recompute the triangle area.
Definition CD_Triangle.cpp:32
void computeArea() noexcept
Compute and store the triangle area in m_area.
Definition CD_Triangle.cpp:44
bool isInside(const Vec3 &a_point) const noexcept
Check if a point lies inside the triangle.
Definition CD_Triangle.cpp:56
EBGeometry::Vec3T< Real > Vec3
Alias for always-3D vector type.
Definition CD_Triangle.H:34
Triangle() noexcept
Default constructor.
Definition CD_Triangle.cpp:16
Real interpolate(const Vec3 &a_point) const noexcept
Interpolate vertex data at a point using barycentric coordinates or IDW fallback.
Definition CD_Triangle.cpp:83
Real computeTriangleArea(const Vec3 a_x1, const Vec3 a_x2, const Vec3 a_x3) const noexcept
Compute the area of a triangle defined by three vertices.
Definition CD_Triangle.cpp:74
void setVertexData(const std::array< Real, 3 > &a_vertexData) noexcept
Set meta-data on the vertices.
Definition CD_Triangle.cpp:38
Real m_area
Triangle area.
Definition CD_Triangle.H:122
Vec3 projectToTrianglePlane(const Vec3 &a_point) const noexcept
Project the input point to the triangle plane.
Definition CD_Triangle.cpp:50