Skip to content
Snippets Groups Projects
Commit 987c1d8c authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[MeL/Elements/TemplateElement] Cleanup getNode().

parent a33bf918
No related branches found
No related tags found
No related merge requests found
......@@ -46,15 +46,15 @@ public:
virtual double getContent() const = 0;
/**
* Get node with local index i where i should be at most the number
* of nodes of the element
* @param i local index of node, at most the number of nodes of the
* Get node with local index where the local index should be at most the
* number of nodes of the element.
* @param idx local index of node, at most the number of nodes of the
* element that you can obtain with Element::getNumberOfBaseNodes()
* @return a pointer to the appropriate (and constant, i.e. not
* modifiable by the user) instance of class Node or a nullptr
* @sa getNodeIndex()
*/
virtual const Node* getNode(unsigned i) const = 0;
virtual const Node* getNode(unsigned idx) const = 0;
/**
* (Re)Sets the node of the element.
......
......@@ -96,19 +96,17 @@ bool TemplateElement<ELEMENT_RULE>::isEdge(unsigned idx1, unsigned idx2) const
}
template <class ELEMENT_RULE>
const Node* TemplateElement<ELEMENT_RULE>::getNode(unsigned i) const
const Node* TemplateElement<ELEMENT_RULE>::getNode(unsigned const idx) const
{
#ifndef NDEBUG
if (i < getNumberOfNodes())
#endif
if (idx >= getNumberOfNodes())
{
return _nodes[i];
ERR("Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
idx, MeshElemType2String(getGeomType()));
return nullptr;
}
#ifndef NDEBUG
ERR("Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}", i,
MeshElemType2String(getGeomType()));
return nullptr;
#endif
return _nodes[idx];
}
template <class ELEMENT_RULE>
......
......@@ -188,7 +188,7 @@ public:
return ELEMENT_RULE::computeVolume(_nodes.data());
}
const Node* getNode(unsigned i) const override;
const Node* getNode(unsigned idx) const override;
void setNode(unsigned idx, Node* node) override;
Node* const* getNodes() const override { return _nodes.data(); }
......
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