diff --git a/MeshLib/Elements/Cell.cpp b/MeshLib/Elements/Cell.cpp index 02f4d763249e4f44f9e56d5c667f9241a005f2c9..5631fcbaae5d020f428b51b3a40d5474818ae443 100644 --- a/MeshLib/Elements/Cell.cpp +++ b/MeshLib/Elements/Cell.cpp @@ -20,6 +20,8 @@ namespace MeshLib { +const unsigned Cell::dimension; + Cell::Cell(unsigned value, std::size_t id) : Element(value, id) { diff --git a/MeshLib/Elements/Cell.h b/MeshLib/Elements/Cell.h index fac3a678b8cfb612b3ce615c4461fe6bd3945a8f..66ce7cce3bb01e53a57d05ab3d4146770786d63a 100644 --- a/MeshLib/Elements/Cell.h +++ b/MeshLib/Elements/Cell.h @@ -25,6 +25,9 @@ namespace MeshLib { class Cell : public Element { public: + /// Constant: Dimension of this mesh element + static const unsigned dimension = 3u; + /// Get the volume of this 3d element. virtual double getVolume() const { return getContent(); } diff --git a/MeshLib/Elements/CellRule.cpp b/MeshLib/Elements/CellRule.cpp deleted file mode 100644 index 391b492fa31d1ed5a18553cf04a52724df0ef7b3..0000000000000000000000000000000000000000 --- a/MeshLib/Elements/CellRule.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/** - * \copyright - * Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#include "CellRule.h" - -#include "logog/include/logog.hpp" - -#include "GeoLib/AnalyticalGeometry.h" - -#include "MeshLib/Node.h" -#include "Face.h" - -namespace MeshLib -{ - -const unsigned CellRule::dimension; - -} // end namespace MeshLib diff --git a/MeshLib/Elements/CellRule.h b/MeshLib/Elements/CellRule.h deleted file mode 100644 index 82e2af6388ac59c2120d168680fec83e6a8c3a96..0000000000000000000000000000000000000000 --- a/MeshLib/Elements/CellRule.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * \copyright - * Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#ifndef CELLRULE_H_ -#define CELLRULE_H_ - -#include "MeshLib/MeshEnums.h" -#include "Element.h" - -namespace MeshLib { - -/** - */ -class CellRule -{ -public: - /// Constant: Dimension of this mesh element - static const unsigned dimension = 3u; - -}; /* class */ - -} /* namespace */ - -#endif /* HEXRULE_H_ */ - diff --git a/MeshLib/Elements/FaceRule.cpp b/MeshLib/Elements/Edge.cpp similarity index 84% rename from MeshLib/Elements/FaceRule.cpp rename to MeshLib/Elements/Edge.cpp index fb12a1fded135c8d3bf1f29482f51783140539ce..93903130acc6b92155b90197c17bd9eba2ca14fe 100644 --- a/MeshLib/Elements/FaceRule.cpp +++ b/MeshLib/Elements/Edge.cpp @@ -7,11 +7,11 @@ * */ -#include "FaceRule.h" +#include "Edge.h" namespace MeshLib { -const unsigned FaceRule::dimension; +const unsigned Edge::dimension; } /* namespace */ diff --git a/MeshLib/Elements/Edge.h b/MeshLib/Elements/Edge.h index 6a212caf60f0db7b7b8f1ecd44af16a327255b99..df7eadd129e6a75b4099d4c1306a3c480f119758 100644 --- a/MeshLib/Elements/Edge.h +++ b/MeshLib/Elements/Edge.h @@ -25,6 +25,9 @@ namespace MeshLib { class Edge : public Element { public: + /// Constant: Dimension of this mesh element + static const unsigned dimension = 1u; + /// Get the length of this 1d element. virtual double getLength() const { return _content; } diff --git a/MeshLib/Elements/Face.cpp b/MeshLib/Elements/Face.cpp index 0c5748b9f16daa9e594ac7421af4627f28faf948..fdeb825d1c5f5e88738435b2a659caebdc84415e 100644 --- a/MeshLib/Elements/Face.cpp +++ b/MeshLib/Elements/Face.cpp @@ -21,6 +21,8 @@ namespace MeshLib { +const unsigned Face::dimension; + Face::Face(unsigned value, std::size_t id) : Element(value, id) { diff --git a/MeshLib/Elements/Face.h b/MeshLib/Elements/Face.h index e9c006dfc4e4bd85d19a850f5db2f799c4d04113..220c561ad7abc9e21a96f5fabc883d9200933caa 100644 --- a/MeshLib/Elements/Face.h +++ b/MeshLib/Elements/Face.h @@ -29,6 +29,9 @@ namespace MeshLib { class Face : public Element { public: + /// Constant: Dimension of this mesh element + static const unsigned dimension = 2u; + /// Get the area of this 2d element. virtual double getArea() const { return _content; } diff --git a/MeshLib/Elements/FaceRule.h b/MeshLib/Elements/FaceRule.h index 5dc7da7971cfdc4ff72b8bf7617bc29103db508a..273d52c0d57ca54d2a71d0e8e8314ee433bd253d 100644 --- a/MeshLib/Elements/FaceRule.h +++ b/MeshLib/Elements/FaceRule.h @@ -20,9 +20,6 @@ namespace MeshLib { class FaceRule { public: - /// Constant: Dimension of this mesh element - static const unsigned dimension = 2; - /// Returns the face i of the element. static const Element* getFace(const Element* e, unsigned i) { return e->getEdge(i); } diff --git a/MeshLib/Elements/HexRule8.h b/MeshLib/Elements/HexRule8.h index afa16dc8a7a873fdf8c49a094f3f090372f49b23..5bd2646f438529b931697aad2d764c261e62b068 100644 --- a/MeshLib/Elements/HexRule8.h +++ b/MeshLib/Elements/HexRule8.h @@ -12,7 +12,6 @@ #include "MeshLib/MeshEnums.h" #include "Element.h" -#include "CellRule.h" #include "EdgeReturn.h" namespace MeshLib @@ -43,7 +42,7 @@ namespace MeshLib * * @endcode */ -class HexRule8 : public CellRule +class HexRule8 { public: /// Constant: The number of base nodes for this element diff --git a/MeshLib/Elements/PrismRule6.h b/MeshLib/Elements/PrismRule6.h index 7ba50dc0bf1bfef4cd0f9cc4c6f9fe00943a1fb3..d75543fba5db73d347d8f70addbca2cdd67b8661 100644 --- a/MeshLib/Elements/PrismRule6.h +++ b/MeshLib/Elements/PrismRule6.h @@ -12,7 +12,6 @@ #include "MeshLib/MeshEnums.h" #include "Element.h" -#include "CellRule.h" #include "EdgeReturn.h" namespace MeshLib @@ -41,7 +40,7 @@ namespace MeshLib * * @endcode */ -class PrismRule6 : public CellRule +class PrismRule6 { public: /// Constant: The number of base nodes for this element diff --git a/MeshLib/Elements/PyramidRule5.h b/MeshLib/Elements/PyramidRule5.h index 3ad691fa79fd86304854ab8239e5f563e6709f2c..c6c8975d50f1c584ea6a3c93a298b5d2726841aa 100644 --- a/MeshLib/Elements/PyramidRule5.h +++ b/MeshLib/Elements/PyramidRule5.h @@ -12,7 +12,6 @@ #include "MeshLib/MeshEnums.h" #include "Element.h" -#include "CellRule.h" #include "EdgeReturn.h" namespace MeshLib @@ -40,7 +39,7 @@ namespace MeshLib * @endcode */ -class PyramidRule5 : public CellRule +class PyramidRule5 { public: /// Constant: The number of base nodes for this element diff --git a/MeshLib/Elements/TemplateElement-impl.h b/MeshLib/Elements/TemplateElement-impl.h index 58007932e54a1c7bb8ab14c93ae67ddb5163a83a..a84bf2865b0463c2901995dcdd9be48030f718d8 100644 --- a/MeshLib/Elements/TemplateElement-impl.h +++ b/MeshLib/Elements/TemplateElement-impl.h @@ -18,9 +18,6 @@ const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_all_nodes; template <class T_BASE, class ELEMENT_RULE> const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::n_base_nodes; -template <class T_BASE, class ELEMENT_RULE> -const unsigned TemplateElement<T_BASE, ELEMENT_RULE>::dimension; - template <class T_BASE, class ELEMENT_RULE> TemplateElement<T_BASE, ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes], unsigned value, std::size_t id) : T_BASE(value, id) diff --git a/MeshLib/Elements/TemplateElement.h b/MeshLib/Elements/TemplateElement.h index 9826bdbd8f9e0c4e1e5f023e1a6aaf2ce90a7a2d..1db5102762dbae5e681e71b0fa7faec5ff4ce401 100644 --- a/MeshLib/Elements/TemplateElement.h +++ b/MeshLib/Elements/TemplateElement.h @@ -39,7 +39,7 @@ public: static const unsigned n_base_nodes = ELEMENT_RULE::n_base_nodes; /// Constant: The dimension of this element - static const unsigned dimension = ELEMENT_RULE::dimension; + using T_BASE::dimension; /** * Constructor with an array of mesh nodes. diff --git a/MeshLib/Elements/TetRule4.h b/MeshLib/Elements/TetRule4.h index eeb3b56c5c4a57deb19b8b65f00de65d6b8bf010..324eeb4c60126c05249af005a496ce41d0d24b50 100644 --- a/MeshLib/Elements/TetRule4.h +++ b/MeshLib/Elements/TetRule4.h @@ -12,7 +12,6 @@ #include "MeshLib/MeshEnums.h" #include "Element.h" -#include "CellRule.h" #include "EdgeReturn.h" namespace MeshLib @@ -38,7 +37,7 @@ namespace MeshLib * * @endcode */ -class TetRule4 : public CellRule +class TetRule4 { public: /// Constant: The number of base nodes for this element