Skip to content

Commit

Permalink
fix deallocation of PC context
Browse files Browse the repository at this point in the history
  • Loading branch information
mjr-deltares committed Sep 26, 2023
1 parent 765c080 commit 4e0a8dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 0 additions & 6 deletions src/Solution/PETSc/PetscImsPreconditioner.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ subroutine pcshell_destroy(pc, ierr)
PC :: pc !< the shell preconditioner
PetscErrorCode :: ierr !< PETSc error code
! local
type(PcShellCtxType), pointer :: pc_ctx => null()

call PCShellGetContext(pc, pc_ctx, ierr)
CHKERRQ(ierr)
call VecDestroy(pc_ctx%diag, ierr)
CHKERRQ(ierr)

end subroutine pcshell_destroy

Expand Down
4 changes: 3 additions & 1 deletion src/Solution/PETSc/PetscSolver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ subroutine petsc_destroy(this)
CHKERRQ(ierr)
deallocate (this%petsc_ctx)

allocate (this%pc_context)
call VecDestroy(this%pc_context%diag, ierr)
CHKERRQ(ierr)
deallocate (this%pc_context)

end subroutine petsc_destroy

Expand Down

0 comments on commit 4e0a8dc

Please sign in to comment.