fixed: initial guess mess with preonly ksp in PETSc (lu solves)
This commit is contained in:
1 parent
20ecda0d55
commit
5c9bac9cf9
1 file changed
+4
-2
@@ -476,7 +476,8 @@ bool PETScMatrix::solve (SystemVector& B, bool newLHS, Real*)
|
||||
VecDuplicate(Bptr->getVector(),&x);
|
||||
VecCopy(Bptr->getVector(),x);
|
||||
|
||||
bool result = this->solve(x,Bptr->getVector(),newLHS,true);
|
||||
bool result = this->solve(x,Bptr->getVector(),newLHS,
|
||||
solParams.getStringValue("type") != "preonly");
|
||||
VecDestroy(&x);
|
||||
|
||||
return result;
|
||||
@@ -521,7 +522,8 @@ bool PETScMatrix::solve (const Vec& b, Vec& x, bool newLHS, bool knoll)
|
||||
if (knoll)
|
||||
KSPSetInitialGuessKnoll(ksp,PETSC_TRUE);
|
||||
else
|
||||
KSPSetInitialGuessNonzero(ksp,PETSC_TRUE);
|
||||
KSPSetInitialGuessNonzero(ksp,solParams.getStringValue("type") == "preonly" ?
|
||||
PETSC_FALSE : PETSC_TRUE);
|
||||
KSPSolve(ksp,b,x);
|
||||
KSPConvergedReason reason;
|
||||
KSPGetConvergedReason(ksp,&reason);
|
||||
|
||||
Reference in new issue
Block a user