OGS
RadiusEdgeRatioMetric.cpp
Go to the documentation of this file.
1
16
18#include "MeshLib/Node.h"
19
20namespace MeshToolsLib
21{
23{
24 std::vector<MeshLib::Element*> const& elements(_mesh.getElements());
25 std::size_t const nElements(_mesh.getNumberOfElements());
26 for (std::size_t k(0); k < nElements; k++)
27 {
28 MeshLib::Element const& elem(*elements[k]);
29 std::size_t const n_nodes(elem.getNumberOfBaseNodes());
30 std::vector<MathLib::Point3d*> pnts(n_nodes);
31 std::copy_n(elem.getNodes(), n_nodes, pnts.begin());
33 auto const& [min, max] = computeSqrEdgeLengthRange(elem);
34 _element_quality_metric[k] = std::sqrt(min) / (2 * s.getRadius());
35 }
36}
37
38} // namespace MeshToolsLib
Calculation of a minimum bounding sphere for a vector of points.
Definition of the Node class.
Definition of the RadiusEdgeRatioMetric class.
double getRadius() const
Returns the radius of the sphere.
virtual unsigned getNumberOfBaseNodes() const =0
virtual Node *const * getNodes() const =0
Get array of element nodes.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
std::size_t getNumberOfElements() const
Get the number of elements.
Definition Mesh.h:97
std::vector< double > _element_quality_metric
void calculateQuality() override
Calculates the quality metric for each element of the mesh.