Re: [petsc-users] Matvecs and KSPSolves with multiple vectors

2023-12-20 Thread Sreeram R Venkat
Would using the CHOLMOD Cholesky factorization ( https://petsc.org/release/manualpages/Mat/MATSOLVERCHOLMOD/) let us do the factorization on device as well? On Wed, Dec 20, 2023 at 1:21 PM Pierre Jolivet wrote: > > > On 20 Dec 2023, at 8:42 AM, Sreeram R Venkat wrote: > > Ok, I think the

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Shatanawi, Sawsan Muhammad via petsc-users
Hello Matthew, Thank you for your help. I am sorry that I keep coming back with my error messages, but I reached a point that I don't know how to fix them, and I don't understand them easily. The list of errors is getting shorter, now I am getting the attached error messages Thank you again,

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Matthew Knepley
On Wed, Dec 20, 2023 at 9:49 PM Shatanawi, Sawsan Muhammad via petsc-users < petsc-users@mcs.anl.gov> wrote: > Hello Barry, > > Thank you a lot for your help, Now I am getting the attached error message. > Do not destroy the PC from KSPGetPC() THanks, Matt > Bests, > Sawsan >

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Shatanawi, Sawsan Muhammad via petsc-users
Hello Barry, Thank you a lot for your help, Now I am getting the attached error message. Bests, Sawsan From: Barry Smith Sent: Wednesday, December 20, 2023 6:32 PM To: Shatanawi, Sawsan Muhammad Cc: Mark Adams ; petsc-users@mcs.anl.gov Subject: Re:

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Barry Smith
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

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Shatanawi, Sawsan Muhammad via petsc-users
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

Re: [petsc-users] SLEPc/NEP for shell matrice T(lambda) and T'(lambda)

2023-12-20 Thread Kenneth C Hall
Jose, I have been revisiting the issue of SLEPc/NEP for shell matrices T(lambda) and T'(lambda). I am having problems running SLEPc/NEP with -nep_type nleigs. I have compiled two versions of PETSc/SLEPc: petsc-arch-real / slepc-arch-real ./configure

Re: [petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Barry Smith
I apologize; please ignore my answer below. Use MatCreateShell() as indicated by Jed. > On Dec 20, 2023, at 2:14 PM, Barry Smith wrote: > > > >> On Dec 20, 2023, at 11:44 AM, Yi Hu wrote: >> >> Dear Jed, >> >> Thanks for your reply. I have an analytical one to implement. >> >> Best,

Re: [petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Barry Smith
> On Dec 20, 2023, at 11:44 AM, Yi Hu wrote: > > Dear Jed, > > Thanks for your reply. I have an analytical one to implement. > > Best, Yi > > -Original Message- > From: Jed Brown > Sent: Wednesday, December 20, 2023 5:40 PM > To: Yi Hu ; petsc-users@mcs.anl.gov > Subject: Re:

Re: [petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Jed Brown
Then just use MatShell. I see the docs need some work to clarify this, but MatCreateSNESMF is to specify matrix-free finite differencing from code (perhaps where one wants to customize parameters). Yi Hu writes: > Dear Jed, > > Thanks for your reply. I have an analytical one to implement. > >

Re: [petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Yi Hu
Dear Jed, Thanks for your reply. I have an analytical one to implement. Best, Yi -Original Message- From: Jed Brown Sent: Wednesday, December 20, 2023 5:40 PM To: Yi Hu ; petsc-users@mcs.anl.gov Subject: Re: [petsc-users] fortran interface to snes matrix-free jacobian Are you wanting

Re: [petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Jed Brown
Are you wanting an analytic matrix-free operator or one created for you based on finite differencing? If the latter, just use -snes_mf or -snes_mf_operator. https://petsc.org/release/manual/snes/#jacobian-evaluation Yi Hu writes: > Dear PETSc team, > > My  solution scheme relies on a

[petsc-users] fortran interface to snes matrix-free jacobian

2023-12-20 Thread Yi Hu
Dear PETSc team, My  solution scheme relies on a matrix-free jacobian in the SNES solver. I saw the useful C interface like MatCreateSNESMF(), DMSNESCreateJacobianMF(). I am wondering if you have the fortran equivalence? I think for my problem in the main program I need to do

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Mark Adams
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.shatan...@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

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Shatanawi, Sawsan Muhammad via petsc-users
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 Get Outlook for iOS From: Mark Adams Sent: Wednesday, December 20, 2023 2:48 AM To:

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Matthew Knepley
On Tue, Dec 19, 2023 at 9:50 PM Shatanawi, Sawsan Muhammad via petsc-users < petsc-users@mcs.anl.gov> wrote: > Hello everyone, > > I hope this email finds you well. > > My Name is Sawsan Shatanawi, and I am currently working on developing a > Fortran code for simulating groundwater flow in a 3D

Re: [petsc-users] [petsc-maint] DMSwarm on multiple processors

2023-12-20 Thread Matthew Knepley
On Wed, Dec 20, 2023 at 4:12 AM Joauma Marichal < joauma.maric...@uclouvain.be> wrote: > Hello, > > > > I used Address Sanitizer on my laptop and I have no leaks. > > I do have access to another machine (managed by the same people as the > previous one) but I obtain similar errors… > Let me

Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater Flow Simulation Code

2023-12-20 Thread Mark Adams
I am guessing that you are creating a matrix, adding to it, finalizing it ("assembly"), and then adding to it again, which is fine, but you are adding new non-zeros to the sparsity pattern. If this is what you want then you can tell the matrix to let you do that. Otherwise you have a bug. Mark