OGS
ElementQualityMetric.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <cmath>
7
8#include "MeshLib/Node.h"
9
10namespace MeshToolsLib
11{
13 : _mesh(mesh)
14{
15 _element_quality_metric.resize(_mesh.getNumberOfElements(), -1.0);
16}
17
19 std::size_t n_bins) const
20{
21 if (n_bins == 0)
22 {
23 n_bins = static_cast<std::size_t>(
24 1 +
25 3.3 * std::log(static_cast<float>((_mesh.getNumberOfElements()))));
26 }
27
28 return BaseLib::Histogram<double>(getElementQuality(), n_bins, true);
29}
30
31std::vector<double> const& ElementQualityMetric::getElementQuality() const
32{
34}
35} // namespace MeshToolsLib
std::vector< double > _element_quality_metric
virtual BaseLib::Histogram< double > getHistogram(std::size_t n_bins=0) const
ElementQualityMetric(MeshLib::Mesh const &mesh)
std::vector< double > const & getElementQuality() const
Returns the result vector.