Skip to content
Snippets Groups Projects
Commit 86f05f1b authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeL] std::size_t instead of unsigned as type for id.

Using unique type for id fixes some warnings.
parent 5c1bc98b
No related branches found
No related tags found
No related merge requests found
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
namespace MeshLib { namespace MeshLib {
Node::Node(const double coords[3], unsigned id) Node::Node(const double coords[3], std::size_t id)
: MathLib::MathPoint(coords), _id(id) : MathLib::MathPoint(coords), _id(id)
{ {
} }
Node::Node(double x, double y, double z, unsigned id) Node::Node(double x, double y, double z, std::size_t id)
: MathLib::MathPoint({x, y, z}), _id(id) : MathLib::MathPoint(std::array<double,3>({{x, y, z}})), _id(id)
{ {
} }
...@@ -43,7 +43,7 @@ void Node::updateCoordinates(double x, double y, double z) ...@@ -43,7 +43,7 @@ void Node::updateCoordinates(double x, double y, double z)
_x[2] = z; _x[2] = z;
const size_t nElements (this->_elements.size()); const size_t nElements (this->_elements.size());
for (unsigned i=0; i<nElements; i++) for (std::size_t i=0; i<nElements; i++)
_elements[i]->computeVolume(); _elements[i]->computeVolume();
} }
......
...@@ -47,10 +47,10 @@ class Node : public MathLib::MathPoint ...@@ -47,10 +47,10 @@ class Node : public MathLib::MathPoint
public: public:
/// Constructor using a coordinate array /// Constructor using a coordinate array
Node(const double coords[3], unsigned id = std::numeric_limits<unsigned>::max()); Node(const double coords[3], std::size_t id = std::numeric_limits<std::size_t>::max());
/// Constructor using single coordinates /// Constructor using single coordinates
Node(double x, double y, double z, unsigned id = std::numeric_limits<unsigned>::max()); Node(double x, double y, double z, std::size_t id = std::numeric_limits<std::size_t>::max());
/// Copy constructor /// Copy constructor
Node(const Node &node); Node(const Node &node);
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; } const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; }
/// Get an element the node is part of. /// Get an element the node is part of.
const Element* getElement(unsigned idx) const { return _elements[idx]; } const Element* getElement(std::size_t idx) const { return _elements[idx]; }
/// Get all elements the node is part of. /// Get all elements the node is part of.
const std::vector<Element*>& getElements() const { return _elements; } const std::vector<Element*>& getElements() const { return _elements; }
...@@ -88,7 +88,7 @@ protected: ...@@ -88,7 +88,7 @@ protected:
} }
/// Sets the ID of a node to the given value. /// Sets the ID of a node to the given value.
void setID(unsigned id) { this->_id = id; } void setID(std::size_t id) { this->_id = id; }
/// Update coordinates of a node. /// Update coordinates of a node.
/// This method automatically also updates the areas/volumes of all connected elements. /// This method automatically also updates the areas/volumes of all connected elements.
......
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