diff --git a/MeshLib/Elements/Cell.cpp b/MeshLib/Elements/Cell.cpp index 9f3cb64361837e03a968cb5c104fe78dbee30d10..f65b8a5e7e8b78b8d04878b1317f90bfc60b4b39 100644 --- a/MeshLib/Elements/Cell.cpp +++ b/MeshLib/Elements/Cell.cpp @@ -17,6 +17,9 @@ #include "Vector3.h" namespace MeshLib { + +const unsigned Cell::dimension = 3u; + /* Cell::Cell(Node** nodes, MeshElemType type, unsigned value) : Element(nodes, type, value) diff --git a/MeshLib/Elements/Cell.h b/MeshLib/Elements/Cell.h index 6db9df79cc22d7ca061056b97371593f66b2a25f..6cbb26881606edbd3ad5babdad76e33c2ede74d3 100644 --- a/MeshLib/Elements/Cell.h +++ b/MeshLib/Elements/Cell.h @@ -26,6 +26,9 @@ namespace MeshLib { class Cell : public Element { public: + /// Constant: Dimension of this mesh element + static const unsigned dimension; + /// Returns the length, area or volume of a 1D, 2D or 3D element double getContent() const { return _volume; }; diff --git a/MeshLib/Elements/TemplateHex-impl.h b/MeshLib/Elements/TemplateHex-impl.h index 3a495484b18fdb4d99690fdadf765731aecbd34e..0a448896bf2d715fa8eff7d2ec6d13cd39ef4057 100644 --- a/MeshLib/Elements/TemplateHex-impl.h +++ b/MeshLib/Elements/TemplateHex-impl.h @@ -22,6 +22,12 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLHEXTYPE> +const unsigned TemplateHex<NNODES, CELLHEXTYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLHEXTYPE> +const unsigned TemplateHex<NNODES, CELLHEXTYPE>::n_base_nodes = 8; + template <unsigned NNODES, CellType CELLHEXTYPE> const unsigned TemplateHex<NNODES,CELLHEXTYPE>::_face_nodes[6][4] = { diff --git a/MeshLib/Elements/TemplateHex.h b/MeshLib/Elements/TemplateHex.h index ba3567a3b777a5ff89b9799d9e73998f49d6fe6b..f44073f943c3bc075e10beee9f8e1152b1138970 100644 --- a/MeshLib/Elements/TemplateHex.h +++ b/MeshLib/Elements/TemplateHex.h @@ -50,6 +50,12 @@ template <unsigned NNODES, CellType CELLHEXTYPE> class TemplateHex : public Cell { public: + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplateHex(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Elements/TemplateLine-impl.h b/MeshLib/Elements/TemplateLine-impl.h index dc9d537568afa6912cb40332070e32fe46d6aac0..692770bf41f899ca014277171dfc6168fd916278 100644 --- a/MeshLib/Elements/TemplateLine-impl.h +++ b/MeshLib/Elements/TemplateLine-impl.h @@ -58,5 +58,14 @@ ElementErrorCode TemplateLine<NNODES,CELLLINETYPE>::validate() const return error_code; } +template <unsigned NNODES, CellType CELLLINETYPE> +const unsigned TemplateLine<NNODES, CELLLINETYPE>::dimension = 1u; + +template <unsigned NNODES, CellType CELLLINETYPE> +const unsigned TemplateLine<NNODES, CELLLINETYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLLINETYPE> +const unsigned TemplateLine<NNODES, CELLLINETYPE>::n_base_nodes = 2u; + } // namespace MeshLib diff --git a/MeshLib/Elements/TemplateLine.h b/MeshLib/Elements/TemplateLine.h index 8341a59c00e0b7a3735595b7d9c3a29379e1d16b..48eb3747a25367fcddecf77c95887f0bccbc5632 100644 --- a/MeshLib/Elements/TemplateLine.h +++ b/MeshLib/Elements/TemplateLine.h @@ -38,6 +38,15 @@ template<unsigned NNODES, CellType CELLLINETYPE> class TemplateLine : public Element { public: + /// Constant: Dimension of this mesh element + static const unsigned dimension; + + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplateLine(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Elements/TemplatePrism-impl.h b/MeshLib/Elements/TemplatePrism-impl.h index 2fc811a73d95e6c0c4046436cda9c89d4c4b3f20..6910f7b88bec4022f33a341ac0d4f405f0c24eab 100644 --- a/MeshLib/Elements/TemplatePrism-impl.h +++ b/MeshLib/Elements/TemplatePrism-impl.h @@ -24,6 +24,12 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLPRISMTYPE> +const unsigned TemplatePrism<NNODES, CELLPRISMTYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLPRISMTYPE> +const unsigned TemplatePrism<NNODES, CELLPRISMTYPE>::n_base_nodes = 6; + template <unsigned NNODES, CellType CELLPRISMTYPE> const unsigned TemplatePrism<NNODES,CELLPRISMTYPE>::_face_nodes[5][4] = { diff --git a/MeshLib/Elements/TemplatePrism.h b/MeshLib/Elements/TemplatePrism.h index 98afdec004f1a087eeebe05eb8f42aa34426dd7c..3bdace172e20436690fb0ee1b1e252cc08ebec2d 100644 --- a/MeshLib/Elements/TemplatePrism.h +++ b/MeshLib/Elements/TemplatePrism.h @@ -48,6 +48,12 @@ template <unsigned NNODES, CellType CELLPRISMTYPE> class TemplatePrism : public Cell { public: + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplatePrism(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Elements/TemplatePyramid-impl.h b/MeshLib/Elements/TemplatePyramid-impl.h index 31afb22c02902146e6e549b567c1cdfd481aff43..c37d6d40c1cbed4b95ea7b7c3e33a16bace59f1a 100644 --- a/MeshLib/Elements/TemplatePyramid-impl.h +++ b/MeshLib/Elements/TemplatePyramid-impl.h @@ -24,6 +24,12 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLPYRAMIDTYPE> +const unsigned TemplatePyramid<NNODES, CELLPYRAMIDTYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLPYRAMIDTYPE> +const unsigned TemplatePyramid<NNODES, CELLPYRAMIDTYPE>::n_base_nodes = 5; + template <unsigned NNODES, CellType CELLPYRAMIDTYPE> const unsigned TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::_face_nodes[5][4] = { diff --git a/MeshLib/Elements/TemplatePyramid.h b/MeshLib/Elements/TemplatePyramid.h index 2630e3c65af5721b34eb271c94208eeb14d614fe..687913dbfe33cad9d41f85691d15cb242fab6fb5 100644 --- a/MeshLib/Elements/TemplatePyramid.h +++ b/MeshLib/Elements/TemplatePyramid.h @@ -46,6 +46,12 @@ template <unsigned NNODES, CellType CELLPYRAMIDTYPE> class TemplatePyramid : public Cell { public: + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplatePyramid(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Elements/TemplateQuad-impl.h b/MeshLib/Elements/TemplateQuad-impl.h index 75f4f97f0a288a6dc63369af62ad038c0593fe4d..3cee0ef11532a0a3199e60f83973c01e4dcd5479 100644 --- a/MeshLib/Elements/TemplateQuad-impl.h +++ b/MeshLib/Elements/TemplateQuad-impl.h @@ -24,6 +24,21 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLQUADTYPE> +const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLQUADTYPE> +const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::n_base_nodes = 4; + +template <unsigned NNODES, CellType CELLQUADTYPE> +const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::_edge_nodes[4][2] = +{ + {0, 1}, // Edge 0 + {1, 2}, // Edge 1 + {2, 3}, // Edge 2 + {0, 3} // Edge 3 +}; + template <unsigned NNODES, CellType CELLQUADTYPE> TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned value, std::size_t id) : Face(value, id) diff --git a/MeshLib/Elements/TemplateQuad.h b/MeshLib/Elements/TemplateQuad.h index 909ecdce73598be27d47ffb42bfadf26b64a666d..81b61de3208b1fa03b7f053c674117c3f0216a2c 100644 --- a/MeshLib/Elements/TemplateQuad.h +++ b/MeshLib/Elements/TemplateQuad.h @@ -123,21 +123,6 @@ protected: static const unsigned _edge_nodes[4][2]; }; /* class */ -template <unsigned NNODES, CellType CELLQUADTYPE> -const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::_edge_nodes[4][2] = -{ - {0, 1}, // Edge 0 - {1, 2}, // Edge 1 - {2, 3}, // Edge 2 - {0, 3} // Edge 3 -}; - -template <unsigned NNODES, CellType CELLQUADTYPE> -const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::n_all_nodes = NNODES; - -template <unsigned NNODES, CellType CELLQUADTYPE> -const unsigned TemplateQuad<NNODES, CELLQUADTYPE>::n_base_nodes = 4; - } /* namespace */ #include "TemplateQuad-impl.h" diff --git a/MeshLib/Elements/TemplateTet-impl.h b/MeshLib/Elements/TemplateTet-impl.h index ceb9ffcb37218e81ff5021ff2667f348a1deafcb..01425b06d7b86b5a1f44d8ded28e1fb704be4db0 100644 --- a/MeshLib/Elements/TemplateTet-impl.h +++ b/MeshLib/Elements/TemplateTet-impl.h @@ -21,6 +21,12 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLTETTYPE> +const unsigned TemplateTet<NNODES, CELLTETTYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLTETTYPE> +const unsigned TemplateTet<NNODES, CELLTETTYPE>::n_base_nodes = 4; + template <unsigned NNODES, CellType CELLTETTYPE> const unsigned TemplateTet<NNODES,CELLTETTYPE>::_face_nodes[4][3] = { diff --git a/MeshLib/Elements/TemplateTet.h b/MeshLib/Elements/TemplateTet.h index a1d3c32c5079ea379256f3aba5c5aa3c8df24291..647003d255101aacec43b93d88b28c89b25d9567 100644 --- a/MeshLib/Elements/TemplateTet.h +++ b/MeshLib/Elements/TemplateTet.h @@ -45,6 +45,12 @@ template <unsigned NNODES, CellType CELLTETTYPE> class TemplateTet : public Cell { public: + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplateTet(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); diff --git a/MeshLib/Elements/TemplateTri-impl.h b/MeshLib/Elements/TemplateTri-impl.h index 736e8195a0e508d7abd62f8bce4e7156bd30f54b..1993b5b825bfd24b7268a6401ba90203b28e344f 100644 --- a/MeshLib/Elements/TemplateTri-impl.h +++ b/MeshLib/Elements/TemplateTri-impl.h @@ -17,6 +17,19 @@ namespace MeshLib { +template <unsigned NNODES, CellType CELLTRITYPE> +const unsigned TemplateTri<NNODES, CELLTRITYPE>::n_all_nodes = NNODES; + +template <unsigned NNODES, CellType CELLTRITYPE> +const unsigned TemplateTri<NNODES, CELLTRITYPE>::n_base_nodes = 3; + +template <unsigned NNODES, CellType CELLTRITYPE> +const unsigned TemplateTri<NNODES,CELLTRITYPE>::_edge_nodes[3][2] = { + {0, 1}, // Edge 0 + {1, 2}, // Edge 1 + {0, 2} // Edge 2 + }; + template <unsigned NNODES, CellType CELLTRITYPE> TemplateTri<NNODES,CELLTRITYPE>::TemplateTri(Node* nodes[NNODES], unsigned value, std::size_t id) : Face(value, id) diff --git a/MeshLib/Elements/TemplateTri.h b/MeshLib/Elements/TemplateTri.h index e0eee786f5bc1da979c5fb8ae3bc1a1261182710..39eeec3c1b968804d57f3847c98f28b735481e3c 100644 --- a/MeshLib/Elements/TemplateTri.h +++ b/MeshLib/Elements/TemplateTri.h @@ -47,6 +47,12 @@ template <unsigned NNODES, CellType CELLTRITYPE> class TemplateTri : public Face { public: + /// Constant: The number of all nodes for this element + static const unsigned n_all_nodes; + + /// Constant: The number of base nodes for this element + static const unsigned n_base_nodes; + /// Constructor with an array of mesh nodes. TemplateTri(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); @@ -131,13 +137,6 @@ protected: static const unsigned _edge_nodes[3][2]; }; /* class */ -template <unsigned NNODES, CellType CELLTRITYPE> -const unsigned TemplateTri<NNODES,CELLTRITYPE>::_edge_nodes[3][2] = { - {0, 1}, // Edge 0 - {1, 2}, // Edge 1 - {0, 2} // Edge 2 - }; - } /* namespace */ #include "TemplateTri-impl.h"