From 5888258d3fcf5e6f1538979a2acd55a6f81c2d8d Mon Sep 17 00:00:00 2001 From: Karsten Rink <karsten.rink@ufz.de> Date: Tue, 18 Mar 2014 08:23:39 +0100 Subject: [PATCH] adapted id parameter type for element classes --- MeshLib/Elements/Cell.cpp | 2 +- MeshLib/Elements/Cell.h | 2 +- MeshLib/Elements/Edge.cpp | 2 +- MeshLib/Elements/Edge.h | 2 +- MeshLib/Elements/Element.cpp | 2 +- MeshLib/Elements/Element.h | 6 +++--- MeshLib/Elements/Face.cpp | 2 +- MeshLib/Elements/Face.h | 2 +- MeshLib/Elements/TemplateHex-impl.h | 4 ++-- MeshLib/Elements/TemplateHex.h | 4 ++-- MeshLib/Elements/TemplateLine-impl.h | 4 ++-- MeshLib/Elements/TemplateLine.h | 4 ++-- MeshLib/Elements/TemplatePrism-impl.h | 4 ++-- MeshLib/Elements/TemplatePrism.h | 4 ++-- MeshLib/Elements/TemplatePyramid-impl.h | 4 ++-- MeshLib/Elements/TemplatePyramid.h | 4 ++-- MeshLib/Elements/TemplateQuad-impl.h | 4 ++-- MeshLib/Elements/TemplateQuad.h | 4 ++-- MeshLib/Elements/TemplateTet-impl.h | 4 ++-- MeshLib/Elements/TemplateTet.h | 4 ++-- MeshLib/Elements/TemplateTri-impl.h | 4 ++-- MeshLib/Elements/TemplateTri.h | 4 ++-- 22 files changed, 38 insertions(+), 38 deletions(-) diff --git a/MeshLib/Elements/Cell.cpp b/MeshLib/Elements/Cell.cpp index ba008adfc81..075a5210740 100644 --- a/MeshLib/Elements/Cell.cpp +++ b/MeshLib/Elements/Cell.cpp @@ -21,7 +21,7 @@ Cell::Cell(Node** nodes, MeshElemType type, unsigned value) { } */ -Cell::Cell(unsigned value, unsigned id) +Cell::Cell(unsigned value, std::size_t id) : Element(value, id), _volume(-1.0) // init with invalid value to detect errors { } diff --git a/MeshLib/Elements/Cell.h b/MeshLib/Elements/Cell.h index 607800602cc..897558573f8 100644 --- a/MeshLib/Elements/Cell.h +++ b/MeshLib/Elements/Cell.h @@ -54,7 +54,7 @@ protected: Cell(Node** nodes, MeshElemType type, unsigned value = 0); */ /// Constructor for a generic mesh element without an array of mesh nodes. - Cell(unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + Cell(unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); double _volume; diff --git a/MeshLib/Elements/Edge.cpp b/MeshLib/Elements/Edge.cpp index 2defa63eead..f818edcaa8c 100644 --- a/MeshLib/Elements/Edge.cpp +++ b/MeshLib/Elements/Edge.cpp @@ -20,7 +20,7 @@ namespace MeshLib { -Edge::Edge(unsigned value, unsigned id) +Edge::Edge(unsigned value, std::size_t id) : Element(value, id), _length(-1.0) // init with invalid value to detect errors { } diff --git a/MeshLib/Elements/Edge.h b/MeshLib/Elements/Edge.h index 2665d8dc0ca..47e560fb45b 100644 --- a/MeshLib/Elements/Edge.h +++ b/MeshLib/Elements/Edge.h @@ -85,7 +85,7 @@ protected: unsigned identifyFace(Node* [3]/*nodes[3]*/) const { return std::numeric_limits<unsigned>::max(); }; /// Constructor for a generic mesh element without an array of mesh nodes. - Edge(unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + Edge(unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); double _length; diff --git a/MeshLib/Elements/Element.cpp b/MeshLib/Elements/Element.cpp index fb6cc0fe4a8..a70892710f8 100644 --- a/MeshLib/Elements/Element.cpp +++ b/MeshLib/Elements/Element.cpp @@ -22,7 +22,7 @@ namespace MeshLib { -Element::Element(unsigned value, unsigned id) +Element::Element(unsigned value, std::size_t id) : _nodes(nullptr), _id(id), _value(value), _neighbors(nullptr) { } diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h index c9ad7ae71bf..00cb03f8a3b 100644 --- a/MeshLib/Elements/Element.h +++ b/MeshLib/Elements/Element.h @@ -179,7 +179,7 @@ public: protected: /// Constructor for a generic mesh element without an array of mesh nodes. - Element(unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + Element(unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Return a specific edge node. virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0; @@ -188,11 +188,11 @@ protected: virtual unsigned identifyFace(Node* nodes[3]) const = 0; /// Sets the element ID. - virtual void setID(unsigned id) { this->_id = id; } + virtual void setID(std::size_t id) { this->_id = id; } Node** _nodes; - unsigned _id; + std::size_t _id; /** * this is an index for external additional information like materials */ diff --git a/MeshLib/Elements/Face.cpp b/MeshLib/Elements/Face.cpp index 1133e1d31f8..7915fdf68ac 100644 --- a/MeshLib/Elements/Face.cpp +++ b/MeshLib/Elements/Face.cpp @@ -29,7 +29,7 @@ Face::Face(Node** nodes, MeshElemType type, unsigned value) { } */ -Face::Face(unsigned value, unsigned id) +Face::Face(unsigned value, std::size_t id) : Element(value, id), _area(-1.0) // init with invalid value to detect errors { } diff --git a/MeshLib/Elements/Face.h b/MeshLib/Elements/Face.h index cf831942ad7..94729334f4d 100644 --- a/MeshLib/Elements/Face.h +++ b/MeshLib/Elements/Face.h @@ -78,7 +78,7 @@ protected: Face(Node** nodes, MeshElemType type, unsigned value = 0); */ /// Constructor for a generic mesh element without an array of mesh nodes. - Face(unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + Face(unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); double _area; diff --git a/MeshLib/Elements/TemplateHex-impl.h b/MeshLib/Elements/TemplateHex-impl.h index 4b34eecb3af..64bbb3c482d 100644 --- a/MeshLib/Elements/TemplateHex-impl.h +++ b/MeshLib/Elements/TemplateHex-impl.h @@ -51,7 +51,7 @@ const unsigned TemplateHex<NNODES,CELLHEXTYPE>::_edge_nodes[12][2] = }; template <unsigned NNODES, CellType CELLHEXTYPE> -TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(Node* nodes[NNODES], unsigned value, unsigned id) +TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(Node* nodes[NNODES], unsigned value, std::size_t id) : Cell(value, id) { _nodes = nodes; @@ -64,7 +64,7 @@ TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(Node* nodes[NNODES], unsigned value template<unsigned NNODES, CellType CELLHEXTYPE> TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Cell(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplateHex.h b/MeshLib/Elements/TemplateHex.h index af0221150f8..ba3567a3b77 100644 --- a/MeshLib/Elements/TemplateHex.h +++ b/MeshLib/Elements/TemplateHex.h @@ -51,10 +51,10 @@ class TemplateHex : public Cell { public: /// Constructor with an array of mesh nodes. - TemplateHex(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateHex(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a hex from array of Node pointers. - TemplateHex(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateHex(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateHex(const TemplateHex &hex); diff --git a/MeshLib/Elements/TemplateLine-impl.h b/MeshLib/Elements/TemplateLine-impl.h index 68e03bb1658..b3d098930c7 100644 --- a/MeshLib/Elements/TemplateLine-impl.h +++ b/MeshLib/Elements/TemplateLine-impl.h @@ -16,7 +16,7 @@ namespace MeshLib { template<unsigned NNODES, CellType CELLLINETYPE> TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Edge(value, id) { _nodes = new Node*[NNODES]; @@ -26,7 +26,7 @@ TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const& } template<unsigned NNODES, CellType CELLLINETYPE> -TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(Node* nodes[NNODES], unsigned value, unsigned id) : +TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(Node* nodes[NNODES], unsigned value, std::size_t id) : Edge(value, id) { _nodes = nodes; diff --git a/MeshLib/Elements/TemplateLine.h b/MeshLib/Elements/TemplateLine.h index ab609a06ae4..dcdebc513ed 100644 --- a/MeshLib/Elements/TemplateLine.h +++ b/MeshLib/Elements/TemplateLine.h @@ -40,10 +40,10 @@ class TemplateLine : public Edge { public: /// Constructor with an array of mesh nodes. - TemplateLine(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateLine(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a line from array of Node pointers. - TemplateLine(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateLine(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateLine(const TemplateLine &line); diff --git a/MeshLib/Elements/TemplatePrism-impl.h b/MeshLib/Elements/TemplatePrism-impl.h index 76893a48b21..2decf3bcb57 100644 --- a/MeshLib/Elements/TemplatePrism-impl.h +++ b/MeshLib/Elements/TemplatePrism-impl.h @@ -52,7 +52,7 @@ template <unsigned NNODES, CellType CELLPRISMTYPE> const unsigned TemplatePrism<NNODES,CELLPRISMTYPE>::_n_face_nodes[5] = { 3, 4, 4, 4, 3 }; template <unsigned NNODES, CellType CELLPRISMTYPE> -TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(Node* nodes[NNODES], unsigned value, unsigned id) +TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(Node* nodes[NNODES], unsigned value, std::size_t id) : Cell(value, id) { _nodes = nodes; @@ -63,7 +63,7 @@ TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(Node* nodes[NNODES], unsigned template<unsigned NNODES, CellType CELLPRISMTYPE> TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Cell(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplatePrism.h b/MeshLib/Elements/TemplatePrism.h index 827fc274b0f..98afdec004f 100644 --- a/MeshLib/Elements/TemplatePrism.h +++ b/MeshLib/Elements/TemplatePrism.h @@ -49,10 +49,10 @@ class TemplatePrism : public Cell { public: /// Constructor with an array of mesh nodes. - TemplatePrism(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplatePrism(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a prism from array of Node pointers. - TemplatePrism(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplatePrism(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplatePrism(const TemplatePrism &prism); diff --git a/MeshLib/Elements/TemplatePyramid-impl.h b/MeshLib/Elements/TemplatePyramid-impl.h index 7fdbeac6488..4df80819c0e 100644 --- a/MeshLib/Elements/TemplatePyramid-impl.h +++ b/MeshLib/Elements/TemplatePyramid-impl.h @@ -51,7 +51,7 @@ template <unsigned NNODES, CellType CELLPYRAMIDTYPE> const unsigned TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::_n_face_nodes[5] = { 3, 3, 3, 3, 4 }; template <unsigned NNODES, CellType CELLPYRAMIDTYPE> -TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(Node* nodes[NNODES], unsigned value, unsigned id) +TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(Node* nodes[NNODES], unsigned value, std::size_t id) : Cell(value, id) { _nodes = nodes; @@ -64,7 +64,7 @@ TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(Node* nodes[NNODES], un template<unsigned NNODES, CellType CELLPYRAMIDTYPE> TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Cell(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplatePyramid.h b/MeshLib/Elements/TemplatePyramid.h index cbbbb00898f..2630e3c65af 100644 --- a/MeshLib/Elements/TemplatePyramid.h +++ b/MeshLib/Elements/TemplatePyramid.h @@ -47,10 +47,10 @@ class TemplatePyramid : public Cell { public: /// Constructor with an array of mesh nodes. - TemplatePyramid(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplatePyramid(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a pyramid from array of Node pointers. - TemplatePyramid(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplatePyramid(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplatePyramid(const TemplatePyramid &pyramid); diff --git a/MeshLib/Elements/TemplateQuad-impl.h b/MeshLib/Elements/TemplateQuad-impl.h index f1e25249710..ab017977b14 100644 --- a/MeshLib/Elements/TemplateQuad-impl.h +++ b/MeshLib/Elements/TemplateQuad-impl.h @@ -25,7 +25,7 @@ namespace MeshLib { template <unsigned NNODES, CellType CELLQUADTYPE> -TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned value, unsigned id) +TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned value, std::size_t id) : Face(value, id) { _nodes = nodes; @@ -38,7 +38,7 @@ TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned va template<unsigned NNODES, CellType CELLQUADTYPE> TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Face(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplateQuad.h b/MeshLib/Elements/TemplateQuad.h index ba72985bbfc..909ecdce735 100644 --- a/MeshLib/Elements/TemplateQuad.h +++ b/MeshLib/Elements/TemplateQuad.h @@ -47,10 +47,10 @@ public: static const unsigned n_base_nodes; /// Constructor with an array of mesh nodes. - TemplateQuad(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateQuad(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs an edge from array of Node pointers. - TemplateQuad(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateQuad(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a quad from NNODES of Nodes initializing Face with // value = 0. diff --git a/MeshLib/Elements/TemplateTet-impl.h b/MeshLib/Elements/TemplateTet-impl.h index 6d9db31caaa..49370381650 100644 --- a/MeshLib/Elements/TemplateTet-impl.h +++ b/MeshLib/Elements/TemplateTet-impl.h @@ -42,7 +42,7 @@ const unsigned TemplateTet<NNODES,CELLTETTYPE>::_edge_nodes[6][2] = }; template <unsigned NNODES, CellType CELLTETTYPE> -TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(Node* nodes[NNODES], unsigned value, unsigned id) +TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(Node* nodes[NNODES], unsigned value, std::size_t id) : Cell(value, id) { _nodes = nodes; @@ -55,7 +55,7 @@ TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(Node* nodes[NNODES], unsigned value template<unsigned NNODES, CellType CELLTETTYPE> TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Cell(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplateTet.h b/MeshLib/Elements/TemplateTet.h index da5521f5ada..a1d3c32c507 100644 --- a/MeshLib/Elements/TemplateTet.h +++ b/MeshLib/Elements/TemplateTet.h @@ -46,10 +46,10 @@ class TemplateTet : public Cell { public: /// Constructor with an array of mesh nodes. - TemplateTet(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateTet(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a tetrahedron from array of Node pointers. - TemplateTet(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateTet(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateTet(const TemplateTet &tet); diff --git a/MeshLib/Elements/TemplateTri-impl.h b/MeshLib/Elements/TemplateTri-impl.h index 8d1b960fec4..5bae658eba7 100644 --- a/MeshLib/Elements/TemplateTri-impl.h +++ b/MeshLib/Elements/TemplateTri-impl.h @@ -18,7 +18,7 @@ namespace MeshLib { template <unsigned NNODES, CellType CELLTRITYPE> -TemplateTri<NNODES,CELLTRITYPE>::TemplateTri(Node* nodes[NNODES], unsigned value, unsigned id) : +TemplateTri<NNODES,CELLTRITYPE>::TemplateTri(Node* nodes[NNODES], unsigned value, std::size_t id) : Face(value, id) { _nodes = nodes; @@ -29,7 +29,7 @@ TemplateTri<NNODES,CELLTRITYPE>::TemplateTri(Node* nodes[NNODES], unsigned value template<unsigned NNODES, CellType CELLTRITYPE> TemplateTri<NNODES,CELLTRITYPE>::TemplateTri(std::array<Node*, NNODES> const& nodes, - unsigned value, unsigned id) + unsigned value, std::size_t id) : Face(value, id) { _nodes = new Node*[NNODES]; diff --git a/MeshLib/Elements/TemplateTri.h b/MeshLib/Elements/TemplateTri.h index 99a20df4975..e0eee786f5b 100644 --- a/MeshLib/Elements/TemplateTri.h +++ b/MeshLib/Elements/TemplateTri.h @@ -48,10 +48,10 @@ class TemplateTri : public Face { public: /// Constructor with an array of mesh nodes. - TemplateTri(Node* nodes[NNODES], unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateTri(Node* nodes[NNODES], unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Constructs a triangle from array of Node pointers. - TemplateTri(std::array<Node*, NNODES> const& nodes, unsigned value = 0, unsigned id = std::numeric_limits<unsigned>::max()); + TemplateTri(std::array<Node*, NNODES> const& nodes, unsigned value = 0, std::size_t id = std::numeric_limits<std::size_t>::max()); /// Copy constructor TemplateTri(const TemplateTri &tri); -- GitLab