OGS
MeshNodesOnPoint.cpp
Go to the documentation of this file.
1
10#include "MeshNodesOnPoint.h"
11
12#include <range/v3/algorithm/copy_if.hpp>
13
14#include "MeshLib/Mesh.h"
15
16namespace MeshGeoToolsLib
17{
19 GeoLib::Grid<MeshLib::Node> const& mesh_grid,
20 GeoLib::Point const& pnt,
21 double epsilon_radius,
22 SearchAllNodes search_all_nodes)
23 : _mesh(mesh), _pnt(pnt)
24{
25 std::vector<std::size_t> vec_ids(
26 mesh_grid.getPointsInEpsilonEnvironment(pnt, epsilon_radius));
27 if (search_all_nodes == SearchAllNodes::Yes)
28 {
29 _msh_node_ids = vec_ids;
30 }
31 else
32 {
33 auto is_base_node = [this](std::size_t const id)
34 {
37 };
38
39 ranges::copy_if(
40 vec_ids, std::back_inserter(_msh_node_ids), is_base_node);
41 }
42}
43
44} // end namespace MeshGeoToolsLib
Definition of the Mesh class.
std::vector< std::size_t > getPointsInEpsilonEnvironment(P const &pnt, double eps) const
Definition Grid.h:676
MeshNodesOnPoint(MeshLib::Mesh const &mesh, GeoLib::Grid< MeshLib::Node > const &mesh_grid, GeoLib::Point const &pnt, double epsilon_radius, SearchAllNodes search_all_nodes)
std::vector< std::size_t > _msh_node_ids
const Node * getNode(std::size_t idx) const
Get the node with the given index.
Definition Mesh.h:91
std::vector< Element const * > const & getElementsConnectedToNode(std::size_t node_id) const
Definition Mesh.cpp:256
bool isBaseNode(Node const &node, std::vector< Element const * > const &elements_connected_to_node)
Definition Mesh.cpp:346