[petsc-users] DMs not transferred into PCCOMPOSITE?

Lawrence Mitchell lawrence.mitchell at imperial.ac.uk
Mon Jun 8 04:31:05 CDT 2015


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

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


More information about the petsc-users mailing list