OGS
MeshToolsLib::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 MeshToolsLib::ElementQualityMetric:
[legend]
Collaboration diagram for MeshToolsLib::ElementQualityMetric:
[legend]

Public Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

◆ ElementQualityMetric()

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

Definition at line 23 of file ElementQualityMetric.cpp.

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

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

◆ ~ElementQualityMetric()

virtual MeshToolsLib::ElementQualityMetric::~ElementQualityMetric ( )
virtualdefault

Member Function Documentation

◆ calculateQuality()

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

◆ getElementQuality()

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

Returns the result vector.

Definition at line 42 of file ElementQualityMetric.cpp.

43{
45}

References _element_quality_metric.

◆ getHistogram()

BaseLib::Histogram< double > MeshToolsLib::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 29 of file ElementQualityMetric.cpp.

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

Member Data Documentation

◆ _element_quality_metric

◆ _max

double MeshToolsLib::ElementQualityMetric::_max = 0
protected

◆ _mesh

◆ _min

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

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