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 33 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 20 of file BoundaryElementsSearcher.cpp.

22 : mesh(mesh), _mshNodeSearcher(mshNodeSearcher)
23{
24}

References _mshNodeSearcher, and mesh.

◆ ~BoundaryElementsSearcher()

MeshGeoToolsLib::BoundaryElementsSearcher::~BoundaryElementsSearcher ( )
virtual

destructor

Definition at line 26 of file BoundaryElementsSearcher.cpp.

27{
28 for (auto p : _boundary_elements_at_point)
29 {
30 delete p;
31 }
33 {
34 delete p;
35 }
37 {
38 delete p;
39 }
40}
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 72 of file BoundaryElementsSearcher.cpp.

74{
75 switch (geoObj.getGeoType())
76 {
78 {
79 std::function<GeoLib::Point(BoundaryElementsAtPoint const&)>
80 get_cached_item = &BoundaryElementsAtPoint::getPoint;
82 _boundary_elements_at_point, get_cached_item,
83 *dynamic_cast<const GeoLib::Point*>(&geoObj), mesh,
84 _mshNodeSearcher, multiple_nodes_allowed);
85 }
86 break;
88 {
89 std::function<GeoLib::Polyline(
90 BoundaryElementsAlongPolyline const&)>
94 *dynamic_cast<const GeoLib::Polyline*>(&geoObj), mesh,
95 _mshNodeSearcher, false);
96 }
97 break;
99 {
100 std::function<GeoLib::Surface(BoundaryElementsOnSurface const&)>
101 get_cached_item = &BoundaryElementsOnSurface::getSurface;
103 _boundary_elements_along_surfaces, get_cached_item,
104 *dynamic_cast<const GeoLib::Surface*>(&geoObj), mesh,
105 _mshNodeSearcher, false);
106 }
107 break;
108 default:
109 const static std::vector<MeshLib::Element*> dummy(0);
110 return dummy;
111 }
112}
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 63 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 64 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 62 of file BoundaryElementsSearcher.h.

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

◆ _mshNodeSearcher

MeshNodeSearcher const& MeshGeoToolsLib::BoundaryElementsSearcher::_mshNodeSearcher
private

Definition at line 61 of file BoundaryElementsSearcher.h.

Referenced by BoundaryElementsSearcher(), and getBoundaryElements().

◆ mesh

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

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