[petsc-users] SNES and ghosted vector of unknowns

Dominik Szczerba dominik at itis.ethz.ch
Mon Apr 23 08:28:30 CDT 2012


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."

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?

Dominik


More information about the petsc-users mailing list