OGS
MeshGeoToolsLib::MeshNodesAlongSurface Class Reference

Detailed Description

This class computes the ids of the mesh nodes along a surface.

Definition at line 34 of file MeshNodesAlongSurface.h.

#include <MeshNodesAlongSurface.h>

Collaboration diagram for MeshGeoToolsLib::MeshNodesAlongSurface:
[legend]

Public Member Functions

 MeshNodesAlongSurface (MeshLib::Mesh const &mesh, GeoLib::Surface const &sfc, 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::Surface const & getSurface () const
 

Private Attributes

MeshLib::Mesh const & _mesh
 
GeoLib::Surface const & _sfc
 
std::vector< std::size_t > _msh_node_ids
 

Constructor & Destructor Documentation

◆ MeshNodesAlongSurface()

MeshGeoToolsLib::MeshNodesAlongSurface::MeshNodesAlongSurface ( MeshLib::Mesh const & mesh,
GeoLib::Surface const & sfc,
double epsilon_radius,
SearchAllNodes search_all_nodes )

Constructor of object, that search mesh nodes along a GeoLib::Surface object within a given search radius.

Parameters
meshMesh the search will be performed on.
sfcAlong the GeoLib::Surface sfc the mesh nodes are searched.
epsilon_radiusEuclidean distance tolerance value. Is the distance between a mesh node and the surface smaller than that value it is a mesh node near the surface.
search_all_nodesswitch between searching all mesh nodes and searching the base nodes.

Definition at line 25 of file MeshNodesAlongSurface.cpp.

29 : _mesh(mesh), _sfc(sfc)
30{
31 auto const& mesh_nodes = _mesh.getNodes();
32 const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes
35 // loop over all nodes
36 for (std::size_t i = 0; i < n_nodes; i++)
37 {
38 auto const* const node = mesh_nodes[i];
39 if (!sfc.isPntInBoundingVolume(*node, epsilon_radius))
40 {
41 continue;
42 }
43 if (sfc.isPntInSfc(*node, epsilon_radius))
44 {
45 _msh_node_ids.push_back(node->getID());
46 }
47 }
48}
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::size_t computeNumberOfBaseNodes() const
Get the number of base nodes.
Definition Mesh.cpp:238
std::size_t getNumberOfNodes() const
Get the number of nodes.
Definition Mesh.h:100

References _mesh, _msh_node_ids, MeshLib::Mesh::computeNumberOfBaseNodes(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getNumberOfNodes(), GeoLib::Surface::isPntInBoundingVolume(), GeoLib::Surface::isPntInSfc(), and MeshGeoToolsLib::Yes.

Member Function Documentation

◆ getMesh()

MeshLib::Mesh const & MeshGeoToolsLib::MeshNodesAlongSurface::getMesh ( ) const

return the mesh object

Definition at line 50 of file MeshNodesAlongSurface.cpp.

51{
52 return _mesh;
53}

References _mesh.

◆ getNodeIDs()

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

Access the vector of mesh node ids.

Returns
The vector of mesh node ids calculated in the constructor

Definition at line 55 of file MeshNodesAlongSurface.cpp.

56{
57 return _msh_node_ids;
58}

References _msh_node_ids.

◆ getSurface()

GeoLib::Surface const & MeshGeoToolsLib::MeshNodesAlongSurface::getSurface ( ) const

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

Returns
the underlying GeoLib::Surface

Definition at line 60 of file MeshNodesAlongSurface.cpp.

61{
62 return _sfc;
63}

References _sfc.

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

Member Data Documentation

◆ _mesh

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

Definition at line 69 of file MeshNodesAlongSurface.h.

Referenced by MeshNodesAlongSurface(), and getMesh().

◆ _msh_node_ids

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

Definition at line 71 of file MeshNodesAlongSurface.h.

Referenced by MeshNodesAlongSurface(), and getNodeIDs().

◆ _sfc

GeoLib::Surface const& MeshGeoToolsLib::MeshNodesAlongSurface::_sfc
private

Definition at line 70 of file MeshNodesAlongSurface.h.

Referenced by getSurface().


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