From dc1cebe0aa01c2b22c02004d0dfe305781cf7d30 Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Tue, 14 Dec 2010 15:21:18 +0000
Subject: [PATCH] dg : CylinderEddiesImplicit.py

---
 Solver/linearSystemPETSc.cpp | 2 ++
 Solver/linearSystemPETSc.h   | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Solver/linearSystemPETSc.cpp b/Solver/linearSystemPETSc.cpp
index 0a15b442fa..2815bd10c6 100644
--- a/Solver/linearSystemPETSc.cpp
+++ b/Solver/linearSystemPETSc.cpp
@@ -85,6 +85,8 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::getFromSolution(int row, fullM
 template<>
 void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows) 
 {
+  if (this->_parameters.count("petscOptions"))
+    _try(PetscOptionsInsertString(this->_parameters["petscOptions"].c_str()));
   _blockSize = strtol (_parameters["blockSize"].c_str(), NULL, 10);
   if (_blockSize == 0)
     Msg::Error ("'blockSize' parameters must be set for linearSystemPETScBlock");
diff --git a/Solver/linearSystemPETSc.h b/Solver/linearSystemPETSc.h
index 7af2b84b90..123ba98f67 100644
--- a/Solver/linearSystemPETSc.h
+++ b/Solver/linearSystemPETSc.h
@@ -62,14 +62,15 @@ class linearSystemPETSc : public linearSystem<scalar> {
     _try(KSPGetPC(_ksp, &pc));
     // set some default options
     //_try(PCSetType(pc, PCLU));//LU for direct solver and PCILU for indirect solver
-    _try(PCFactorSetMatOrderingType(pc, MATORDERING_RCM));
-    _try(PCFactorSetLevels(pc, 1));
+/*    _try(PCFactorSetMatOrderingType(pc, MATORDERING_RCM));
+    _try(PCFactorSetLevels(pc, 1));*/
     _try(KSPSetTolerances(_ksp, 1.e-8, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT));
     // override the default options with the ones from the option
     // database (if any)
     if (this->_parameters.count("petscPrefix"))
       _try(KSPAppendOptionsPrefix(_ksp, this->_parameters["petscPrefix"].c_str()));
     _try(KSPSetFromOptions(_ksp));
+    _try(PCSetFromOptions(pc));
     _kspAllocated = true;
   }
  public:
-- 
GitLab