OGS
MeshGeoToolsLib::MeshNodesOnPoint Class Reference

Detailed Description

This class computes the ids of the mesh nodes located at a given point.

Definition at line 25 of file MeshNodesOnPoint.h.

#include <MeshNodesOnPoint.h>

Collaboration diagram for MeshGeoToolsLib::MeshNodesOnPoint:
[legend]

Public Member Functions

 MeshNodesOnPoint (MeshLib::Mesh const &mesh, GeoLib::Grid< MeshLib::Node > const &mesh_grid, GeoLib::Point const &pnt, double epsilon_radius, SearchAllNodes search_all_nodes)
MeshLib::Mesh const & getMesh () const
 return the mesh object
std::vector< std::size_t > const & getNodeIDs () const
GeoLib::Point const & getPoint () const

Private Attributes

MeshLib::Mesh const & _mesh
GeoLib::Point const & _pnt
std::vector< std::size_t > _msh_node_ids

Constructor & Destructor Documentation

◆ MeshNodesOnPoint()

MeshGeoToolsLib::MeshNodesOnPoint::MeshNodesOnPoint ( MeshLib::Mesh const & mesh,
GeoLib::Grid< MeshLib::Node > const & mesh_grid,
GeoLib::Point const & pnt,
double epsilon_radius,
SearchAllNodes search_all_nodes )

Constructor of object, that search mesh nodes at a GeoLib::Point point within a given search radius.

Parameters
meshMesh object whose nodes are searched
mesh_gridGrid object constructed with mesh nodes
pnta point
epsilon_radiusSearch radius
search_all_nodeswhether this searches all nodes or only base nodes

Definition at line 12 of file MeshNodesOnPoint.cpp.

17 : _mesh(mesh), _pnt(pnt)
18{
19 std::vector<std::size_t> vec_ids(
20 mesh_grid.getPointsInEpsilonEnvironment(pnt, epsilon_radius));
21 if (search_all_nodes == SearchAllNodes::Yes)
22 {
23 _msh_node_ids = vec_ids;
24 }
25 else
26 {
27 auto is_base_node = [this](std::size_t const id)
28 {
29 return MeshLib::isBaseNode(*_mesh.getNode(id),
30 _mesh.getElementsConnectedToNode(id));
31 };
32
33 ranges::copy_if(
34 vec_ids, std::back_inserter(_msh_node_ids), is_base_node);
35 }
36}
std::vector< std::size_t > getPointsInEpsilonEnvironment(P const &pnt, double eps) const
Definition Grid.h:665
std::vector< std::size_t > _msh_node_ids
bool isBaseNode(Node const &node, std::vector< Element const * > const &elements_connected_to_node)
Definition Mesh.cpp:336

References _mesh, _msh_node_ids, _pnt, GeoLib::Grid< POINT >::getPointsInEpsilonEnvironment(), MeshLib::isBaseNode(), and MeshGeoToolsLib::Yes.

Member Function Documentation

◆ getMesh()

MeshLib::Mesh const & MeshGeoToolsLib::MeshNodesOnPoint::getMesh ( ) const
inline

return the mesh object

Definition at line 44 of file MeshNodesOnPoint.h.

44{ return _mesh; }

References _mesh.

◆ getNodeIDs()

std::vector< std::size_t > const & MeshGeoToolsLib::MeshNodesOnPoint::getNodeIDs ( ) const
inline

Access the vector of mesh node ids.

Returns
The vector of mesh node ids calculated in the constructor

Definition at line 50 of file MeshNodesOnPoint.h.

50{ return _msh_node_ids; }

References _msh_node_ids.

◆ getPoint()

GeoLib::Point const & MeshGeoToolsLib::MeshNodesOnPoint::getPoint ( ) const
inline

Deploying this method the user can get access to the underlying GeoLib::Point.

Returns
the underlying GeoLib::Point

Definition at line 57 of file MeshNodesOnPoint.h.

57{ return _pnt; }

References _pnt.

Referenced by MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeIDs().

Member Data Documentation

◆ _mesh

MeshLib::Mesh const& MeshGeoToolsLib::MeshNodesOnPoint::_mesh
private

Definition at line 60 of file MeshNodesOnPoint.h.

Referenced by MeshNodesOnPoint(), and getMesh().

◆ _msh_node_ids

std::vector<std::size_t> MeshGeoToolsLib::MeshNodesOnPoint::_msh_node_ids
private

Definition at line 62 of file MeshNodesOnPoint.h.

Referenced by MeshNodesOnPoint(), and getNodeIDs().

◆ _pnt

GeoLib::Point const& MeshGeoToolsLib::MeshNodesOnPoint::_pnt
private

Definition at line 61 of file MeshNodesOnPoint.h.

Referenced by MeshNodesOnPoint(), and getPoint().


The documentation for this class was generated from the following files: