[petsc-dev] Separate operators for jacobian and preconditioner matrix on coarse MG levels

Dmitry Karpeyev karpeev at mcs.anl.gov
Tue Mar 3 10:08:16 CST 2015


I've run into this problem in the past, but it never got resolved.
Part of the issue is that there is no clarity on whether DM is "just
geometry" or
"physics as well".  Another view expressed in the past was "one DM-one
Matrix",
so we'd need another DM for the preconditioning matrix.  That quickly gets
unwieldy.

My feeling is that, since these issues haven't gotten resolved up to now,
there is no clean
resolution and the best way forward is the straightforward one that keeps
coming up: allow the
DM to construct two matrices. I think the best way is to add
DMCreateMatrices(DM,Mat*,Mat*)
to the API and fall onto DMCreateMatrix(DM,Mat*) if the former fails to
create any matrices.

Dmitry.


On Mon, Mar 2, 2015 at 5:27 AM Lawrence Mitchell <
lawrence.mitchell at imperial.ac.uk> wrote:

>
> On 24 Feb 2015, at 19:27, Matthew Knepley <knepley at gmail.com> wrote:
>
> > That is what happens. It does check for snes->jacobian, but that would
> not
> > be
> > set on coarse levels anyway. I think we should have an option that makes
> > SNESSetUpMatrices() create two matrices.
>
> In the general case, snes->jacobian and snes->jacobian_pre will have
> different sparsity, but if I just call back to DMCreateMatrix twice I won't
> know which one to make.  One way to fix this would be for DMCreateMatrix to
> have the option of creating two matrices at once:
>
> DMCreateMatrix(dm, Mat *mat, Mat *pmat)
>
> One could then call
>
> DMSetCreateMatricesSeparately(PETSC_TRUE)
>
> (better names much appreciated).
>
> to indicate that one wants separate matrices for the jacobian and its pmat.
>
> Thoughts?
>
> Lawrence
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20150303/4793894b/attachment.html>


More information about the petsc-dev mailing list