Commit 8b3e2168 authored by Praetorius, Simon's avatar Praetorius, Simon

Pfc preconditioner updated for petsc>3.5

parent a13af864
......@@ -77,7 +77,11 @@ namespace AMDiS { namespace Parallel {
{
// Create FGMRES based outer solver
KSPCreate(meshDistributor->getMpiComm(0), &ksp);
#if (PETSC_VERSION_MINOR >= 5)
KSPSetOperators(ksp, getMatInterior(), getMatInterior());
#else
KSPSetOperators(ksp, getMatInterior(), getMatInterior(), SAME_NONZERO_PATTERN);
#endif
if (getInfo() >= 10)
KSPMonitorSet(ksp, KSPMonitorDefault, PETSC_NULL, PETSC_NULL);
else if (getInfo() >= 20)
......
......@@ -76,7 +76,11 @@ namespace AMDiS { namespace Parallel {
{
// Create FGMRES based outer solver
KSPCreate(meshDistributor->getMpiComm(0), &ksp);
#if (PETSC_VERSION_MINOR >= 5)
KSPSetOperators(ksp, getMatInterior(), getMatInterior());
#else
KSPSetOperators(ksp, getMatInterior(), getMatInterior(), SAME_NONZERO_PATTERN);
#endif
if (getInfo() >= 10)
KSPMonitorSet(ksp, KSPMonitorDefault, PETSC_NULL, PETSC_NULL);
else if (getInfo() >= 20)
......@@ -162,7 +166,12 @@ namespace AMDiS { namespace Parallel {
MatAXPY(matS, (-2.0*delta), data.matK, DIFFERENT_NONZERO_PATTERN); // S = S - 2*sqrt(delta)*K
VecDestroy(&x);
MatDestroy(&DK);
#if (PETSC_VERSION_MINOR >= 5)
KSPSetOperators(data.kspS, matS, matS);
#else
KSPSetOperators(data.kspS, matS, matS, SAME_NONZERO_PATTERN);
#endif
// === Setup preconditioner data ===
data.delta = delta;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment