OGS
ElementQualityMetric.cpp
Go to the documentation of this file.
1
15
#include "
ElementQualityMetric.h
"
16
17
#include <cmath>
18
19
#include "
MeshLib/Node.h
"
20
21
namespace
MeshToolsLib
22
{
23
ElementQualityMetric::ElementQualityMetric
(
MeshLib::Mesh
const
& mesh)
24
: _mesh(mesh)
25
{
26
_element_quality_metric
.resize(
_mesh
.
getNumberOfElements
(), -1.0);
27
}
28
29
BaseLib::Histogram<double>
ElementQualityMetric::getHistogram
(
30
std::size_t n_bins)
const
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
}
41
42
std::vector<double>
const
&
ElementQualityMetric::getElementQuality
()
const
43
{
44
return
_element_quality_metric
;
45
}
46
}
// namespace MeshToolsLib
ElementQualityMetric.h
Definition of the ElementQualityMetricBase class.
Node.h
Definition of the Node class.
BaseLib::Histogram
Definition
Histogram.h:31
MeshLib::Mesh
Definition
Mesh.h:43
MeshLib::Mesh::getNumberOfElements
std::size_t getNumberOfElements() const
Get the number of elements.
Definition
Mesh.h:97
MeshToolsLib::ElementQualityMetric::_element_quality_metric
std::vector< double > _element_quality_metric
Definition
ElementQualityMetric.h:53
MeshToolsLib::ElementQualityMetric::getHistogram
virtual BaseLib::Histogram< double > getHistogram(std::size_t n_bins=0) const
Definition
ElementQualityMetric.cpp:29
MeshToolsLib::ElementQualityMetric::ElementQualityMetric
ElementQualityMetric(MeshLib::Mesh const &mesh)
Definition
ElementQualityMetric.cpp:23
MeshToolsLib::ElementQualityMetric::_mesh
MeshLib::Mesh const & _mesh
Definition
ElementQualityMetric.h:52
MeshToolsLib::ElementQualityMetric::getElementQuality
std::vector< double > const & getElementQuality() const
Returns the result vector.
Definition
ElementQualityMetric.cpp:42
MeshToolsLib
Definition
Node.h:29
MeshToolsLib
MeshQuality
ElementQualityMetric.cpp
Generated by
1.12.0