Skip to content
Snippets Groups Projects
Commit 5888258d authored by Karsten Rink's avatar Karsten Rink
Browse files

adapted id parameter type for element classes

parent 8f3766c9
No related branches found
No related tags found
No related merge requests found
Showing
with 34 additions and 34 deletions
...@@ -21,7 +21,7 @@ Cell::Cell(Node** nodes, MeshElemType type, unsigned value) ...@@ -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 : Element(value, id), _volume(-1.0) // init with invalid value to detect errors
{ {
} }
......
...@@ -54,7 +54,7 @@ protected: ...@@ -54,7 +54,7 @@ protected:
Cell(Node** nodes, MeshElemType type, unsigned value = 0); Cell(Node** nodes, MeshElemType type, unsigned value = 0);
*/ */
/// Constructor for a generic mesh element without an array of mesh nodes. /// 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; double _volume;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace MeshLib 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 : Element(value, id), _length(-1.0) // init with invalid value to detect errors
{ {
} }
......
...@@ -85,7 +85,7 @@ protected: ...@@ -85,7 +85,7 @@ protected:
unsigned identifyFace(Node* [3]/*nodes[3]*/) const { return std::numeric_limits<unsigned>::max(); }; 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. /// 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; double _length;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
namespace MeshLib { namespace MeshLib {
Element::Element(unsigned value, unsigned id) Element::Element(unsigned value, std::size_t id)
: _nodes(nullptr), _id(id), _value(value), _neighbors(nullptr) : _nodes(nullptr), _id(id), _value(value), _neighbors(nullptr)
{ {
} }
......
...@@ -179,7 +179,7 @@ public: ...@@ -179,7 +179,7 @@ public:
protected: protected:
/// Constructor for a generic mesh element without an array of mesh nodes. /// 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. /// Return a specific edge node.
virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0; virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0;
...@@ -188,11 +188,11 @@ protected: ...@@ -188,11 +188,11 @@ protected:
virtual unsigned identifyFace(Node* nodes[3]) const = 0; virtual unsigned identifyFace(Node* nodes[3]) const = 0;
/// Sets the element ID. /// Sets the element ID.
virtual void setID(unsigned id) { this->_id = id; } virtual void setID(std::size_t id) { this->_id = id; }
Node** _nodes; Node** _nodes;
unsigned _id; std::size_t _id;
/** /**
* this is an index for external additional information like materials * this is an index for external additional information like materials
*/ */
......
...@@ -29,7 +29,7 @@ Face::Face(Node** nodes, MeshElemType type, unsigned value) ...@@ -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 : Element(value, id), _area(-1.0) // init with invalid value to detect errors
{ {
} }
......
...@@ -78,7 +78,7 @@ protected: ...@@ -78,7 +78,7 @@ protected:
Face(Node** nodes, MeshElemType type, unsigned value = 0); Face(Node** nodes, MeshElemType type, unsigned value = 0);
*/ */
/// Constructor for a generic mesh element without an array of mesh nodes. /// 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; double _area;
......
...@@ -51,7 +51,7 @@ const unsigned TemplateHex<NNODES,CELLHEXTYPE>::_edge_nodes[12][2] = ...@@ -51,7 +51,7 @@ const unsigned TemplateHex<NNODES,CELLHEXTYPE>::_edge_nodes[12][2] =
}; };
template <unsigned NNODES, CellType CELLHEXTYPE> 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) : Cell(value, id)
{ {
_nodes = nodes; _nodes = nodes;
...@@ -64,7 +64,7 @@ TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(Node* nodes[NNODES], unsigned value ...@@ -64,7 +64,7 @@ TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(Node* nodes[NNODES], unsigned value
template<unsigned NNODES, CellType CELLHEXTYPE> template<unsigned NNODES, CellType CELLHEXTYPE>
TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(std::array<Node*, NNODES> const& nodes, TemplateHex<NNODES,CELLHEXTYPE>::TemplateHex(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Cell(value, id) : Cell(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
......
...@@ -51,10 +51,10 @@ class TemplateHex : public Cell ...@@ -51,10 +51,10 @@ class TemplateHex : public Cell
{ {
public: public:
/// Constructor with an array of mesh nodes. /// 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. /// 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 /// Copy constructor
TemplateHex(const TemplateHex &hex); TemplateHex(const TemplateHex &hex);
......
...@@ -16,7 +16,7 @@ namespace MeshLib ...@@ -16,7 +16,7 @@ namespace MeshLib
{ {
template<unsigned NNODES, CellType CELLLINETYPE> template<unsigned NNODES, CellType CELLLINETYPE>
TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const& nodes, TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Edge(value, id) : Edge(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
...@@ -26,7 +26,7 @@ TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const& ...@@ -26,7 +26,7 @@ TemplateLine<NNODES,CELLLINETYPE>::TemplateLine(std::array<Node*, NNODES> const&
} }
template<unsigned NNODES, CellType CELLLINETYPE> 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) Edge(value, id)
{ {
_nodes = nodes; _nodes = nodes;
......
...@@ -40,10 +40,10 @@ class TemplateLine : public Edge ...@@ -40,10 +40,10 @@ class TemplateLine : public Edge
{ {
public: public:
/// Constructor with an array of mesh nodes. /// 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. /// 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 /// Copy constructor
TemplateLine(const TemplateLine &line); TemplateLine(const TemplateLine &line);
......
...@@ -52,7 +52,7 @@ template <unsigned NNODES, CellType CELLPRISMTYPE> ...@@ -52,7 +52,7 @@ template <unsigned NNODES, CellType CELLPRISMTYPE>
const unsigned TemplatePrism<NNODES,CELLPRISMTYPE>::_n_face_nodes[5] = { 3, 4, 4, 4, 3 }; const unsigned TemplatePrism<NNODES,CELLPRISMTYPE>::_n_face_nodes[5] = { 3, 4, 4, 4, 3 };
template <unsigned NNODES, CellType CELLPRISMTYPE> 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) : Cell(value, id)
{ {
_nodes = nodes; _nodes = nodes;
...@@ -63,7 +63,7 @@ TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(Node* nodes[NNODES], unsigned ...@@ -63,7 +63,7 @@ TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(Node* nodes[NNODES], unsigned
template<unsigned NNODES, CellType CELLPRISMTYPE> template<unsigned NNODES, CellType CELLPRISMTYPE>
TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(std::array<Node*, NNODES> const& nodes, TemplatePrism<NNODES,CELLPRISMTYPE>::TemplatePrism(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Cell(value, id) : Cell(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
......
...@@ -49,10 +49,10 @@ class TemplatePrism : public Cell ...@@ -49,10 +49,10 @@ class TemplatePrism : public Cell
{ {
public: public:
/// Constructor with an array of mesh nodes. /// 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. /// 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 /// Copy constructor
TemplatePrism(const TemplatePrism &prism); TemplatePrism(const TemplatePrism &prism);
......
...@@ -51,7 +51,7 @@ template <unsigned NNODES, CellType CELLPYRAMIDTYPE> ...@@ -51,7 +51,7 @@ template <unsigned NNODES, CellType CELLPYRAMIDTYPE>
const unsigned TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::_n_face_nodes[5] = { 3, 3, 3, 3, 4 }; const unsigned TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::_n_face_nodes[5] = { 3, 3, 3, 3, 4 };
template <unsigned NNODES, CellType CELLPYRAMIDTYPE> 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) : Cell(value, id)
{ {
_nodes = nodes; _nodes = nodes;
...@@ -64,7 +64,7 @@ TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(Node* nodes[NNODES], un ...@@ -64,7 +64,7 @@ TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(Node* nodes[NNODES], un
template<unsigned NNODES, CellType CELLPYRAMIDTYPE> template<unsigned NNODES, CellType CELLPYRAMIDTYPE>
TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(std::array<Node*, NNODES> const& nodes, TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::TemplatePyramid(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Cell(value, id) : Cell(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
......
...@@ -47,10 +47,10 @@ class TemplatePyramid : public Cell ...@@ -47,10 +47,10 @@ class TemplatePyramid : public Cell
{ {
public: public:
/// Constructor with an array of mesh nodes. /// 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. /// 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 /// Copy constructor
TemplatePyramid(const TemplatePyramid &pyramid); TemplatePyramid(const TemplatePyramid &pyramid);
......
...@@ -25,7 +25,7 @@ namespace MeshLib ...@@ -25,7 +25,7 @@ namespace MeshLib
{ {
template <unsigned NNODES, CellType CELLQUADTYPE> 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) : Face(value, id)
{ {
_nodes = nodes; _nodes = nodes;
...@@ -38,7 +38,7 @@ TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned va ...@@ -38,7 +38,7 @@ TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(Node* nodes[NNODES], unsigned va
template<unsigned NNODES, CellType CELLQUADTYPE> template<unsigned NNODES, CellType CELLQUADTYPE>
TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(std::array<Node*, NNODES> const& nodes, TemplateQuad<NNODES,CELLQUADTYPE>::TemplateQuad(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Face(value, id) : Face(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
......
...@@ -47,10 +47,10 @@ public: ...@@ -47,10 +47,10 @@ public:
static const unsigned n_base_nodes; static const unsigned n_base_nodes;
/// Constructor with an array of mesh 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. /// 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 /// Constructs a quad from NNODES of Nodes initializing Face with
// value = 0. // value = 0.
......
...@@ -42,7 +42,7 @@ const unsigned TemplateTet<NNODES,CELLTETTYPE>::_edge_nodes[6][2] = ...@@ -42,7 +42,7 @@ const unsigned TemplateTet<NNODES,CELLTETTYPE>::_edge_nodes[6][2] =
}; };
template <unsigned NNODES, CellType CELLTETTYPE> 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) : Cell(value, id)
{ {
_nodes = nodes; _nodes = nodes;
...@@ -55,7 +55,7 @@ TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(Node* nodes[NNODES], unsigned value ...@@ -55,7 +55,7 @@ TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(Node* nodes[NNODES], unsigned value
template<unsigned NNODES, CellType CELLTETTYPE> template<unsigned NNODES, CellType CELLTETTYPE>
TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(std::array<Node*, NNODES> const& nodes, TemplateTet<NNODES,CELLTETTYPE>::TemplateTet(std::array<Node*, NNODES> const& nodes,
unsigned value, unsigned id) unsigned value, std::size_t id)
: Cell(value, id) : Cell(value, id)
{ {
_nodes = new Node*[NNODES]; _nodes = new Node*[NNODES];
......
...@@ -46,10 +46,10 @@ class TemplateTet : public Cell ...@@ -46,10 +46,10 @@ class TemplateTet : public Cell
{ {
public: public:
/// Constructor with an array of mesh nodes. /// 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. /// 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 /// Copy constructor
TemplateTet(const TemplateTet &tet); TemplateTet(const TemplateTet &tet);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment