[petsc-users] DMs not transferred into PCCOMPOSITE?

Matthew Knepley knepley at gmail.com
Mon Jun 8 06:06:54 CDT 2015


On Mon, Jun 8, 2015 at 4:31 AM, Lawrence Mitchell <
lawrence.mitchell at imperial.ac.uk> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> I have a multi-field system where the splits are defined by a DM.  I
> can use a fieldsplit PC on its own with no trouble, but cannot do so
> inside a composite PC.  My matrices do not have a blocksize set
> (because the data layout doesn't match) and hence the automagic case
> (when the pc doesn't have a DM) fails.
>
> It looks like this is just a case of the outer DM not being
> transferred into the sub PCs.  Is there a good reason for this, or is
> it just an oversight?  If I apply the following patch then things
> appear to work
>

This looks like an oversight to me. I can integrate it.

  Matt


> Cheers,
>
> Lawrence
>
>
> diff --git a/src/ksp/pc/impls/composite/composite.c
> b/src/ksp/pc/impls/composite/composite.c
> index 016d195..bf158cc 100644
> - --- a/src/ksp/pc/impls/composite/composite.c
> +++ b/src/ksp/pc/impls/composite/composite.c
> @@ -170,2 +170,3 @@ static PetscErrorCode PCSetUp_Composite(PC pc)
>    PC_CompositeLink next = jac->head;
> +  DM               dm;
>
> @@ -175,4 +176,6 @@ static PetscErrorCode PCSetUp_Composite(PC pc)
>    }
> +  ierr = PCGetDM(pc,&dm);CHKERRQ(ierr);
>    while (next) {
>      ierr = PCSetOperators(next->pc,pc->mat,pc->pmat);CHKERRQ(ierr);
> +    ierr = PCSetDM(next->pc,dm);CHKERRQ(ierr);
>      next = next->next;
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJVdWDUAAoJECOc1kQ8PEYvqdEIAOk3UpOyJaXszcLXEfEc4Cf0
> /JAbnCahZ9l4IGe8d9Iinvf+8yKu2DAIbdeBPg20CexYGoqpbMa1ljGk+rz5oc/h
> yBGzNjd6Vp+0uAqn2dhLAm7R17A3yKOMk+WdS5sVSWmGBUUHK7y/pkssEjM0PN4b
> pKIGcYIHAADY7494AIaKGAjJHzBcbGFVaBpeeiGU64FhrV4dlq78jP63GRDrLFvK
> 22PzzT2NF1JyYumLTaPEHecpbm9ykhCnU+TSfTRC66WZCIjUfuuSarH4Z/HOuVbv
> GjpelCT4JdoDV6w8bwo3t40BnlEi7RsAyk8q+sIyw0D6l1qnGIWZuyxsPWRTzxM=
> =jK7M
> -----END PGP SIGNATURE-----
>



-- 
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/20150608/5439bffe/attachment.html>


More information about the petsc-users mailing list