From 0389b6c708d823b5a6e54f2c5706b65807731c9c Mon Sep 17 00:00:00 2001
From: "Dmitry Yu. Naumov" <github@naumov.de>
Date: Fri, 18 Sep 2015 17:20:09 +0000
Subject: [PATCH] Revert "fix a bug in linear solver creation. it should be
 created after assemlying A."

This reverts commit 0237275a0e11860556ee7540af9f01baa3bc7df3.
---
 ProcessLib/GroundwaterFlowProcess.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ProcessLib/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlowProcess.h
index c0387c5a909..3d9797f4800 100644
--- a/ProcessLib/GroundwaterFlowProcess.h
+++ b/ProcessLib/GroundwaterFlowProcess.h
@@ -215,6 +215,8 @@ public:
         _A.reset(_global_setup.createMatrix(_local_to_global_index_map->dofSize()));
         _x.reset(_global_setup.createVector(_local_to_global_index_map->dofSize()));
         _rhs.reset(_global_setup.createVector(_local_to_global_index_map->dofSize()));
+        _linearSolver.reset(new typename GlobalSetup::LinearSolver(*_A));
+
 
         setInitialConditions(*_hydraulic_head);
 
@@ -261,8 +263,7 @@ public:
         // Apply known values from the Dirichlet boundary conditions.
         MathLib::applyKnownSolution(*_A, *_rhs, _dirichlet_bc.global_ids, _dirichlet_bc.values);
 
-        typename GlobalSetup::LinearSolver linearSolver(*_A);
-        linearSolver.solve(*_rhs, *_x);
+        _linearSolver->solve(*_rhs, *_x);
 
         return true;
     }
@@ -325,6 +326,7 @@ private:
     std::vector<MeshLib::MeshSubsets*> _all_mesh_subsets;
 
     GlobalSetup _global_setup;
+    std::unique_ptr<typename GlobalSetup::LinearSolver> _linearSolver;
     std::unique_ptr<typename GlobalSetup::MatrixType> _A;
     std::unique_ptr<typename GlobalSetup::VectorType> _rhs;
     std::unique_ptr<typename GlobalSetup::VectorType> _x;
-- 
GitLab