OGS
MeshGeoToolsLib::MeshNodesAlongSurface Class Reference

Detailed Description

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

Definition at line 25 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 16 of file MeshNodesAlongSurface.cpp.

20 : _mesh(mesh), _sfc(sfc)
21{
22 auto const& mesh_nodes = _mesh.getNodes();
23 const std::size_t n_nodes(search_all_nodes == SearchAllNodes::Yes
24 ? _mesh.getNumberOfNodes()
25 : _mesh.computeNumberOfBaseNodes());
26 // loop over all nodes
27 for (std::size_t i = 0; i < n_nodes; i++)
28 {
29 auto const* const node = mesh_nodes[i];
30 if (!sfc.isPntInBoundingVolume(*node, epsilon_radius))
31 {
32 continue;
33 }
34 if (sfc.isPntInSfc(*node, epsilon_radius))
35 {
36 _msh_node_ids.push_back(node->getID());
37 }
38 }
39}

References _mesh, _msh_node_ids, _sfc, 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 41 of file MeshNodesAlongSurface.cpp.

42{
43 return _mesh;
44}

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 46 of file MeshNodesAlongSurface.cpp.

47{
48 return _msh_node_ids;
49}

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 51 of file MeshNodesAlongSurface.cpp.

52{
53 return _sfc;
54}

References _sfc.

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

Member Data Documentation

◆ _mesh

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

Definition at line 60 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 62 of file MeshNodesAlongSurface.h.

Referenced by MeshNodesAlongSurface(), and getNodeIDs().

◆ _sfc

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

Definition at line 61 of file MeshNodesAlongSurface.h.

Referenced by MeshNodesAlongSurface(), and getSurface().


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