[petsc-users] Memory leak in snesnpc ?

2020-08-18 Thread Adolfo Rodriguez
I am suspecting that there is a memory leak in the implementation of non-linear preconditioners in PETSc. When I use the following options I see the memory usage increase (using the windows process monitor) during consecutive time steps. PetscOptionsSetValue(NULL, "-snes_type", "qn"); PetscOpti

[petsc-users] Overhead in snes function calls

2020-09-17 Thread Adolfo Rodriguez
I am porting a non-linear solution problem implemented explicitly to an snes implementation. Everything seems to be working fine, except for the fact that function calls done from snes to my jacobian and residual construction subroutines are slower than the regular direct call to the same subroutin

Re: [petsc-users] Overhead in snes function calls

2020-09-17 Thread Adolfo Rodriguez
dtime = x seconds, while if I make the same call inside FormJacobian I get dtime ~ x + 0.08 seconds. I hope the explanation is clear. Any clue? Adolfo On Thu, Sep 17, 2020 at 12:05 PM Matthew Knepley wrote: > On Thu, Sep 17, 2020 at 12:00 PM Adolfo Rodriguez > wrote: > >>

Re: [petsc-users] Overhead in snes function calls

2020-09-17 Thread Adolfo Rodriguez
Disregard this thread. I think the problem has to do with my data structure. Thanks! On Thu, Sep 17, 2020 at 12:55 PM Adolfo Rodriguez wrote: > Sorry I was not clear before. > > I have to call some functions in order to assemble the Jacobian. I created > a FormJacobian function

[petsc-users] Problems with MKL?

2020-03-05 Thread Adolfo Rodriguez
I am experiencing a very stubborn issue, apparently related to an MKL issue. I am solving a linear system using ksp which works well on windows. I am trying to port this program to Linux now but I have been getting an error coming from the solver (the matrix, right-hand side, and initial solution v

Re: [petsc-users] Problems with MKL?

2020-03-05 Thread Adolfo Rodriguez
x27;t see MKL in configure options here - so likely system > blas/lapack is used.. > > Satish > > On Thu, 5 Mar 2020, Adolfo Rodriguez wrote: > > > I am experiencing a very stubborn issue, apparently related to an MKL > > issue. I am solving a linear system using ksp whi

[petsc-users] error destroying solver context

2020-03-11 Thread Adolfo Rodriguez
I have a situation with a c++ code where I get an error when destroying the solver context after destroying the matrix. I have the following lines at the end of my function KSPDestroy(&ksp); MatDestroy(&A); PetscObjectDestroy((PetscObject*)&x); PetscObjectDestroy((PetscObject*)&b); It is a very s

[petsc-users] snes setjacobian with csr sparse matrix

2020-07-20 Thread Adolfo Rodriguez
I am trying to use PETSc to solve a non-linear problem. The problem I am facing is that I already have the Jacobian matrix formed in CSR format. Now I am trying to define a function FormJacobian which takes this preexisting matrix and writes it in PETSc format. For a small problem, I can use MatSet

Re: [petsc-users] snes setjacobian with csr sparse matrix

2020-07-21 Thread Adolfo Rodriguez
tscInt[],const PetscScalar[]); > PETSC_EXTERN PetscErrorCode > MatMPISBAIJSetPreallocationCSR(Mat,PetscInt,const PetscInt[],const > PetscInt[],const PetscScalar[]); > > > > > On Jul 20, 2020, at 7:38 AM, Adolfo Rodriguez wrote: > > > > I am trying to use PETSc to

[petsc-users] Matrix assembly in SNES problem

2020-07-22 Thread Adolfo Rodriguez
I am trying to replace the non-linear solver in a flow simulation problem where the matrix sparsity can change during the iterations. I tried successfully to create the matrix within the FormJacobian function but I have a memory leak which I don't know how to fix. My FormJacobian function is somet

Re: [petsc-users] Matrix assembly in SNES problem

2020-07-22 Thread Adolfo Rodriguez
eStep. Hopefully, this clarifies my question a little bit. Adolfo On Wed, Jul 22, 2020 at 7:45 AM Mark Adams wrote: > > > On Wed, Jul 22, 2020 at 8:05 AM Adolfo Rodriguez > wrote: > >> I am trying to replace the non-linear solver in a flow simulation problem >> wher

Re: [petsc-users] Matrix assembly in SNES problem

2020-07-22 Thread Adolfo Rodriguez
Hong, Thanks for your email. My question now is how to handle situations where the matrix structure changes during the iteration process? Adolfo On Wed, Jul 22, 2020 at 8:32 AM Zhang, Hong wrote: > > > > On Jul 22, 2020, at 7:03 AM, Adolfo Rodriguez wrote: > > > > I

[petsc-users] Test convergence with non linear preconditioners

2020-08-05 Thread Adolfo Rodriguez
I am trying to use non-linear preconditioners in a very similar way shown in the paper "Composing scalable nonlinear solvers" by Peter Brune and others. My question is simple, actually. I have provided a test convergence function, but it seems that the inner method does not take it into account an

Re: [petsc-users] Test convergence with non linear preconditioners

2020-08-05 Thread Adolfo Rodriguez
ebmail&utm_term=icon> Virus-free. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Wed, Aug 5, 2020 at 2:18 PM Jed Brown wrote: &g

Re: [petsc-users] Test convergence with non linear preconditioners

2020-08-05 Thread Adolfo Rodriguez
0BB-A1B8-4E2AA1F9FDF2> On Wed, Aug 5, 2020 at 3:11 PM Jed Brown wrote: > Adolfo Rodriguez writes: > > > Actually I can set the non-linear pc. My problem relates to the > convergence > > test. I have not found a way to set the tolerances for the inner problem, > > are they ha

Re: [petsc-users] Test convergence with non linear preconditioners

2020-08-05 Thread Adolfo Rodriguez
set tolerances with > -npc_snes_rtol -npc_ksp_rtol etc. From the program you can > use SNESGetNPC() and then call SNESSetXXX() to set options, for the linear > solver (if there is one) call SNESGetKSP() on the npc and then set options > on that KSP. > > >Barry > > &g

Re: [petsc-users] Test convergence with non linear preconditioners

2020-08-06 Thread Adolfo Rodriguez
t; You should be able to run with -snes_view and change some of the > criteria on the command line and see the changes presented in the > -snes_view output, plus see differences in convergence behavior. > > > > Barry > > > > On Aug 5, 2020, at 8:10 PM, Adolfo Rodr

Re: [petsc-users] Test convergence with non linear preconditioners

2020-08-07 Thread Adolfo Rodriguez
m_content=webmail&utm_term=link> <#m_-242385451441738719_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Thu, Aug 6, 2020 at 9:23 PM Matthew Knepley wrote: > On Thu, Aug 6, 2020 at 10:08 PM Adolfo Rodriguez > wrote: > >> Considering the output produced by snes_view (attachment), wo

[petsc-users] Composite preconditioners in petsc4py

2023-01-30 Thread Adolfo Rodriguez
Hi, how do you use composite preconditioners in petsc4py. I used to have a script that worked but it does not work anymore. Something has changed. Any simple examples? Regards, Adolfo

Re: [petsc-users] Composite preconditioners in petsc4py

2023-01-31 Thread Adolfo Rodriguez
Matthew, Yes, exactly: PCCOMPOSITR. Get Outlook for iOS<https://aka.ms/o0ukef> From: Matthew Knepley Sent: Tuesday, January 31, 2023 6:55:29 AM To: Adolfo Rodriguez Cc: petsc-users Subject: Re: [petsc-users] Composite preconditioners in petsc4py On Mo