From 5b87a4b62661afc78fad2d54946ace429d346dd8 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 21:22:11 +0200 Subject: [PATCH 1/7] [MeL/MeshQuality] Make classes final. --- MeshLib/MeshQuality/ElementSizeMetric.h | 2 +- MeshLib/MeshQuality/RadiusEdgeRatioMetric.h | 2 +- MeshLib/MeshQuality/SizeDifferenceMetric.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MeshLib/MeshQuality/ElementSizeMetric.h b/MeshLib/MeshQuality/ElementSizeMetric.h index b3dde857f65..ea5ee0e918e 100644 --- a/MeshLib/MeshQuality/ElementSizeMetric.h +++ b/MeshLib/MeshQuality/ElementSizeMetric.h @@ -22,7 +22,7 @@ namespace MeshLib /** * Calculates the quality of mesh elements based on length/area/volume */ -class ElementSizeMetric : public ElementQualityMetric +class ElementSizeMetric final : public ElementQualityMetric { public: explicit ElementSizeMetric(Mesh const& mesh); diff --git a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h index 2b1361bf712..5c7d3b8767b 100644 --- a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h +++ b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.h @@ -23,7 +23,7 @@ namespace MeshLib * Calculates the quality of mesh elements based on the ratio between * radius of the smallest enclosing sphere and the shortest element edge */ -class RadiusEdgeRatioMetric : public ElementQualityMetric +class RadiusEdgeRatioMetric final : public ElementQualityMetric { public: explicit RadiusEdgeRatioMetric(Mesh const& mesh); diff --git a/MeshLib/MeshQuality/SizeDifferenceMetric.h b/MeshLib/MeshQuality/SizeDifferenceMetric.h index 6f03293697d..973d2b4763c 100644 --- a/MeshLib/MeshQuality/SizeDifferenceMetric.h +++ b/MeshLib/MeshQuality/SizeDifferenceMetric.h @@ -23,7 +23,7 @@ namespace MeshLib * Calculates the quality of mesh elements based on the difference of element * size in comparison to the size of its neighbors. */ -class SizeDifferenceMetric : public ElementQualityMetric +class SizeDifferenceMetric final : public ElementQualityMetric { public: explicit SizeDifferenceMetric(Mesh const& mesh); -- GitLab From 6849b068a8c65e321a78246346e0d2c29bc52408 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 13:53:09 +0200 Subject: [PATCH 2/7] [MeL/MeshSearch] MeshElementGrid: Rm unused GEOObjects include. --- MeshLib/MeshSearch/MeshElementGrid.cpp | 1 - MeshLib/MeshSearch/MeshElementGrid.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/MeshLib/MeshSearch/MeshElementGrid.cpp b/MeshLib/MeshSearch/MeshElementGrid.cpp index 5179afa35fe..6bdf32ec84e 100644 --- a/MeshLib/MeshSearch/MeshElementGrid.cpp +++ b/MeshLib/MeshSearch/MeshElementGrid.cpp @@ -15,7 +15,6 @@ #include <cmath> #include <memory> -#include "GeoLib/GEOObjects.h" #include "MeshLib/Elements/Element.h" #include "MeshLib/Mesh.h" #include "MeshLib/Node.h" diff --git a/MeshLib/MeshSearch/MeshElementGrid.h b/MeshLib/MeshSearch/MeshElementGrid.h index 0303c10eb98..01927e786fe 100644 --- a/MeshLib/MeshSearch/MeshElementGrid.h +++ b/MeshLib/MeshSearch/MeshElementGrid.h @@ -18,10 +18,6 @@ #include "GeoLib/AABB.h" #include "MathLib/Point3d.h" -namespace GeoLib { -class GEOObjects; -} - namespace MeshLib { // forward declarations -- GitLab From d753097b8e61617cc795d0e2f94e4c29e1729af9 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 14:26:04 +0200 Subject: [PATCH 3/7] [GL] Don't include Surface in Raster. --- Applications/Utils/FileConverter/TecPlotTools.cpp | 1 + GeoLib/Raster.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Applications/Utils/FileConverter/TecPlotTools.cpp b/Applications/Utils/FileConverter/TecPlotTools.cpp index 796e1bd9337..652156e93b6 100644 --- a/Applications/Utils/FileConverter/TecPlotTools.cpp +++ b/Applications/Utils/FileConverter/TecPlotTools.cpp @@ -16,6 +16,7 @@ #include <vector> #include "BaseLib/StringTools.h" +#include "GeoLib/Point.h" #include "InfoLib/GitInfo.h" #include "MeshLib/IO/VtkIO/VtuInterface.h" #include "MeshLib/Mesh.h" diff --git a/GeoLib/Raster.h b/GeoLib/Raster.h index c821049f0e0..faf08b421a2 100644 --- a/GeoLib/Raster.h +++ b/GeoLib/Raster.h @@ -16,7 +16,7 @@ #include <array> #include <utility> -#include "Surface.h" +#include "MathLib/Point3d.h" namespace GeoLib { -- GitLab From bdf2eb783ece64e0dbe161878b675d0e8a48af65 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 15:01:55 +0200 Subject: [PATCH 4/7] [MeL/ElementStatus] Make protected members private. --- MeshLib/ElementStatus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h index 5e4a4336748..9ac93065cd2 100644 --- a/MeshLib/ElementStatus.h +++ b/MeshLib/ElementStatus.h @@ -51,7 +51,7 @@ public: /// Returns the total number of active elements std::size_t getNumberOfActiveElements() const; -protected: +private: /// Sets the status of element i void setElementStatus(std::size_t i, bool status); -- GitLab From 30aea07918cd4ce6f8ba4ae691cb62dc63bf6d84 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 15:02:29 +0200 Subject: [PATCH 5/7] [MeL/ElementStatus] Clang format. --- MeshLib/ElementStatus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MeshLib/ElementStatus.h b/MeshLib/ElementStatus.h index 9ac93065cd2..a5c49285006 100644 --- a/MeshLib/ElementStatus.h +++ b/MeshLib/ElementStatus.h @@ -16,10 +16,11 @@ #include <vector> -namespace MeshLib { - class Mesh; - class Element; - class Node; +namespace MeshLib +{ +class Mesh; +class Element; +class Node; class ElementStatus { @@ -65,7 +66,6 @@ private: bool const _hasAnyInactive; std::vector<MeshLib::Node*> _vec_active_nodes; std::vector<MeshLib::Element*> _vec_active_eles; - }; /* class */ } // namespace MeshLib -- GitLab From 3b57336d50a660cfd1ca9f749022d34146da1589 Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 15:09:51 +0200 Subject: [PATCH 6/7] [MeL] Make classes CoordinateSystem{Type} final. --- MeshLib/CoordinateSystem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MeshLib/CoordinateSystem.h b/MeshLib/CoordinateSystem.h index d4dd07a4ef2..e8d6097e7bd 100644 --- a/MeshLib/CoordinateSystem.h +++ b/MeshLib/CoordinateSystem.h @@ -21,7 +21,7 @@ class Element; /** * \brief Coordinate system type */ -struct CoordinateSystemType +struct CoordinateSystemType final { enum type { @@ -36,7 +36,7 @@ struct CoordinateSystemType * * */ -class CoordinateSystem +class CoordinateSystem final { public: /// User provided coordinate system -- GitLab From dc8847f63d1de7571927ae78c9b40cfec357f94e Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Thu, 8 Jul 2021 15:11:06 +0200 Subject: [PATCH 7/7] [MeL] Clang format CoordinateSystem.h. --- MeshLib/CoordinateSystem.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/MeshLib/CoordinateSystem.h b/MeshLib/CoordinateSystem.h index e8d6097e7bd..0b912e6198d 100644 --- a/MeshLib/CoordinateSystem.h +++ b/MeshLib/CoordinateSystem.h @@ -15,7 +15,6 @@ namespace MeshLib { - class Element; /** @@ -40,19 +39,23 @@ class CoordinateSystem final { public: /// User provided coordinate system - explicit CoordinateSystem(unsigned char coord) : _type (coord) {} + explicit CoordinateSystem(unsigned char coord) : _type(coord) {} /// Decides for a given element - explicit CoordinateSystem(const Element &ele); + explicit CoordinateSystem(const Element& ele); /// Decides a coordinate system from a bounding box - explicit CoordinateSystem(const GeoLib::AABB &bbox) : _type(getCoordinateSystem(bbox)) {} + explicit CoordinateSystem(const GeoLib::AABB& bbox) + : _type(getCoordinateSystem(bbox)) + { + } /// get this coordinate type unsigned char getType() const { return _type; } /// get dimension size - unsigned getDimension() const { + unsigned getDimension() const + { if (hasZ()) { return 3; @@ -75,7 +78,7 @@ public: bool hasZ() const { return (_type & CoordinateSystemType::type::Z) != 0; } private: - unsigned char getCoordinateSystem(const GeoLib::AABB &bbox) const; + unsigned char getCoordinateSystem(const GeoLib::AABB& bbox) const; unsigned char _type; }; -- GitLab