Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Kong, Fande
On Mon, Sep 25, 2017 at 12:26 PM, Barry Smith wrote: > > > On Sep 25, 2017, at 1:17 PM, Kong, Fande wrote: > > > > > > > > On Mon, Sep 25, 2017 at 11:41 AM, Barry Smith > wrote: > > > > > On Sep 25, 2017, at 11:22 AM, Kong, Fande wrote: > > > > > > > > > > > > On Mon, Sep 25, 2017 at 10:05 AM,

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Barry Smith
> On Sep 25, 2017, at 1:17 PM, Kong, Fande wrote: > > > > On Mon, Sep 25, 2017 at 11:41 AM, Barry Smith wrote: > > > On Sep 25, 2017, at 11:22 AM, Kong, Fande wrote: > > > > > > > > On Mon, Sep 25, 2017 at 10:05 AM, Stefano Zampini > > wrote: > > If you know the union of the different spa

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Kong, Fande
On Mon, Sep 25, 2017 at 11:41 AM, Barry Smith wrote: > > > On Sep 25, 2017, at 11:22 AM, Kong, Fande wrote: > > > > > > > > On Mon, Sep 25, 2017 at 10:05 AM, Stefano Zampini < > stefano.zamp...@gmail.com> wrote: > > If you know the union of the different sparsity patterns, after you > preallocat

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Barry Smith
> On Sep 25, 2017, at 11:22 AM, Kong, Fande wrote: > > > > On Mon, Sep 25, 2017 at 10:05 AM, Stefano Zampini > wrote: > If you know the union of the different sparsity patterns, after you > preallocate you can set all zeros to use all the entries. This way PETSc will > not complain about n

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Kong, Fande
On Mon, Sep 25, 2017 at 10:05 AM, Stefano Zampini wrote: > If you know the union of the different sparsity patterns, after you > preallocate you can set all zeros to use all the entries. This way PETSc > will not complain about new nonzeros in successive assemblies. > > Thanks, Stefano, Yes, we

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Stefano Zampini
If you know the union of the different sparsity patterns, after you preallocate you can set all zeros to use all the entries. This way PETSc will not complain about new nonzeros in successive assemblies. Il 25 Set 2017 7:01 PM, "Kong, Fande" ha scritto: > Hi Matt, > > Thanks for your reply. > >

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Kong, Fande
Hi Matt, Thanks for your reply. The sparsity pattern is slightly different from one Newton iteration to another. We preallocate enough memory at the beginning, and want to use that memory for the following iterations. Does PETSc accutally free the preallocated (extra) memory? I so cannot use it

Re: [petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Matthew Knepley
On Mon, Sep 25, 2017 at 11:39 AM, Kong, Fande wrote: > Hi All, > > A matrix is created with the right preallocation, and then MatAssembly is > called. The preallocation info will be removed. We insert any values then, > and will encounter an malloc error. > > My question is that we was intending

[petsc-dev] MatAssembly removes all preallocation info

2017-09-25 Thread Kong, Fande
Hi All, A matrix is created with the right preallocation, and then MatAssembly is called. The preallocation info will be removed. We insert any values then, and will encounter an malloc error. My question is that we was intending to design like this way? Attached simple example demonstrates what

[petsc-dev] DMCoarsenHookAdd in SNESSetUpMatrices

2017-09-25 Thread Stefano Zampini
Jed, Today I fought for several hours against a strange behaviour occuring when reusing a TS for multiple solves. You can reproduce it by applying the attached patch. The issue is with DMCoarsenHookAdd called in SNESSetUpMatrices, and git blames you ;-). Every time you call TSGetRHSMats_Private,

Re: [petsc-dev] What is the difference between shift and target in SLEPc ?

2017-09-25 Thread Jose E. Roman
Yes. > El 25 sept 2017, a las 15:37, Franck Houssen > escribió: > > OK, thanks, this is helpful. > > If I got you correctly: beforehand, there is no way to know exactly what the > eigen values are. If it turns out that an eigen value makes A-sigma*I or > A-sigma*B singular, then the solve m

Re: [petsc-dev] What is the difference between shift and target in SLEPc ?

2017-09-25 Thread Franck Houssen
OK, thanks, this is helpful. If I got you correctly: beforehand, there is no way to know exactly what the eigen values are. If it turns out that an eigen value makes A-sigma*I or A-sigma*B singular, then the solve may break. If so, afterwards, it's possible to change slightly the shift to avoid

Re: [petsc-dev] What is the difference between shift and target in SLEPc ?

2017-09-25 Thread Jose E. Roman
> El 25 sept 2017, a las 13:21, Franck Houssen > escribió: > > What is the difference between shift and target in SLEPc ? Shift (STSetShift) > is clear to me, but, target (EPSSetTarget) is not. > Can somebody give an example where one want/need to have a target which would > be different from

[petsc-dev] What is the difference between shift and target in SLEPc ?

2017-09-25 Thread Franck Houssen
What is the difference between shift and target in SLEPc ? Shift (STSetShift) is clear to me, but, target (EPSSetTarget) is not. Can somebody give an example where one want/need to have a target which would be different from the shift ? Franck

Re: [petsc-dev] (no subject)

2017-09-25 Thread Jakub Kruzik
Thank you, Barry. We really appreciate it. Jakub On 23.9.2017 16:52, Barry Smith wrote: Jakub, This is great, thanks for the information. I've added links from the PETSc main webpage to your work. Barry On Sep 23, 2017, at 9:26 AM, Jakub Kruzik wrote: Dear all, I would j

Re: [petsc-dev] PetscSF in Fortran

2017-09-25 Thread Matthew Knepley
On Sun, Sep 24, 2017 at 8:57 PM, Adrian Croucher wrote: > > > On 25/09/17 13:37, Adrian Croucher wrote: > >> >> Actually it looks like DMGetDefaultSF() does already work in Fortran >> though, and could be used to do the same thing. >> >> Do you think that would be a reasonable way to do it? >> >>