[petsc-users] MG on fieldsplit

Jed Brown jedbrown at mcs.anl.gov
Thu Feb 2 08:23:53 CST 2012


On Thu, Feb 2, 2012 at 13:03, gouarin <loic.gouarin at math.u-psud.fr> wrote:

> It seems that I have forgotten to initialize DMSetInitialGuess,
> DMSetFunction, DMSetJacobian.
>
> I don't understand what is the best way to use 4Q1-Q1 elements for the
> Stokes problem:
>

src/ksp/ksp/examples/tutorials/ex43.c (2D) and ex42.c (3D) use these
elements for variable-viscosity Stokes.


>
> - Construct the matrices for each DM in the DMComposite
> - Construct the global matrix and the global preconditioner
> - Use MatNest
>

DMComposite can allocate for AIJ or Nest. Just set the matrix type, e.g.
-dm_mat_type nest, ex28.c does this (see runex28_3).

But preallocation for off-diagonal blocks (of MatNest or AIJ) is still
messy and I haven't figured out a good API other than to write an efficient
dynamic preallocation to make it unnecessary. A lot of users like
Jacobian-free Newton-Krylov with the true Jacobian applied by finite
differencing (-snes_mf_operator) in which case the current code is fine
because we only assemble diagonal blocks.


>
> There are a lot of possibilities with PETSc with new add-ons and it is
> difficult to find our way with only the documentation.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120202/590e9f8a/attachment.htm>


More information about the petsc-users mailing list