From f33a32a1ea49f5ca114f076aa63a021be1df4f9c Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Wed, 25 Sep 2019 16:52:48 +0200
Subject: [PATCH] [PL] TL; Remove no longer needed _sols_of_cpl_pcs.

_solutions_of_coupled_processes member.
---
 ProcessLib/TimeLoop.cpp | 16 +++++-----------
 ProcessLib/TimeLoop.h   |  7 -------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/ProcessLib/TimeLoop.cpp b/ProcessLib/TimeLoop.cpp
index d21fb89cc00..2864cfddadc 100644
--- a/ProcessLib/TimeLoop.cpp
+++ b/ProcessLib/TimeLoop.cpp
@@ -226,11 +226,9 @@ TimeLoop::TimeLoop(
 
 void TimeLoop::setCoupledSolutions()
 {
-    _solutions_of_coupled_processes.reserve(_per_process_data.size());
     for (auto& process_data : _per_process_data)
     {
         auto const& x = *_process_solutions[process_data->process_id];
-        _solutions_of_coupled_processes.emplace_back(x);
 
         // Create a vector to store the solution of the last coupling iteration
         auto& x0 = NumLib::GlobalVectorProvider::provider.getVector(x);
@@ -559,9 +557,7 @@ static std::string const nonlinear_fixed_dt_fails_info =
 void postTimestepForAllProcesses(
     double const t, double const dt,
     std::vector<std::unique_ptr<ProcessData>> const& per_process_data,
-    std::vector<GlobalVector*> const& _process_solutions,
-    std::vector<std::reference_wrapper<GlobalVector const>> const&
-        solutions_of_coupled_processes)
+    std::vector<GlobalVector*> const& process_solutions)
 {
     // All _per_process_data share the first process.
     bool const is_staggered_coupling =
@@ -575,10 +571,10 @@ void postTimestepForAllProcesses(
         if (is_staggered_coupling)
         {
             CoupledSolutionsForStaggeredScheme coupled_solutions(
-                _process_solutions);
+                process_solutions);
             pcs.setCoupledSolutionsForStaggeredScheme(&coupled_solutions);
         }
-        auto& x = *_process_solutions[process_id];
+        auto& x = *process_solutions[process_id];
         pcs.postTimestep(x, t, dt, process_id);
         pcs.computeSecondaryVariable(t, x, process_id);
     }
@@ -617,8 +613,7 @@ NumLib::NonlinearSolverStatus TimeLoop::solveUncoupledEquationSystems(
         }
     }
 
-    postTimestepForAllProcesses(t, dt, _per_process_data, _process_solutions,
-                                _solutions_of_coupled_processes);
+    postTimestepForAllProcesses(t, dt, _per_process_data, _process_solutions);
 
     return nonlinear_solver_status;
 }
@@ -747,8 +742,7 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme(
         INFO("[time] Phreeqc took %g s.", time_phreeqc.elapsed());
     }
 
-    postTimestepForAllProcesses(t, dt, _per_process_data, _process_solutions,
-                                _solutions_of_coupled_processes);
+    postTimestepForAllProcesses(t, dt, _per_process_data, _process_solutions);
 
     return nonlinear_solver_status;
 }
diff --git a/ProcessLib/TimeLoop.h b/ProcessLib/TimeLoop.h
index 184d87d852c..3de2dda73c5 100644
--- a/ProcessLib/TimeLoop.h
+++ b/ProcessLib/TimeLoop.h
@@ -126,13 +126,6 @@ private:
         _global_coupling_conv_crit;
 
     std::unique_ptr<ChemistryLib::ChemicalSolverInterface> _chemical_system;
-    /**
-     *  Vector of solutions of the coupled processes.
-     *  Each vector element stores the references of the solution vectors
-     *  (stored in _process_solutions) of the coupled processes of a process.
-     */
-    std::vector<std::reference_wrapper<GlobalVector const>>
-        _solutions_of_coupled_processes;
 
     /// Solutions of the previous coupling iteration for the convergence
     /// criteria of the coupling iteration.
-- 
GitLab