<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 28, 2017 at 11:48 AM, 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><div>Dear Matt, <br></div>Sorry for my (very) late reply.<br></div>I was not able to find the Fortran interface of DMSellSetCreateFieldDecomposit<wbr>ion in the late petsc-3.7.6 fortran (and my code still fails to link).<br></div><div>I have the feeling that it is missing in the master branch. <br></div><div>And I was not able to get it on bitbucket either.<br></div><div>Is there a branch from which I can pull your commit ? <br></div></div></blockquote><div><br></div><div>I would either:</div><div><br></div><div> a) Use the 'next' branch</div><div><br></div><div>or</div><div><br></div><div> b) wait until Monday for me to merge to 'master'</div><div><br></div><div>This merge has been held up, but can now go forward.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>Thans a lot for your help,<br></div><div>Natacha <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 9:25 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 class="gmail_extra"><div class="gmail_quote"><span>On Wed, Mar 22, 2017 at 1:45 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>Hello Matt,<br>Thanks a lot for your answers.<br>Since I am working on a large FEM Fortran code, I have to stick to Fortran. <br>Do you know if someone plans to add this Fortran interface? Or may be I could do it myself ? Is this particular interface very hard to add ? Perhaps could I mimic some other interface ? <br></div>What would you advise ? <br></div></div></blockquote><div><br></div></span><div>I have added the interface in branch knepley/feature-fortran-compos<wbr>e. I also put this in the 'next' branch. It</div><div>should make it to master soon. There is a test in sys/examples/tests/ex13f</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><div class="m_8818164300797830930h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div></div><div>Best regards, <br></div><div>Natacha <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 22, 2017 at 12:33 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 class="gmail_extra"><div class="gmail_quote"><span>On Wed, Mar 22, 2017 at 10:03 AM, Natacha BEREUX <span dir="ltr"><<a href="mailto:natacha.bereux@gmail.com" target="_blank">natacha.bereux@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span><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 ( DMShellSetCreateFieldDecomposi<wbr>tion)<br></div><div>- then sets the DM in KSP context (KSPSetDM) <br></div><div><br>I have some more questions<br></div></span><div>- I did not succeed in setting my own CreateFieldDecomposition in the DMShell : link fails with " unknown reference to « dmshellsetcreatefielddecomposi<wbr>tion_ ». Could it be a Fortran problem (I am using Fortran)? Is this routine available in PETSc Fortran interface ? \<br></div></div></div></blockquote><div><br></div><div>Yes, exactly. The Fortran interface for passing function pointers is complex, and no one has added this function yet.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></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></div></blockquote><div><br></div></span><div>Yes.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div></div><div>- do I have to provide something else to define the DMShell ? </div></div></div></blockquote><div><br></div></span><div>I think you will have to return local and global vectors, but this just means creating a vector of the correct size and distribution.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><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="m_8818164300797830930m_-729358992369511859m_8620031474737227169m_-2339884579145930966m_1636615910716569320HOEnZb"><div class="m_8818164300797830930m_-729358992369511859m_8620031474737227169m_-2339884579145930966m_1636615910716569320h5"><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.ac<wbr>.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_8818164300797830930m_-729358992369511859m_8620031474737227169m_-2339884579145930966m_1636615910716569320m_8134331278265269218HOEnZb"><font color="#888888"><br>
Lawrence</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></span></div><br><br clear="all"><span class="HOEnZb"><font color="#888888"><span class="m_8818164300797830930m_-729358992369511859HOEnZb"><font color="#888888"><span><div><br></div>-- <br><div class="m_8818164300797830930m_-729358992369511859m_8620031474737227169m_-2339884579145930966gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</span></font></span></font></span></div></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">
</font></span></blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><div><div class="m_8818164300797830930h5"><br><br clear="all"><div><br></div>-- <br><div class="m_8818164300797830930m_-729358992369511859gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>