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

[MeL] Add MeshSubset::setIntersectionByNodes().

parent ae5dcd53
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,25 @@ public: ...@@ -91,6 +91,25 @@ public:
return _msh.getElements().cend(); return _msh.getElements().cend();
} }
MeshSubset*
setIntersectionByNodes(std::vector<Node*> const& nodes) const
{
std::vector<Node*>* active_nodes = new std::vector<Node*>;
if (_nodes == nullptr || _nodes->empty())
return new MeshSubset(_msh, *active_nodes); // Empty mesh subset
for (auto n : nodes)
{
auto it = std::find(_nodes->cbegin(), _nodes->cend(), n);
if (it == _nodes->cend())
continue;
active_nodes->push_back(n);
}
return new MeshSubset(_msh, *active_nodes);
}
private: private:
const Mesh& _msh; const Mesh& _msh;
std::vector<Node*> const* _nodes; std::vector<Node*> const* _nodes;
......
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