[petsc-users] SNESSetUpdate function

Bernardo Rocha bernardomartinsrocha at gmail.com
Fri Jan 20 09:21:14 CST 2012


I have a C++ class that solves a nonlinear problem using PETSC's KSP
without using SNES.
Now I'm trying to make use of SNES.

I created some functions to form the Function and Jacobian, just like the
example (snes/examples/tutorials/ex1.c). I'm solving a nonlinear mechanics
problem. When I have some prescribed displacements (fixed dofs) I do not
assemble the whole system, so when SNES starts solving the linear systems
the solution vector *u* contains only some part of the displacement, the
other were already imposed in my vector *x*. So I need to implement a
different Update function that considers if a degree of freedom is fixed or
not, in order to update *x *to continue the nonlinear iteration.

That's why I think I need to do this. Is it clear?

On Fri, Jan 20, 2012 at 12:55 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Fri, Jan 20, 2012 at 08:28, Bernardo Rocha <
> bernardomartinsrocha at gmail.com> wrote:
>
>> I'm using SNES but I would like to update my data after each successful
>> step computation within the nonlinear solver using a different function. I
>> mean, after the solution of each linear system I would like to get \Delta
>> x_k to update x_{k+1} which is stored somewhere in my application class
>> (C++ code).
>
>
> Can you explain more about what you are trying to do? What you describe
> does not sound algorithmically correct.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120120/3a15d833/attachment-0001.htm>


More information about the petsc-users mailing list