[petsc-users] SNES and ghosted vector of unknowns

Matthew Knepley knepley at gmail.com
Mon Apr 23 08:41:08 CDT 2012


On Mon, Apr 23, 2012 at 9:28 AM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> On Mon, Apr 23, 2012 at 3:13 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> > On Mon, Apr 23, 2012 at 08:11, Dominik Szczerba <dominik at itis.ethz.ch>
> > wrote:
> >>
> >> What is 'func' on the SNESSetPicard manual page. It only says
> >> "function evaluation routine". What function? Do you mean Ax-b?
> >
> >
> > Just b(x)
> >
> >>
> >>
> >> > All SNESSetPicard does is evaluate both A and b in "residual
> >> > evaluation",
> >> > compute F(x) = A(x)x - b(x), and internally cache the matrix A(x).
> Using
> >> > it
> >> > is completely optional. If you are willing to write residual
> evaluation
> >> > for
> >> > the whole F(x), then you will benefit from having less expensive
> >> > residual
> >> > evaluations, making line searches and matrix-free Newton
> >> > (-snes_mf_operator)
> >> > affordable.
> >>
> >> I understood from the documentation sec. 5.1 and 5.6 that
> >> -snes_mf_operator is not well suited for unstructured problems, rather
> >> for structured problems with known stencil. Is it not so?
> >
> >
> > You must be thinking of coloring.
>
> 5.1.2: "This causes PETSc to approximate the Jacobian using finite
> differencing of the function evaluation (discussed in section 5.6),"
> 5.1.6: "PETSc provides some tools to help approximate the Jacobian
> matrices efficiently via finite differences. (...) The approximation
> requires several steps: (...) Determining the structure
> is problem dependent, but fortunately, for most structured grid
> problems (the class of problems for which
> 111PETSc is designed) if one knows the stencil used for the nonlinear
> function one can usually fairly easily
> obtain an estimate of the location of nonzeros in the matrix. This is
> harder in the unstructured case, and has
> not yet been implemented in general."
>

-snes_mf uses FD to approximate the ACTION of the operator. The above
quotes are talking about using FD to approximate the operator itself.


> I am dealing with unstructured problems. Will I still be able to
> benefit from -snes_mf_operator and will it approximate the Jacobian
> correctly/efficiently in such cases?


-snes_mf_operator allows the user to specify a preconditioner, which is
usually necessary for good convergence.

   Matt


>
> Dominik
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120423/4cc01640/attachment.htm>


More information about the petsc-users mailing list