From a2cdbbc43e683731bcc074d02ff17275067a80ab Mon Sep 17 00:00:00 2001
From: Wenqing Wang <wenqing.wang@ufz.de>
Date: Thu, 16 Feb 2017 17:46:39 +0100
Subject: [PATCH] [Coupling] Moved one function from one file to another

---
 ProcessLib/StaggeredCouplingTerm.cpp | 21 +++++++++++++++++++++
 ProcessLib/StaggeredCouplingTerm.h   |  6 ++++++
 ProcessLib/VectorMatrixAssembler.cpp | 21 ---------------------
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/ProcessLib/StaggeredCouplingTerm.cpp b/ProcessLib/StaggeredCouplingTerm.cpp
index a6468487e85..a6c7b0da65d 100644
--- a/ProcessLib/StaggeredCouplingTerm.cpp
+++ b/ProcessLib/StaggeredCouplingTerm.cpp
@@ -23,4 +23,25 @@ const StaggeredCouplingTerm createVoidStaggeredCouplingTerm()
     return StaggeredCouplingTerm(coupled_processes, coupled_xs, 0.0, empty);
 }
 
+std::unordered_map<std::type_index, const std::vector<double>>
+getCurrentLocalSolutionsOfCoupledProcesses(
+    const std::unordered_map<std::type_index, GlobalVector const&>&
+        global_coupled_xs,
+    const std::vector<GlobalIndexType>& indices)
+{
+    std::unordered_map<std::type_index, const std::vector<double>>
+        local_coupled_xs;
+
+    // Get local nodal solutions of the coupled equations.
+    for (auto const& global_coupled_x_pair : global_coupled_xs)
+    {
+        auto const& coupled_x = global_coupled_x_pair.second;
+        auto const local_coupled_x = coupled_x.get(indices);
+        BaseLib::insertIfTypeIndexKeyUniqueElseError(
+            local_coupled_xs, global_coupled_x_pair.first, local_coupled_x,
+            "local_coupled_x");
+    }
+    return local_coupled_xs;
+}
+
 }  // end of ProcessLib
diff --git a/ProcessLib/StaggeredCouplingTerm.h b/ProcessLib/StaggeredCouplingTerm.h
index 8089d0a07e0..8e362536a17 100644
--- a/ProcessLib/StaggeredCouplingTerm.h
+++ b/ProcessLib/StaggeredCouplingTerm.h
@@ -104,4 +104,10 @@ struct LocalCouplingTerm
  */
 const StaggeredCouplingTerm createVoidStaggeredCouplingTerm();
 
+std::unordered_map<std::type_index, const std::vector<double>>
+getCurrentLocalSolutionsOfCoupledProcesses(
+    const std::unordered_map<std::type_index, GlobalVector const&>&
+        global_coupled_xs,
+    const std::vector<GlobalIndexType>& indices);
+
 }  // end of ProcessLib
diff --git a/ProcessLib/VectorMatrixAssembler.cpp b/ProcessLib/VectorMatrixAssembler.cpp
index a82bd789339..ba007e7734d 100644
--- a/ProcessLib/VectorMatrixAssembler.cpp
+++ b/ProcessLib/VectorMatrixAssembler.cpp
@@ -49,27 +49,6 @@ getPreviousLocalSolutionsOfCoupledProcesses(
     return local_coupled_xs0;
 }
 
-static std::unordered_map<std::type_index, const std::vector<double>>
-getCurrentLocalSolutionsOfCoupledProcesses(
-    const std::unordered_map<std::type_index, GlobalVector const&>&
-        global_coupled_xs,
-    const std::vector<GlobalIndexType>& indices)
-{
-    std::unordered_map<std::type_index, const std::vector<double>>
-        local_coupled_xs;
-
-    // Get local nodal solutions of the coupled equations.
-    for (auto const& global_coupled_x_pair : global_coupled_xs)
-    {
-        auto const& coupled_x = global_coupled_x_pair.second;
-        auto const local_coupled_x = coupled_x.get(indices);
-        BaseLib::insertIfTypeIndexKeyUniqueElseError(
-            local_coupled_xs, global_coupled_x_pair.first, local_coupled_x,
-            "local_coupled_x");
-    }
-    return local_coupled_xs;
-}
-
 VectorMatrixAssembler::VectorMatrixAssembler(
     std::unique_ptr<AbstractJacobianAssembler>&& jacobian_assembler)
     : _jacobian_assembler(std::move(jacobian_assembler))
-- 
GitLab