OGS
NodeSearch.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <vector>
7
8namespace MeshLib
9{
10
11// forward declarations
12class Mesh;
13class Element;
14class Node;
15
17class NodeSearch final
18{
19public:
20 explicit NodeSearch(const MeshLib::Mesh &mesh);
21
23 const std::vector<std::size_t>& getSearchedNodeIDs() const {return _marked_nodes; }
24
28 const std::vector<std::size_t>& elements);
29
31 std::size_t searchUnused();
32
34 std::size_t searchBoundaryNodes();
35
36private:
38 void updateUnion(const std::vector<std::size_t> &vec);
39
43 std::vector<std::size_t> _marked_nodes;
44};
45
47std::vector<Node*> getUniqueNodes(std::vector<Element*> const& elements);
48
49} // end namespace MeshLib
std::size_t searchNodesConnectedToOnlyGivenElements(const std::vector< std::size_t > &elements)
std::vector< std::size_t > _marked_nodes
The vector of element indices that should be removed.
Definition NodeSearch.h:43
const std::vector< std::size_t > & getSearchedNodeIDs() const
return marked node IDs
Definition NodeSearch.h:23
std::size_t searchBoundaryNodes()
Marks all boundary nodes.
const MeshLib::Mesh & _mesh
The mesh from which elements should be removed.
Definition NodeSearch.h:41
NodeSearch(const MeshLib::Mesh &mesh)
void updateUnion(const std::vector< std::size_t > &vec)
Updates the vector of marked items with values from vec.
std::size_t searchUnused()
Marks all unused nodes.
std::vector< Node * > getUniqueNodes(std::vector< Element * > const &elements)
Create a vector of unique nodes used by given elements.