Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::geometry::MeshMetrics< MeshType > Class Template Reference

A class template that can be used to compute various mesh metrics (CircleRatio, AreaToPerimeterRatio, UniformityRatio, VolumeDifference). More...

#include <mesh_metrics.hpp>

Public Types

using float_t = typename MeshType::float_t
using index_t = typename MeshType::index_t
using MetricsVec = std::vector<float_t>
using CellType = Cell<MeshType::self_dim, float_t, index_t>

Public Member Functions

 MeshMetrics (const MeshType &mesh, MetricsInitOptionsType options=MetricsInitOptions::AllMetrics)
 Construct a new Mesh Metrics object.
const MetricsVec & getCircleRatios () const
 Getter for the vector of the cells' circle ratios.
const MetricsVec & getAreaToPerimeterRatios () const
 Getter for the vector of the cells' area to perimeter ratios.
const MetricsVec & getUniformityFactors () const
 Getter for the vector of the cells' uniformity factors.
const MetricsVec & getVolumeDifferences () const
 Getter for the vector of the cells' volume difference.
const std::array< MetricsVec, 4 > & getMetrics () const
 Getter for the array of all the metrics.
void computeCircleRatios ()
 method used to compute the mesh circle ratios
void computeAreaToPerimeterRatios ()
 method used to compute the mesh area to perimeter ratios
void computeUniformityFactors ()
 method used to compute the mesh uniformity factors
void computeVolumeDifferences ()
 method used to compute the mesh volume differences

Static Public Attributes

static constexpr index_t dim = MeshType::self_dim

Private Attributes

const MeshType & m_mesh
const MetricsInitOptionsType m_options
const index_t m_n_cells
std::vector< CellType > m_cells
std::array< MetricsVec, 4 > m_all_metrics

Detailed Description

template<typename MeshType>
class vulpes::geometry::MeshMetrics< MeshType >

A class template that can be used to compute various mesh metrics (CircleRatio, AreaToPerimeterRatio, UniformityRatio, VolumeDifference).

The MeshMetrics class template provides methods to compute and access various geometric quality metrics for each cell in a mesh, such as circle ratio, area-to-perimeter ratio, uniformity factor, and volume difference. The metrics to be computed can be selected on construction via the MetricsInitOptions enum, allowing flexible and efficient analysis of mesh quality. Metrics are computed using the cell class and are stored internally for fast access. The class supports both 2D and 3D meshes, and is compatible with different floating-point and index types.

Template Parameters
MeshTypeThe particular mesh type on which the metrics have to be computed on (e.g. Mesh2D<double, int32_t>, etc.)

Member Typedef Documentation

◆ CellType

template<typename MeshType>
using vulpes::geometry::MeshMetrics< MeshType >::CellType = Cell<MeshType::self_dim, float_t, index_t>

◆ float_t

template<typename MeshType>
using vulpes::geometry::MeshMetrics< MeshType >::float_t = typename MeshType::float_t

◆ index_t

template<typename MeshType>
using vulpes::geometry::MeshMetrics< MeshType >::index_t = typename MeshType::index_t

◆ MetricsVec

template<typename MeshType>
using vulpes::geometry::MeshMetrics< MeshType >::MetricsVec = std::vector<float_t>

Constructor & Destructor Documentation

◆ MeshMetrics()

template<typename MeshType>
vulpes::geometry::MeshMetrics< MeshType >::MeshMetrics ( const MeshType & mesh,
MetricsInitOptionsType options = MetricsInitOptions::AllMetrics )
explicit

Construct a new Mesh Metrics object.

Parameters
meshA reference to the mesh we want to compute the metrics on
optionsA parameter that specifies the metrics we want initialized on construction. If not specified it has value AllMetrics

Member Function Documentation

◆ computeAreaToPerimeterRatios()

template<typename MeshType>
void vulpes::geometry::MeshMetrics< MeshType >::computeAreaToPerimeterRatios ( )

method used to compute the mesh area to perimeter ratios

◆ computeCircleRatios()

template<typename MeshType>
void vulpes::geometry::MeshMetrics< MeshType >::computeCircleRatios ( )

method used to compute the mesh circle ratios

◆ computeUniformityFactors()

template<typename MeshType>
void vulpes::geometry::MeshMetrics< MeshType >::computeUniformityFactors ( )

method used to compute the mesh uniformity factors

◆ computeVolumeDifferences()

template<typename MeshType>
void vulpes::geometry::MeshMetrics< MeshType >::computeVolumeDifferences ( )

method used to compute the mesh volume differences

◆ getAreaToPerimeterRatios()

template<typename MeshType>
const MeshMetrics< MeshType >::MetricsVec & vulpes::geometry::MeshMetrics< MeshType >::getAreaToPerimeterRatios ( ) const

Getter for the vector of the cells' area to perimeter ratios.

◆ getCircleRatios()

template<typename MeshType>
const MeshMetrics< MeshType >::MetricsVec & vulpes::geometry::MeshMetrics< MeshType >::getCircleRatios ( ) const

Getter for the vector of the cells' circle ratios.

◆ getMetrics()

template<typename MeshType>
const std::array< typename MeshMetrics< MeshType >::MetricsVec, 4 > & vulpes::geometry::MeshMetrics< MeshType >::getMetrics ( ) const

Getter for the array of all the metrics.

◆ getUniformityFactors()

template<typename MeshType>
const MeshMetrics< MeshType >::MetricsVec & vulpes::geometry::MeshMetrics< MeshType >::getUniformityFactors ( ) const

Getter for the vector of the cells' uniformity factors.

◆ getVolumeDifferences()

template<typename MeshType>
const MeshMetrics< MeshType >::MetricsVec & vulpes::geometry::MeshMetrics< MeshType >::getVolumeDifferences ( ) const

Getter for the vector of the cells' volume difference.

Member Data Documentation

◆ dim

template<typename MeshType>
index_t vulpes::geometry::MeshMetrics< MeshType >::dim = MeshType::self_dim
staticconstexpr

◆ m_all_metrics

template<typename MeshType>
std::array<MetricsVec, 4> vulpes::geometry::MeshMetrics< MeshType >::m_all_metrics
private

◆ m_cells

template<typename MeshType>
std::vector<CellType> vulpes::geometry::MeshMetrics< MeshType >::m_cells
private

◆ m_mesh

template<typename MeshType>
const MeshType& vulpes::geometry::MeshMetrics< MeshType >::m_mesh
private

◆ m_n_cells

template<typename MeshType>
const index_t vulpes::geometry::MeshMetrics< MeshType >::m_n_cells
private

◆ m_options

template<typename MeshType>
const MetricsInitOptionsType vulpes::geometry::MeshMetrics< MeshType >::m_options
private

The documentation for this class was generated from the following files: