@@ -983,8 +983,7 @@ subroutine petsc_solve_setup(y, A, b, ksp, petsc_numbering, &
983983 ksp_pointer = ksp
984984
985985 ! make sure we don't destroy it, the %ksp becomes a separate reference
986- ! call PetscObjectReferenceWrapper(ksp, ierr)
987- call PetscObjectReference(ksp, ierr)
986+ call PetscObjectReferenceWrapper(ksp, ierr)
988987 else
989988 ! matrices coming from block() can't cache
990989 FLAbort(" User wants to cache solver context, but no proper matrix is provided." )
@@ -994,14 +993,12 @@ subroutine petsc_solve_setup(y, A, b, ksp, petsc_numbering, &
994993
995994 ! ksp is a copy of matrix%ksp, make it a separate reference,
996995 ! so we can KSPDestroy it without destroying matrix%ksp
997- ! call PetscObjectReferenceWrapper(ksp, ierr)
998- call PetscObjectReference(ksp, ierr)
996+ call PetscObjectReferenceWrapper(ksp, ierr)
999997
1000998 ! same for the matrix, kspgetoperators returns the matrix reference
1001999 ! owned by the ksp - make it a separate reference
1002- ! call PetscObjectReferenceWrapper(A, ierr)
1003- call PetscObjectReference(ksp, ierr)
1004-
1000+ call PetscObjectReferenceWrapper(A, ierr)
1001+
10051002 end if
10061003
10071004 b= PetscNumberingCreateVec(petsc_numbering)
0 commit comments