From 749100015ca621fc62e26318998baf2a2758ea2a Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Mon, 23 Feb 2015 16:20:18 +0100
Subject: [PATCH] [ML] Rename getIntersectionByNodes. Documentation.

---
 MeshLib/MeshSubset.h                         | 6 +++++-
 Tests/AssemblerLib/LocalToGlobalIndexMap.cpp | 2 +-
 Tests/MeshLib/MeshSubsets.cpp                | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/MeshLib/MeshSubset.h b/MeshLib/MeshSubset.h
index 63f4b7b7800..b5fbee28c61 100644
--- a/MeshLib/MeshSubset.h
+++ b/MeshLib/MeshSubset.h
@@ -103,8 +103,12 @@ public:
         return _msh.getElements().cend();
     }
 
+    /// Constructs a new mesh subset which is a set intersection of the current
+    /// nodes and the provided vector of nodes.
+    /// An empty mesh subset may be returned, not a nullptr, in case of empty
+    /// intersection or empty input vector.
     MeshSubset*
-    setIntersectionByNodes(std::vector<Node*> const& nodes) const
+    getIntersectionByNodes(std::vector<Node*> const& nodes) const
     {
         std::vector<Node*>* active_nodes = new std::vector<Node*>;
 
diff --git a/Tests/AssemblerLib/LocalToGlobalIndexMap.cpp b/Tests/AssemblerLib/LocalToGlobalIndexMap.cpp
index 8bc40d0a439..cd09666aab8 100644
--- a/Tests/AssemblerLib/LocalToGlobalIndexMap.cpp
+++ b/Tests/AssemblerLib/LocalToGlobalIndexMap.cpp
@@ -91,7 +91,7 @@ TEST_F(AssemblerLibLocalToGlobalIndexMapTest, SubsetByComponent)
     std::vector<MeshLib::Node*> selected_nodes = MeshLib::selectNodes(some_elements);
 
     MeshLib::MeshSubset const* const selected_subset =
-        nodesSubset->setIntersectionByNodes(selected_nodes);
+        nodesSubset->getIntersectionByNodes(selected_nodes);
     std::vector<MeshLib::MeshSubsets*> selected_components;
     selected_components.emplace_back(new MeshLib::MeshSubsets(selected_subset));
     selected_components.emplace_back(new MeshLib::MeshSubsets(selected_subset));
diff --git a/Tests/MeshLib/MeshSubsets.cpp b/Tests/MeshLib/MeshSubsets.cpp
index 933fa8de360..eeeb20bcdf3 100644
--- a/Tests/MeshLib/MeshSubsets.cpp
+++ b/Tests/MeshLib/MeshSubsets.cpp
@@ -34,7 +34,7 @@ TEST(MeshLibMeshSubsets, UniqueMeshIds)
 }
 
 
-TEST(MeshLibMeshSubsets, SetIntersectionByNodes)
+TEST(MeshLibMeshSubsets, GetIntersectionByNodes)
 {
 	Mesh const* const mesh = MeshGenerator::generateLineMesh(1., 10);
 	MeshSubset all_nodes_mesh_subset(*mesh, mesh->getNodes());
@@ -47,7 +47,7 @@ TEST(MeshLibMeshSubsets, SetIntersectionByNodes)
 		const_cast<Node*>(mesh->getNode(5)),
 		const_cast<Node*>(mesh->getNode(7)) });
 	MeshSubset const* const some_nodes_mesh_subset =
-		all_nodes_mesh_subset.setIntersectionByNodes(some_nodes);
+		all_nodes_mesh_subset.getIntersectionByNodes(some_nodes);
 
 	// Check sizes.
 	ASSERT_EQ(some_nodes.size(), some_nodes_mesh_subset->getNNodes());
-- 
GitLab