Re: [petsc-dev] DMDA VTK viewer regression: field names missing

2019-04-03 Thread Jed Brown via petsc-dev
Patrick Sanan via petsc-dev writes: > I was going to say something similar to Matt; to me it is worth the 1.5x > redundancy in the data if I can just view the output file with "doing > anything special". I have also done something similar to what you're > describing with save states, and it

Re: [petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Smith, Barry F. via petsc-dev
Pierre, You may be able to use SNESReset() instead of calling SNESDestroy() and creating a new SNES for each change in problem dimension; but you will still need to write an "outer loop" that calls SNESSolve() repeatedly and decides whether you should change the problem size. Note that

Re: [petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Mark Adams via petsc-dev
I agree that you want to adapt around a converged solution. I have code that runs time step(s), adapts, Transfers solutions and state, creates a new TS & SNES, if you want to clone that. It works with PForest, but Toby and Matt are working on these abstractions so it might not be the most

Re: [petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Jed Brown via petsc-dev
Pierre Jolivet via petsc-dev writes: > I am just adapting the mesh depending on the solution from the previous > SNESSolve. > At first, I wanted to avoid writing an outer loop around the SNESSolve, so I > thought, let’s put the adaptation in the SNESSetJacobian. > It would have been preferable

Re: [petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Pierre Jolivet via petsc-dev
> On 3 Apr 2019, at 3:40 PM, Matthew Knepley wrote: > > On Wed, Apr 3, 2019 at 9:31 AM Pierre Jolivet > wrote: >> On 3 Apr 2019, at 3:15 PM, Stefano Zampini > > wrote: >> >> Pierre, >> >> using MatHeaderReplace should be

Re: [petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Pierre Jolivet via petsc-dev
> On 3 Apr 2019, at 3:15 PM, Stefano Zampini wrote: > > Pierre, > > using MatHeaderReplace should be discouraged in a SNES/TS callback ;-) Gotcha! > I coded this way to have the possibility of changing the MatType while > running SNES or TS, not for variable sizes. > > A tricky way of

[petsc-dev] SNESSolve and changing dimensions

2019-04-03 Thread Pierre Jolivet via petsc-dev
I’d like to do mesh adaptation in a Newton loop. I’m using a SNES with SNESSetFunction and SNESSetJacobian. My first question is: may the dimension of the linear systems change throughout the nonlinear iterations? If so, what are the proper things to do? I tried to do as Stefano in MFEM and use