chombo-discharge
Loading...
Searching...
No Matches
CD_Triangle.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_TRIANGLE_H
14#define CD_TRIANGLE_H
15
16// Std includes
17#include <array>
18
19// Chombo includes
20#include <RealVect.H>
21
22// Our includes
23#include <EBGeometry.hpp>
24#include <CD_NamespaceHeader.H>
25
29class Triangle : public EBGeometry::Triangle<Real, std::array<Real, 3>>
30{
31public:
35 using Vec3 = EBGeometry::Vec3T<Real>;
36
44
52
57
64 void
66
73 void
75
80 void
82
88 Vec3
90
102 bool
104
116 Real
118
124
135};
136
137#include <CD_NamespaceFooter.H>
138
139#endif
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
Class that represents a single triangle together with associated metadata on the vertices (one float ...
Definition CD_Triangle.H:30
void setVertexPositions(const std::array< Vec3, 3 > &a_vertexPositions) noexcept
Set vertex positions and recompute the triangle area.
Definition CD_Triangle.cpp:32
static Real computeTriangleArea(const Vec3 &a_x1, const Vec3 &a_x2, const Vec3 &a_x3) noexcept
Compute the area of a triangle defined by three vertices.
Definition CD_Triangle.cpp:70
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:35
Triangle() noexcept
Default constructor.
Definition CD_Triangle.cpp:17
Real interpolate(const Vec3 &a_point) const noexcept
Interpolate vertex data at a point using barycentric coordinates or IDW fallback.
Definition CD_Triangle.cpp:79
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:123
Vec3 projectToTrianglePlane(const Vec3 &a_point) const noexcept
Project the input point to the triangle plane.
Definition CD_Triangle.cpp:50