From e69d92cca35639446287de932dc3e155fadf5639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Wed, 12 Nov 2014 20:40:46 +0100 Subject: [PATCH] Moved KSPCreate to the Data constructor This is where it was always intended to be called, so this fixes a mistake in earlier development. --- opm/core/linalg/LinearSolverPetsc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/core/linalg/LinearSolverPetsc.cpp b/opm/core/linalg/LinearSolverPetsc.cpp index e5fd3a614..1adf55986 100644 --- a/opm/core/linalg/LinearSolverPetsc.cpp +++ b/opm/core/linalg/LinearSolverPetsc.cpp @@ -139,6 +139,8 @@ namespace{ CHKERRXX( err ); MatSetFromOptions( A ); MatSetUp( A ); + + KSPCreate( PETSC_COMM_WORLD, &ksp ); } ~OEM_DATA() { @@ -203,7 +205,6 @@ namespace{ PetscReal residual; KSPConvergedReason reason; - KSPCreate( PETSC_COMM_WORLD, &t.ksp ); KSPSetOperators( t.ksp, t.A, t.A, DIFFERENT_NONZERO_PATTERN ); KSPGetPC( t.ksp, &t.preconditioner ); auto err = KSPSetType( t.ksp, method );