![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Performs triangulation of a 2D cell using the Triangle library. More...
#include <simplexify.hpp>
Public Types | |
| using | float_t = triangle::REAL |
| Defines the floating-point type used in the Triangle library. | |
| using | index_t = int32_t |
| Defines the integer type used in the Triangle library. | |
| using | PointType = const Eigen::Vector<float_t, dim> |
| using | PointsType = const Eigen::Matrix<float_t, dim, -1> |
| using | SimplexesType = const Eigen::Matrix<index_t, dim + 1, -1> |
| using | SubsimplexesType = const Eigen::Matrix<index_t, dim, -1> |
| using | PointsViewType = Eigen::Map<PointsType> |
| using | SimplexesViewType = Eigen::Map<SimplexesType> |
| using | SubsimplexesViewType = Eigen::Map<SubsimplexesType> |
Public Member Functions | |
| Triangulation (const geometry::Cell2D< float_t > &cell, triangle::behavior options=s_triangle_default_options) | |
| Constructs a Triangulation object for a given 2D cell. | |
| ~Triangulation () | |
| Destructor for the Triangulation class. | |
| index_t | getNumTriangles () const |
| Gets the number of triangles in the triangulation. | |
| index_t | getNumPoints () const |
| Gets the number of points in the triangulation. | |
| const PointsViewType & | getPointList () const |
| Gets the list of points in the triangulation. | |
| const SimplexesViewType & | getTriangleList () const |
| Gets the list of triangles in the triangulation. | |
| const SubsimplexesViewType & | getSurfaceSegmentList () const |
| Gets the list of edges of the boundary of the triangulation. | |
| const auto & | cell () const |
| Gets a reference to the cell. | |
Static Public Attributes | |
| static constexpr int32_t | dim = 2 |
| static const triangle::behavior | s_triangle_default_options |
| static constexpr index_t | s_buffer_size = 256 |
| Static constant defining the size of the static buffer for avoiding dynamic allocation of segment lists. The enumeration is always the same since the cell already provides the vertices in the correct order. | |
Protected Attributes | |
| const geometry::Cell2D< float_t > & | m_cell |
| The input 2D geometric cell for triangulation. | |
| struct triangle::triangulateio | m_in |
| Input structure for the Triangle library. | |
| struct triangle::triangulateio | m_out |
| Output structure for the Triangle library. | |
| std::vector< index_t > | m_segmentlist |
| Dynamic buffer where we store the segment list. It is used only if the static buffer is not large enough. | |
| index_t | m_static_segmentlist [s_buffer_size] |
| Static buffer where we store the segment list. | |
| std::unique_ptr< PointsViewType > | m_point_list |
| Unique pointer to an Eigen::Map representing the list of points in the triangulation. | |
| std::unique_ptr< SimplexesViewType > | m_triangle_list |
| Unique pointer to an Eigen::Map representing the list of triangles in the triangulation. | |
| std::unique_ptr< SubsimplexesViewType > | m_surface_segment_list |
| Unique pointer to an Eigen::Map representing the list of edges in the boundary of the triangulation. | |
Performs triangulation of a 2D cell using the Triangle library.
This class handles the generation of a triangulation for a given 2D cell and provides access to the resulting points and triangles. It leverages the Triangle library [https://www.cs.cmu.edu/~quake/triangle.html] under the hood for computational geometry operations.
| using vulpes::geometry::Triangulation::float_t = triangle::REAL |
Defines the floating-point type used in the Triangle library.
| using vulpes::geometry::Triangulation::index_t = int32_t |
Defines the integer type used in the Triangle library.
| using vulpes::geometry::Triangulation::PointsType = const Eigen::Matrix<float_t, dim, -1> |
| using vulpes::geometry::Triangulation::PointsViewType = Eigen::Map<PointsType> |
| using vulpes::geometry::Triangulation::PointType = const Eigen::Vector<float_t, dim> |
| using vulpes::geometry::Triangulation::SimplexesType = const Eigen::Matrix<index_t, dim + 1, -1> |
| using vulpes::geometry::Triangulation::SimplexesViewType = Eigen::Map<SimplexesType> |
| using vulpes::geometry::Triangulation::SubsimplexesType = const Eigen::Matrix<index_t, dim, -1> |
| using vulpes::geometry::Triangulation::SubsimplexesViewType = Eigen::Map<SubsimplexesType> |
|
explicit |
Constructs a Triangulation object for a given 2D cell.
| cell | A 2D cell to be triangulated, represented by geometry::Cell2D. |
| options | Triangle library options |
| vulpes::geometry::Triangulation::~Triangulation | ( | ) |
Destructor for the Triangulation class.
Cleans up the resources allocated by the Triangle library.
|
inline |
Gets a reference to the cell.
|
inline |
Gets the number of points in the triangulation.
|
inline |
Gets the number of triangles in the triangulation.
|
inline |
Gets the list of points in the triangulation.
The points are represented as a 2xN Eigen matrix where each column is a point (x, y).
|
inline |
Gets the list of edges of the boundary of the triangulation.
|
inline |
Gets the list of triangles in the triangulation.
The triangles are represented as a 3xM Eigen matrix where each column contains the indices of the three vertices of a triangle.
|
staticconstexpr |
|
protected |
The input 2D geometric cell for triangulation.
|
protected |
Input structure for the Triangle library.
|
protected |
Output structure for the Triangle library.
|
protected |
Unique pointer to an Eigen::Map representing the list of points in the triangulation.
The data is generated by Triangle in m_out
|
protected |
Dynamic buffer where we store the segment list. It is used only if the static buffer is not large enough.
|
protected |
Static buffer where we store the segment list.
|
protected |
Unique pointer to an Eigen::Map representing the list of edges in the boundary of the triangulation.
The data is a view to m_in.segmentlist.
|
protected |
Unique pointer to an Eigen::Map representing the list of triangles in the triangulation.
The data is generated by Triangle in m_out.
|
staticconstexpr |
Static constant defining the size of the static buffer for avoiding dynamic allocation of segment lists. The enumeration is always the same since the cell already provides the vertices in the correct order.
|
static |