Skip to content
Snippets Groups Projects
Commit dc1cebe0 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

dg : CylinderEddiesImplicit.py

parent ef0af9b0
No related branches found
No related tags found
No related merge requests found
...@@ -85,6 +85,8 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::getFromSolution(int row, fullM ...@@ -85,6 +85,8 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::getFromSolution(int row, fullM
template<> template<>
void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows) 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); _blockSize = strtol (_parameters["blockSize"].c_str(), NULL, 10);
if (_blockSize == 0) if (_blockSize == 0)
Msg::Error ("'blockSize' parameters must be set for linearSystemPETScBlock"); Msg::Error ("'blockSize' parameters must be set for linearSystemPETScBlock");
......
...@@ -62,14 +62,15 @@ class linearSystemPETSc : public linearSystem<scalar> { ...@@ -62,14 +62,15 @@ class linearSystemPETSc : public linearSystem<scalar> {
_try(KSPGetPC(_ksp, &pc)); _try(KSPGetPC(_ksp, &pc));
// set some default options // set some default options
//_try(PCSetType(pc, PCLU));//LU for direct solver and PCILU for indirect solver //_try(PCSetType(pc, PCLU));//LU for direct solver and PCILU for indirect solver
_try(PCFactorSetMatOrderingType(pc, MATORDERING_RCM)); /* _try(PCFactorSetMatOrderingType(pc, MATORDERING_RCM));
_try(PCFactorSetLevels(pc, 1)); _try(PCFactorSetLevels(pc, 1));*/
_try(KSPSetTolerances(_ksp, 1.e-8, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT)); _try(KSPSetTolerances(_ksp, 1.e-8, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT));
// override the default options with the ones from the option // override the default options with the ones from the option
// database (if any) // database (if any)
if (this->_parameters.count("petscPrefix")) if (this->_parameters.count("petscPrefix"))
_try(KSPAppendOptionsPrefix(_ksp, this->_parameters["petscPrefix"].c_str())); _try(KSPAppendOptionsPrefix(_ksp, this->_parameters["petscPrefix"].c_str()));
_try(KSPSetFromOptions(_ksp)); _try(KSPSetFromOptions(_ksp));
_try(PCSetFromOptions(pc));
_kspAllocated = true; _kspAllocated = true;
} }
public: public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment