<div dir="ltr"><div><div>Hello,  <br>if my understanding is correct, the approach proposed by Matt and Lawrence is the following :<br></div><div>- create a DMShell (DMShellCreate)<br></div><div>- define my own CreateFieldDecomposition to return the index sets I need (for displacement, pressure and temperature degrees of freedom) : myCreateFieldDecomposition(... )<br></div><div>- set it in the DMShell ( DMShellSetCreateFieldDecomposition)<br></div><div>- then sets  the DM in KSP context  (KSPSetDM) <br></div><div><br>I  have some more questions<br></div><div>- I did not succeed in setting my own CreateFieldDecomposition in the DMShell : link  fails with " unknown reference to « dmshellsetcreatefielddecomposition_ ». Could it be a Fortran problem (I am using Fortran)?  Is this routine available in PETSc  Fortran interface ? <br></div><div>- CreateFieldDecomposition is supposed to return an array of dms (to define the fields). I am not able to return such datas.  Do I return a  PETSC_NULL_OBJECT instead ? <br></div><div>- do I have to provide something else to define the DMShell ? <br></div><br></div><div>Thanks a lot for your help <br></div><div>Natacha <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 2:44 PM, Natacha BEREUX <span dir="ltr"><<a href="mailto:natacha.bereux@gmail.com" target="_blank">natacha.bereux@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks for your quick answers. To be honest, I am not familiar at all with DMShells and DMPlexes. But since it is what I need, I am going to try it. <br></div>Thanks again  for your advices,<br></div>Natacha <br> </div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 2:27 PM, Lawrence Mitchell <span dir="ltr"><<a href="mailto:lawrence.mitchell@imperial.ac.uk" target="_blank">lawrence.mitchell@imperial.<wbr>ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
> On 21 Mar 2017, at 13:24, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
><br>
> I think the remedy is as easy as specifying a DMShell that has a PetscSection (DMSetDefaultSection) with your ordering, and<br>
> I think this is how Firedrake (<a href="http://www.firedrakeproject.org/" rel="noreferrer" target="_blank">http://www.firedrakeproject.o<wbr>rg/</a>) does it.<br>
<br>
</span>We actually don't use a section, but we do provide DMCreateFieldDecomposition_She<wbr>ll.<br>
<br>
If you have a section that describes all the fields, then I think if the DMShell knows about it, you effectively get the same behaviour as DMPlex (which does the decomposition in the same manner?).<br>
<span><br>
> However, I usually use a DMPlex which knows about my<br>
> mesh, so I am not sure if this strategy has any holes.<br>
<br>
</span>I haven't noticed anything yet.<br>
<span class="m_8134331278265269218HOEnZb"><font color="#888888"><br>
Lawrence</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>