[petsc-dev] SNESSolve and changing dimensions

Jed Brown jed at jedbrown.org
Wed Apr 3 14:47:38 CDT 2019


Pierre Jolivet via petsc-dev <petsc-dev at mcs.anl.gov> 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 because it would have required fewer lines of code (as I had imagined this to work), that’s the main reason. I understand this is too much to ask of PETSc to continue working without any further information from the application.

SNES wants to be able to connect norms and differences between vectors
at different iterations (e.g., rtol and stol).  I would just loop around
SNESSolve for what you want.  Note that it may be fragile to adapt in
early Newton iterations if globalization is a challenge for your
problem.


More information about the petsc-dev mailing list