OGS
MeshLib::ElementQualityMetric Class Referenceabstract

Detailed Description

Base class for calculating the quality of mesh element based on a given metric

Definition at line 30 of file ElementQualityMetric.h.

#include <ElementQualityMetric.h>

Inheritance diagram for MeshLib::ElementQualityMetric:
[legend]
Collaboration diagram for MeshLib::ElementQualityMetric:
[legend]

Public Member Functions

 ElementQualityMetric (Mesh const &mesh)
 
virtual ~ElementQualityMetric ()=default
 
virtual void calculateQuality ()=0
 Calculates the quality metric for each element of the mesh. More...
 
std::vector< double > const & getElementQuality () const
 Returns the result vector. More...
 
virtual BaseLib::Histogram< double > getHistogram (std::size_t n_bins=0) const
 

Protected Attributes

double _min = std::numeric_limits<double>::max()
 
double _max = 0
 
Mesh const & _mesh
 
std::vector< double > _element_quality_metric
 

Constructor & Destructor Documentation

◆ ElementQualityMetric()

MeshLib::ElementQualityMetric::ElementQualityMetric ( Mesh const &  mesh)
explicit

Definition at line 23 of file ElementQualityMetric.cpp.

23 : _mesh(mesh)
24{
26}
std::vector< double > _element_quality_metric
std::size_t getNumberOfElements() const
Get the number of elements.
Definition: Mesh.h:91

References _element_quality_metric, _mesh, and MeshLib::Mesh::getNumberOfElements().

◆ ~ElementQualityMetric()

virtual MeshLib::ElementQualityMetric::~ElementQualityMetric ( )
virtualdefault

Member Function Documentation

◆ calculateQuality()

virtual void MeshLib::ElementQualityMetric::calculateQuality ( )
pure virtual

Calculates the quality metric for each element of the mesh.

Implemented in MeshLib::AngleSkewMetric, MeshLib::EdgeRatioMetric, MeshLib::ElementSizeMetric, MeshLib::RadiusEdgeRatioMetric, and MeshLib::SizeDifferenceMetric.

◆ getElementQuality()

std::vector< double > const & MeshLib::ElementQualityMetric::getElementQuality ( ) const

Returns the result vector.

Definition at line 41 of file ElementQualityMetric.cpp.

42{
44}

References _element_quality_metric.

◆ getHistogram()

BaseLib::Histogram< double > MeshLib::ElementQualityMetric::getHistogram ( std::size_t  n_bins = 0) const
virtual

Returns a histogram of the quality vector separated into the given number of bins. If no number of bins is specified, one will be calculated based on the Sturges criterium.

Definition at line 28 of file ElementQualityMetric.cpp.

30{
31 if (n_bins == 0)
32 {
33 n_bins = static_cast<std::size_t>(
34 1 +
35 3.3 * std::log(static_cast<float>((_mesh.getNumberOfElements()))));
36 }
37
38 return BaseLib::Histogram<double>(getElementQuality(), n_bins, true);
39}
std::vector< double > const & getElementQuality() const
Returns the result vector.

Member Data Documentation

◆ _element_quality_metric

◆ _max

◆ _mesh

◆ _min

double MeshLib::ElementQualityMetric::_min = std::numeric_limits<double>::max()
protected

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