[petsc-users] snessetjacobian question

Jed Brown jedbrown at mcs.anl.gov
Thu Sep 22 10:40:49 CDT 2011


On Thu, Sep 22, 2011 at 17:27, Milan Mitrovic <milan.v.mitrovic at gmail.com>wrote:

> also... can I change the size of the matrix as well? This can also
> change during the simulation? should I destroy and create a new matrix
> or just resize it, and how?
>

You cannot change the size inside of SNES, but you can change it between
time steps. For that, you should use petsc-3.2 or -dev, call SNESReset()
when the size needs to change, create the new vectors and matrices of the
new size, and set them with SNESSetFunction() and SNESSetJacobian().

Bear in mind that this is new functionality and is not as well tested. An
alternative is to destroy the old SNES and create a new one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110922/dde0cb30/attachment.htm>


More information about the petsc-users mailing list