OGS
MeshGeoToolsLib::MeshNodesOnPoint Class Reference

Detailed Description

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

Definition at line 31 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 18 of file MeshNodesOnPoint.cpp.

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}
std::vector< std::size_t > getPointsInEpsilonEnvironment(P const &pnt, double eps) const
Definition Grid.h:676
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

References _mesh, _msh_node_ids, MeshLib::Mesh::getElementsConnectedToNode(), MeshLib::Mesh::getNode(), 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 50 of file MeshNodesOnPoint.h.

50{ 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 56 of file MeshNodesOnPoint.h.

56{ 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 63 of file MeshNodesOnPoint.h.

63{ return _pnt; }

References _pnt.

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

Member Data Documentation

◆ _mesh

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

Definition at line 66 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 68 of file MeshNodesOnPoint.h.

Referenced by MeshNodesOnPoint(), and getNodeIDs().

◆ _pnt

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

Definition at line 67 of file MeshNodesOnPoint.h.

Referenced by getPoint().


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