OGS
MeshGeoToolsLib::BoundaryElementsSearcher Class Reference

Detailed Description

This class searches boundary elements located on a given geometric object, i.e. polyline and surface. Note that internal boundaries are currently not supported.

Definition at line 38 of file BoundaryElementsSearcher.h.

#include <BoundaryElementsSearcher.h>

Collaboration diagram for MeshGeoToolsLib::BoundaryElementsSearcher:
[legend]

Public Member Functions

 BoundaryElementsSearcher (MeshLib::Mesh const &mesh, MeshNodeSearcher const &mshNodeSearcher)
 
virtual ~BoundaryElementsSearcher ()
 destructor
 
std::vector< MeshLib::Element * > const & getBoundaryElements (GeoLib::GeoObject const &geoObj, bool const multiple_nodes_allowed)
 

Public Attributes

MeshLib::Mesh const & mesh
 

Private Attributes

MeshNodeSearcher const & _mshNodeSearcher
 
std::vector< BoundaryElementsAtPoint * > _boundary_elements_at_point
 
std::vector< BoundaryElementsAlongPolyline * > _boundary_elements_along_polylines
 
std::vector< BoundaryElementsOnSurface * > _boundary_elements_along_surfaces
 

Constructor & Destructor Documentation

◆ BoundaryElementsSearcher()

MeshGeoToolsLib::BoundaryElementsSearcher::BoundaryElementsSearcher ( MeshLib::Mesh const & mesh,
MeshNodeSearcher const & mshNodeSearcher )

Constructor

Parameters
mesha mesh object
mshNodeSearchera MeshNodeSearcher object which is internally used to search mesh nodes

Definition at line 26 of file BoundaryElementsSearcher.cpp.

28 : mesh(mesh), _mshNodeSearcher(mshNodeSearcher)
29{
30}

◆ ~BoundaryElementsSearcher()

MeshGeoToolsLib::BoundaryElementsSearcher::~BoundaryElementsSearcher ( )
virtual

destructor

Definition at line 32 of file BoundaryElementsSearcher.cpp.

33{
34 for (auto p : _boundary_elements_at_point)
35 {
36 delete p;
37 }
39 {
40 delete p;
41 }
43 {
44 delete p;
45 }
46}
std::vector< BoundaryElementsAlongPolyline * > _boundary_elements_along_polylines
std::vector< BoundaryElementsAtPoint * > _boundary_elements_at_point
std::vector< BoundaryElementsOnSurface * > _boundary_elements_along_surfaces

References _boundary_elements_along_polylines, _boundary_elements_along_surfaces, and _boundary_elements_at_point.

Member Function Documentation

◆ getBoundaryElements()

std::vector< MeshLib::Element * > const & MeshGeoToolsLib::BoundaryElementsSearcher::getBoundaryElements ( GeoLib::GeoObject const & geoObj,
bool const multiple_nodes_allowed )

generate boundary elements on the given geometric object (point, polyline, surface).

Parameters
geoObja GeoLib::GeoObject where the nearest mesh node is searched for
multiple_nodes_allowedallows for finding multiple nodes within the given search radius for a point
Returns
a vector of boundary element objects

Definition at line 78 of file BoundaryElementsSearcher.cpp.

80{
81 switch (geoObj.getGeoType())
82 {
84 {
85 std::function<GeoLib::Point(BoundaryElementsAtPoint const&)>
86 get_cached_item = &BoundaryElementsAtPoint::getPoint;
88 _boundary_elements_at_point, get_cached_item,
89 *dynamic_cast<const GeoLib::Point*>(&geoObj), mesh,
90 _mshNodeSearcher, multiple_nodes_allowed);
91 }
92 break;
94 {
95 std::function<GeoLib::Polyline(
96 BoundaryElementsAlongPolyline const&)>
100 *dynamic_cast<const GeoLib::Polyline*>(&geoObj), mesh,
101 _mshNodeSearcher, false);
102 }
103 break;
105 {
106 std::function<GeoLib::Surface(BoundaryElementsOnSurface const&)>
107 get_cached_item = &BoundaryElementsOnSurface::getSurface;
109 _boundary_elements_along_surfaces, get_cached_item,
110 *dynamic_cast<const GeoLib::Surface*>(&geoObj), mesh,
111 _mshNodeSearcher, false);
112 }
113 break;
114 default:
115 const static std::vector<MeshLib::Element*> dummy(0);
116 return dummy;
117 }
118}
Class Polyline consists mainly of a reference to a point vector and a vector that stores the indices ...
Definition Polyline.h:40
A Surface is represented by Triangles. It consists of a reference to a vector of (pointers to) points...
Definition Surface.h:33
std::vector< MeshLib::Element * > const & getBoundaryElements(std::vector< CacheType * > &cached_elements, std::function< GeometryType(CacheType const &)> getCachedItem, GeometryType const &item, MeshLib::Mesh const &mesh, MeshNodeSearcher const &mesh_node_searcher, bool const multiple_nodes_allowed)

References _boundary_elements_along_polylines, _boundary_elements_along_surfaces, _boundary_elements_at_point, _mshNodeSearcher, MeshGeoToolsLib::getBoundaryElements(), GeoLib::GeoObject::getGeoType(), MeshGeoToolsLib::BoundaryElementsAtPoint::getPoint(), MeshGeoToolsLib::BoundaryElementsAlongPolyline::getPolyline(), MeshGeoToolsLib::BoundaryElementsOnSurface::getSurface(), mesh, GeoLib::POINT, GeoLib::POLYLINE, and GeoLib::SURFACE.

Referenced by MeshGeoToolsLib::constructAdditionalMeshesFromGeometries().

Member Data Documentation

◆ _boundary_elements_along_polylines

std::vector<BoundaryElementsAlongPolyline*> MeshGeoToolsLib::BoundaryElementsSearcher::_boundary_elements_along_polylines
private

Definition at line 68 of file BoundaryElementsSearcher.h.

Referenced by ~BoundaryElementsSearcher(), and getBoundaryElements().

◆ _boundary_elements_along_surfaces

std::vector<BoundaryElementsOnSurface*> MeshGeoToolsLib::BoundaryElementsSearcher::_boundary_elements_along_surfaces
private

Definition at line 69 of file BoundaryElementsSearcher.h.

Referenced by ~BoundaryElementsSearcher(), and getBoundaryElements().

◆ _boundary_elements_at_point

std::vector<BoundaryElementsAtPoint*> MeshGeoToolsLib::BoundaryElementsSearcher::_boundary_elements_at_point
private

Definition at line 67 of file BoundaryElementsSearcher.h.

Referenced by ~BoundaryElementsSearcher(), and getBoundaryElements().

◆ _mshNodeSearcher

MeshNodeSearcher const& MeshGeoToolsLib::BoundaryElementsSearcher::_mshNodeSearcher
private

Definition at line 66 of file BoundaryElementsSearcher.h.

Referenced by getBoundaryElements().

◆ mesh

MeshLib::Mesh const& MeshGeoToolsLib::BoundaryElementsSearcher::mesh

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