Skip to content
Snippets Groups Projects
Commit b9712c9b authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Add isBaseNode predicate.

parent 77a47ef9
No related branches found
No related tags found
No related merge requests found
......@@ -49,5 +49,18 @@ void Node::updateCoordinates(double x, double y, double z)
_elements[i]->computeVolume();
}
bool isBaseNode(Node const& node)
{
// Check if node is connected.
if (node.getNumberOfElements() == 0)
return true;
// In a mesh a node always belongs to at least one element.
auto const e = node.getElement(0);
auto const n_base_nodes = e->getNumberOfBaseNodes();
auto const local_index = e->getNodeIDinElement(&node);
return local_index < n_base_nodes;
}
}
......@@ -102,4 +102,8 @@ protected:
std::vector<Element*> _elements;
}; /* class */
/// Returns true if the given node is a base node of a (first) element, or if it
/// is not connected to any element i.e. an unconnected node.
bool isBaseNode(Node const& node);
} /* namespace */
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