Skip to content
Snippets Groups Projects
Commit 2b1c05a2 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MGTL] Make SearchLength calculation configurable.

parent e41340a0
No related branches found
No related tags found
No related merge requests found
......@@ -137,8 +137,9 @@ MeshNodesAlongSurface& MeshNodeSearcher::getMeshNodesAlongSurface(GeoLib::Surfac
return *_mesh_nodes_along_surfaces.back();
}
MeshNodeSearcher&
MeshNodeSearcher::getMeshNodeSearcher(MeshLib::Mesh const& mesh)
MeshNodeSearcher& MeshNodeSearcher::getMeshNodeSearcher(
MeshLib::Mesh const& mesh,
MeshGeoToolsLib::SearchLength const& search_length_algorithm)
{
std::size_t const mesh_id = mesh.getID();
if (_mesh_node_searchers.size() < mesh_id+1)
......@@ -146,7 +147,8 @@ MeshNodeSearcher::getMeshNodeSearcher(MeshLib::Mesh const& mesh)
if (!_mesh_node_searchers[mesh_id])
_mesh_node_searchers[mesh_id].reset(
new MeshGeoToolsLib::MeshNodeSearcher(mesh));
new MeshGeoToolsLib::MeshNodeSearcher(mesh,
search_length_algorithm));
return *_mesh_node_searchers[mesh_id];
}
......
......@@ -59,9 +59,9 @@ public:
* @param search_all_nodes switch between searching all mesh nodes and
* searching the base nodes.
*/
explicit MeshNodeSearcher(MeshLib::Mesh const& mesh,
MeshGeoToolsLib::SearchLength const& search_length_algorithm
= MeshGeoToolsLib::SearchLength(),
MeshNodeSearcher(
MeshLib::Mesh const& mesh,
MeshGeoToolsLib::SearchLength const& search_length_algorithm,
bool search_all_nodes = true);
virtual ~MeshNodeSearcher();
......@@ -133,7 +133,10 @@ public:
* Returns a (possibly new) mesh node searcher for the mesh.
* A new one will be created, if it does not already exists.
*/
static MeshNodeSearcher& getMeshNodeSearcher(MeshLib::Mesh const& mesh);
static MeshNodeSearcher& getMeshNodeSearcher(
MeshLib::Mesh const& mesh,
MeshGeoToolsLib::SearchLength const& search_length_algorithm =
MeshGeoToolsLib::SearchLength());
private:
MeshLib::Mesh const& _mesh;
......
......@@ -25,8 +25,11 @@ std::unique_ptr<BoundaryCondition> BoundaryConditionBuilder::createBoundaryCondi
const unsigned shapefunction_order,
const std::vector<std::unique_ptr<ProcessLib::ParameterBase>>& parameters)
{
MeshGeoToolsLib::SearchLength search_length_algorithm;
MeshGeoToolsLib::MeshNodeSearcher& mesh_node_searcher =
MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeSearcher(mesh);
MeshGeoToolsLib::MeshNodeSearcher::getMeshNodeSearcher(
mesh, search_length_algorithm);
MeshGeoToolsLib::BoundaryElementsSearcher boundary_element_searcher(
mesh, mesh_node_searcher);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment