23#ifndef VULPES_GEOMETRY_CELL_HPP_
24#define VULPES_GEOMETRY_CELL_HPP_
31#include <boost/unordered/unordered_flat_map.hpp>
42template <
typename FloatType,
typename IndexType>
44template <
typename FloatType,
typename IndexType>
50template <
bool PPoly,
typename FloatType,
typename IndexType>
53template <
bool PPoly,
typename FloatType,
typename IndexType>
56template <
bool PPoly,
typename FloatType,
typename IndexType>
62template <
bool PPoly,
typename FloatType,
typename IndexType>
65template <
bool PPoly,
typename FloatType,
typename IndexType>
68template <
bool PPoly,
bool Pruning,
typename FloatType,
typename IndexType>
97template <
typename FloatType,
typename IndexType =
int32_t>
136 Eigen::Matrix<FloatType, 2, -1, Eigen::ColMajor>
m_vtxs;
137 Eigen::Matrix<FloatType, 2, -1, Eigen::ColMajor>
m_normals;
150template <
typename FloatType,
typename IndexType>
231 std::vector<std::array<IndexType, 2>>
m_edges;
266 typename = std::enable_if_t<(Dim == 2) || (Dim == 3)>>
267using Cell = std::conditional_t<
A class that behaves like a vector of vectors, providing automatic row range checking.
Definition crs_map.hpp:758
Definition crs_map.hpp:72
A class that represents a tetrahedral matrix or tensor, with optional support for higher-dimensional ...
Definition tensor.hpp:307
A class that represents a triangular or square matrix, with optional support for tensor-like multi-di...
Definition tensor.hpp:60
auto diameter() const
Definition cell.hpp:126
void init(CellInitOptionsType cell_init_options)
Definition cell.cpp:83
Eigen::Vector< FloatType, -1 > m_face_kb
Definition cell.hpp:147
auto & vtxs()
Definition cell.hpp:120
const auto & faceKb() const
Definition cell.hpp:132
FloatType m_measure
Definition cell.hpp:141
void computeInscribedDiameter()
Definition cell.cpp:120
const auto & faceDiam() const
Definition cell.hpp:130
Eigen::Matrix< FloatType, 2, -1, Eigen::ColMajor > m_normals
Definition cell.hpp:137
auto frontierMeasure() const
Definition cell.hpp:129
auto inscribedDiameter() const
Definition cell.hpp:127
const auto & vtxs() const
Definition cell.hpp:119
Eigen::Index nedges() const
Definition cell.hpp:124
Eigen::Matrix< FloatType, 2, 2 > m_bbox
Definition cell.hpp:138
Eigen::Matrix< FloatType, 2, -1, Eigen::ColMajor > m_vtxs
Definition cell.hpp:136
void computeCellDiameter()
Definition cell.cpp:109
auto measure() const
Definition cell.hpp:128
void computeNormals()
Definition cell.cpp:71
Eigen::Vector< FloatType, 2 > m_barycenter
Definition cell.hpp:144
Eigen::Vector< FloatType, -1 > m_face_diameter
Definition cell.hpp:146
void computeFaceKb()
Definition cell.cpp:149
const auto & faceMeasures() const
Definition cell.hpp:131
void computeMeasure(bool compute_barycenter)
Definition cell.cpp:167
FloatType m_frontier_measure
Definition cell.hpp:142
FloatType m_inscribed_diameter
Definition cell.hpp:140
const auto & normals() const
Definition cell.hpp:122
void computeFaceDiameter()
Definition cell.cpp:136
FloatType m_diameter
Definition cell.hpp:139
Eigen::Vector< FloatType, -1 > m_face_measures
Definition cell.hpp:143
void computeBbox()
Definition cell.hpp:106
const auto & barycenter() const
Definition cell.hpp:125
Eigen::Index nfaces() const
Definition cell.hpp:123
const auto & bbox() const
Definition cell.hpp:121
const auto & faceMeasures() const
Definition cell.hpp:216
void buildInverseMaps()
Definition cell.cpp:420
void init(CellInitOptionsType cell_init_options)
Definition cell.cpp:242
Eigen::Vector< FloatType, -1 > m_face_diameter
Definition cell.hpp:258
void computeInscribedDiameter()
Definition cell.cpp:295
const auto & getEdgesToCompute() const
Definition cell.hpp:202
auto frontierMeasure() const
Definition cell.hpp:214
void computeFaceKb()
Definition cell.cpp:382
void findEdgesToCompute()
Definition cell.cpp:502
Eigen::Matrix< FloatType, 3, -1 > m_vtxs
Definition cell.hpp:233
bool m_inverse_map_built
Definition cell.hpp:225
const auto & faceDiam() const
Definition cell.hpp:215
const auto & faceKb() const
Definition cell.hpp:217
const auto & getFaceCenterIdx() const
Definition cell.hpp:198
const auto & faces() const
Definition cell.hpp:183
FloatType m_frontier_measure
Definition cell.hpp:254
const auto & edges() const
Definition cell.hpp:190
Eigen::Matrix< FloatType, 3, -1 > m_normals
Definition cell.hpp:235
Eigen::Vector< FloatType, 3 > m_barycenter
Definition cell.hpp:256
std::vector< std::array< IndexType, 2 > > m_edges_to_faces
Definition cell.hpp:240
FloatType m_inscribed_diameter
Definition cell.hpp:252
const auto & getEdgeToFaces() const
Definition cell.hpp:194
auto & vtxs()
Definition cell.hpp:182
void computeNormals()
Definition cell.cpp:333
datastructure::CrsMap< IndexType, IndexType > m_vtx_to_faces
Definition cell.hpp:247
std::vector< std::array< IndexType, 2 > > m_edges
Definition cell.hpp:231
Eigen::Vector< FloatType, -1 > m_face_kb
Definition cell.hpp:259
bool m_edges_to_compute_built
Definition cell.hpp:226
auto measure() const
Definition cell.hpp:213
Eigen::Index nfaces() const
Definition cell.hpp:184
void computeCellDiameter()
Definition cell.cpp:284
Eigen::Matrix< FloatType, 3, 2 > m_bbox
Definition cell.hpp:234
std::vector< IndexType > m_edges_to_compute
Definition cell.hpp:245
FloatType m_diameter
Definition cell.hpp:251
const auto & vtxs() const
Definition cell.hpp:181
datastructure::CrsMap< IndexType, IndexType > m_face_to_edge
Definition cell.hpp:249
const auto & normals() const
Definition cell.hpp:189
void computeFaceDiameter()
Definition cell.cpp:367
bool m_local_map_built
Definition cell.hpp:224
datastructure::CrsMap< IndexType, IndexType > m_vtx_to_edge
Definition cell.hpp:248
void buildEdgeToFace()
Definition cell.cpp:455
void computeMeasure(bool compute_barycenter)
Definition cell.cpp:313
Eigen::Index nedges() const
Definition cell.hpp:185
const auto & barycenter() const
Definition cell.hpp:211
const auto & bbox() const
Definition cell.hpp:210
FloatType m_measure
Definition cell.hpp:253
auto diameter() const
Definition cell.hpp:212
datastructure::CrsMap< IndexType, IndexType > m_faces
Definition cell.hpp:229
void computeBbox()
Definition cell.hpp:165
const auto & getVtxToFace() const
Definition cell.hpp:206
std::vector< IndexType > m_face_xF_idx
Definition cell.hpp:242
Eigen::Vector< FloatType, -1 > m_face_measures
Definition cell.hpp:255
A class for a 2D mesh, inheriting from MeshBase.
Definition mesh_2d.hpp:94
Represents a 3D mesh.
Definition mesh_3d.hpp:82
Definition abs_agg_model.cpp:40
Eigen::Matrix< DataType, Dim, 1, Eigen::ColMajor > Point
Definition traits.hpp:34
std::conditional_t< Dim==2, Cell2D< FloatType, IndexType >, Cell3D< FloatType, IndexType > > Cell
Definition cell.hpp:267
std::underlying_type_t< CellInitOptions > CellInitOptionsType
Definition cell.hpp:95
CellInitOptions
Definition cell.hpp:78
@ CellInitAll
Definition cell.hpp:92
@ CellInitEdgeToCompute
Definition cell.hpp:83
@ CellInitVtxOnly
Definition cell.hpp:79
@ CellInitFaceKb
Definition cell.hpp:90
@ CellInitFaceDiameter
Definition cell.hpp:89
@ CellInitInverseMaps
Definition cell.hpp:82
@ CellInitBarycenter
Definition cell.hpp:88
@ CellInitFaces
Definition cell.hpp:84
@ CellInitLocalMaps
Definition cell.hpp:81
@ CellInitBBox
Definition cell.hpp:85
@ CellInitMeasure
Definition cell.hpp:87
@ CellInitNormals
Definition cell.hpp:80
@ CellInitInscribedDiameter
Definition cell.hpp:91
@ CellInitDiameter
Definition cell.hpp:86
datastructure::TetraTensor< PPoly, false, FloatType, IndexType > VolumeIntegral3D
Definition cell.hpp:63
std::pair< VolumeIntegral3D< PPoly, FloatType, IndexType >, LowerIntegral3D< PPoly, FloatType, IndexType > > integrateMonomialsQFree3D(const geometry::Cell3D< FloatType, IndexType > &elem, IndexType deg)
Computes the volume and lower-dimensional integrals over a 3D element without quadrature.
Definition qfree.cpp:106
datastructure::TriMatrix< PPoly, true, FloatType, IndexType > EdgeIntegral2D
Definition cell.hpp:54
datastructure::TetraTensor< PPoly, true, FloatType, IndexType > LowerIntegral3D
Definition cell.hpp:66
std::pair< AreaIntegral2D< PPoly, FloatType, IndexType >, EdgeIntegral2D< PPoly, FloatType, IndexType > > integrateMonomialsQFree2D(const geometry::Cell2D< FloatType, IndexType > &cell, IndexType deg)
Computes the 2D area and edge integrals over a polygonal cell without requiring quadrature points of ...
Definition qfree.cpp:36
datastructure::TriMatrix< PPoly, false, FloatType, IndexType > AreaIntegral2D
Definition cell.hpp:51
Definition cell_manager.hpp:38