OGS
NodeSearch.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include <vector>
14 
15 namespace MeshLib
16 {
17 
18 // forward declarations
19 class Mesh;
20 class Element;
21 class Node;
22 
24 class NodeSearch final
25 {
26 public:
27  explicit NodeSearch(const MeshLib::Mesh &mesh);
28 
30  const std::vector<std::size_t>& getSearchedNodeIDs() const {return _marked_nodes; }
31 
35  const std::vector<std::size_t>& elements);
36 
38  std::size_t searchUnused();
39 
41  std::size_t searchBoundaryNodes();
42 
43 private:
45  void updateUnion(const std::vector<std::size_t> &vec);
46 
50  std::vector<std::size_t> _marked_nodes;
51 };
52 
54 std::vector<Node*> getUniqueNodes(std::vector<Element*> const& elements);
55 
56 } // end namespace MeshLib
Node search class.
Definition: NodeSearch.h:25
std::size_t searchNodesConnectedToOnlyGivenElements(const std::vector< std::size_t > &elements)
Definition: NodeSearch.cpp:24
std::vector< std::size_t > _marked_nodes
The vector of element indices that should be removed.
Definition: NodeSearch.h:50
std::size_t searchBoundaryNodes()
Marks all boundary nodes.
Definition: NodeSearch.cpp:76
const MeshLib::Mesh & _mesh
The mesh from which elements should be removed.
Definition: NodeSearch.h:48
NodeSearch(const MeshLib::Mesh &mesh)
Definition: NodeSearch.cpp:22
void updateUnion(const std::vector< std::size_t > &vec)
Updates the vector of marked items with values from vec.
Definition: NodeSearch.cpp:154
const std::vector< std::size_t > & getSearchedNodeIDs() const
return marked node IDs
Definition: NodeSearch.h:30
std::size_t searchUnused()
Marks all unused nodes.
Definition: NodeSearch.cpp:58
std::vector< Node * > getUniqueNodes(std::vector< Element * > const &elements)
Create a vector of unique nodes used by given elements.
Definition: NodeSearch.cpp:163