Re: [petsc-users] [KSP] PETSc not reporting a KSP fail when true residual is NaN

2022-04-01 Thread Giovane Avancini via petsc-users
Thanks a lot. If you need more information and/or my code again, please let me know. Em sex., 1 de abr. de 2022 às 19:27, Barry Smith escreveu: > > I'll take a look at it this weekend. The computed preconditioned > residual norm is a real number so I am not sure where PETSc will be able to >

Re: [petsc-users] [KSP] PETSc not reporting a KSP fail when true residual is NaN

2022-04-01 Thread Barry Smith
I'll take a look at it this weekend. The computed preconditioned residual norm is a real number so I am not sure where PETSc will be able to detect the problem appropriately before it is too late. > On Apr 1, 2022, at 6:14 PM, Giovane Avancini wrote: > > Hi Barry, it's me again. > >

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Samuel Estes
Ok thanks! I think I understand now. On Fri, Apr 1, 2022 at 12:44 PM Matthew Knepley wrote: > On Fri, Apr 1, 2022 at 1:08 PM Samuel Estes > wrote: > >> Thank you for all the help. I think I'm mostly clear now. >> >> I think my only remaining question relates to point 1: >> So let's call the

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 1:08 PM Samuel Estes wrote: > Thank you for all the help. I think I'm mostly clear now. > > I think my only remaining question relates to point 1: > So let's call the global matrix across all processors A and let's say it's > a square matrix of size n. Then each processor

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Samuel Estes
Thank you for all the help. I think I'm mostly clear now. I think my only remaining question relates to point 1: So let's call the global matrix across all processors A and let's say it's a square matrix of size n. Then each processor has a subset of the rows of A so that there's in principle a

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Jacob Faibussowitsch
What is the signature of `integrate_adaptive()`? As Matt points out you may be copying the pointer somewhere, maybe `integrate_adaptive()` is copy-constructing its `local_calculator` argument (and hence its `local_vector`)? Best regards, Jacob Faibussowitsch (Jacob Fai - booss - oh - vitch)

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 12:57 PM Samuel Estes wrote: > Ah, so let me see if I understand this now. So basically you preallocate > for this "dummy matrix" of type MatPreallocator. But rather than simply > calling MatXXXAIJSetPreallocation() to allocate space, you actually tell > this "dummy

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Samuel Estes
Ah, so let me see if I understand this now. So basically you preallocate for this "dummy matrix" of type MatPreallocator. But rather than simply calling MatXXXAIJSetPreallocation() to allocate space, you actually tell this "dummy matrix" exactly where the non-zeros will be. You then call this

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 12:45 PM Samuel Estes wrote: > Thanks! This seems like it might be what I need. I'm still a little > unclear on how it works though? My problem is basically that for any given > row, I know the total non-zeros but not how many occur in the diagonal vs > off-diagonal.

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Samuel Estes
Thanks! This seems like it might be what I need. I'm still a little unclear on how it works though? My problem is basically that for any given row, I know the total non-zeros but not how many occur in the diagonal vs off-diagonal. Without knowledge of the underlying grid, I'm not sure how there

Re: [petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 12:27 PM Samuel Estes wrote: > Hi, > > I have a problem in which I know (roughly) the number of non-zero entries > for each row of a matrix but I don't have a convenient way of determining > whether they belong to the diagonal or off-diagonal part of the parallel > matrix.

[petsc-users] Allocating the diagonal for MatMPIAIJSetPreallocation

2022-04-01 Thread Samuel Estes
Hi, I have a problem in which I know (roughly) the number of non-zero entries for each row of a matrix but I don't have a convenient way of determining whether they belong to the diagonal or off-diagonal part of the parallel matrix. Is there some way I can just allocate the total number of

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Barry Smith
I don't know why valgrind is not putting in line numbers but something is clearly very wrong with data structure initialization. I am not sure if it is really directly related to PETSc but somehow comes about in the C++ constructor business, which seems simple enough in your code but I don't

[petsc-users] Local refinements of tetrahedron elements

2022-04-01 Thread Ce Qin
Dear all, I want to implement the adaptive finite element method using the DMPlex interface. So I would like to know whether DMPlex supports local (also hierarchical) refinements of tetrahedron elements. I found that there is an adaptation method called SBR, but it seems that it only supports

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Barry Smith
I recommend first running with valgrind. I tried to build your code but got compile errors from arma:: being unknown. Where does it come from? Is it only in a super new version of Boost? > On Apr 1, 2022, at 6:50 AM, Roland Richter wrote: > > I re-run my code with a debug version of

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 7:22 AM Roland Richter wrote: > In my destructor I have the following phrase: > > * if(local_vec != PETSC_NULL) {* > *PetscInt vecSize = 0;* > *PetscErrorCode ierr;* > *std::cerr << local_vec <<

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Roland Richter
In my destructor I have the following phrase: /       if(local_vec != PETSC_NULL) {// //               PetscInt vecSize = 0;// //               PetscErrorCode ierr;// //               std::cerr << local_vec << '\n';// //               ierr = VecGetSize(local_vec,

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Matthew Knepley
On Fri, Apr 1, 2022 at 6:50 AM Roland Richter wrote: > I re-run my code with a debug version of PETSc, resulting in > > [0]PETSC ERROR: - Error Message > -- > [0]PETSC ERROR: Corrupt argument:

Re: [petsc-users] Memory leak when combining PETSc-based vectors and boost::odeint

2022-04-01 Thread Roland Richter
I re-run my code with a debug version of PETSc, resulting in [0]PETSC ERROR: - Error Message -- [0]PETSC ERROR: Corrupt argument: https://petsc.org/release/faq/#valgrind [0]PETSC ERROR: Object already free: Parameter