Hello Barry,
Thank you a lot for your help, Now I am getting the attached error message.
Bests,
Sawsan
From: Barry Smith <bsmith@petsc.dev>
Sent: Wednesday, December 20, 2023 6:32 PM
To: Shatanawi, Sawsan Muhammad <sawsan.shatanawi@wsu.edu>
Cc: Mark Adams <mfadams@lbl.gov>; petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code[EXTERNAL EMAIL]
Instead of
call PCCreate(PETSC_COMM_WORLD, pc, ierr)call PCSetType(pc, PCILU,ierr) ! Choose a preconditioner type (ILU)call KSPSetPC(ksp, pc,ierr) ! Associate the preconditioner with the KSP solver
do
call KSPGetPC(ksp,pc,ierr)call PCSetType(pc, PCILU,ierr)
Do not call KSPSetUp(). It will be taken care of automatically during the solve
On Dec 20, 2023, at 8:52 PM, Shatanawi, Sawsan Muhammad via petsc-users <petsc-users@mcs.anl.gov> wrote:
Hello,
I don't think that I set preallocation values when I created the matrix, would you please have look at my code. It is just the petsc related part from my code.
I was able to fix some of the error messages. Now I have a new set of error messages related to the KSP solver (attached)
I appreciate your help
Sawsan
From: Mark Adams <mfadams@lbl.gov>
Sent: Wednesday, December 20, 2023 6:44 AM
To: Shatanawi, Sawsan Muhammad <sawsan.shatanawi@wsu.edu>
Cc: petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code<Matrix_RHS.F90><out.txt><solver.F90>[EXTERNAL EMAIL]Did you set preallocation values when you created the matrix?Don't do that.
On Wed, Dec 20, 2023 at 9:36 AM Shatanawi, Sawsan Muhammad <sawsan.shatanawi@wsu.edu> wrote:
Hello,
I am trying to create a sparse matrix( which is as I believe a zero matrix) then adding some nonzero elements to it over a loop, then assembling it