diff --git a/Solver/linearSystemPETSc.cpp b/Solver/linearSystemPETSc.cpp index 0a15b442faa457e2bf348c3d5c0fd7f7cd00d7b2..2815bd10c6a6129ce509e8862bb2027ef295c511 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 7af2b84b90c43b7d9b13316e216df784c9a61eba..123ba98f67c517937d3809ddd4396db88da45cb9 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: