OGS
MeshValidation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <array>
7#include <limits>
8#include <vector>
9
11
12namespace MeshLib
13{
14class Mesh;
15class Element;
16} // namespace MeshLib
17
18namespace MeshToolsLib
19{
20
24struct MeshValidation final
25{
31 static bool allNodesUsed(MeshLib::Mesh const& mesh);
32
40 static bool existCollapsibleNodes(MeshLib::Mesh& mesh, double const eps);
41
46 static void evaluateElementGeometry(MeshLib::Mesh const& mesh);
47
55 static std::vector<ElementErrorCode> testElementGeometry(
56 const MeshLib::Mesh& mesh,
57 double min_volume = std::numeric_limits<double>::epsilon());
58
63 static std::array<std::string,
64 static_cast<std::size_t>(ElementErrorFlag::MaxValue)>
65 ElementErrorCodeOutput(const std::vector<ElementErrorCode>& error_codes);
66
79 static unsigned detectHoles(MeshLib::Mesh const& mesh);
80};
81
82} // namespace MeshToolsLib
A collection of methods for testing mesh quality and correctness.
static unsigned detectHoles(MeshLib::Mesh const &mesh)
static std::array< std::string, static_cast< std::size_t >(ElementErrorFlag::MaxValue)> ElementErrorCodeOutput(const std::vector< ElementErrorCode > &error_codes)
static bool existCollapsibleNodes(MeshLib::Mesh &mesh, double const eps)
static bool allNodesUsed(MeshLib::Mesh const &mesh)
static std::vector< ElementErrorCode > testElementGeometry(const MeshLib::Mesh &mesh, double min_volume=std::numeric_limits< double >::epsilon())
static void evaluateElementGeometry(MeshLib::Mesh const &mesh)