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
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");
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment