<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Hello,<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I can't get a a simple code to work for DMPlexGetCone.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">I have tried different ways of handling the array/pointer which is the third argument of DMPlexGetCone, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">but neither of them worked for me.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">The last version that I got compiling is this one, which is very much based on the</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">following example: .../petsc-3.7.6/src/dm/impls/plex/examples/tutorials/ex1f90.F</div><div class="gmail_default"><div class="gmail_default"><br></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> PetscInt, target, dimension(6) :: icone</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"> PetscInt, pointer :: pIcone(:)</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><div class="gmail_default"><br></div><div class="gmail_default"> call DMPlexCreateFromCellList(PETSC_COMM_WORLD,</div><div class="gmail_default"> & ndim,numel,numnp,nen,PETSC_TRUE,</div><div class="gmail_default"> & ielement,ndim,xnodes,dm,ierr)</div><div class="gmail_default"> ...<br></div><div class="gmail_default"> call DMPlexGetCone(dm,0,pIcone,ierr) <br></div></font></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><div class="gmail_default"> write(*,*) icone(1),icone(2),icone(3),icone(4),icone(5),icone(6)</div><div class="gmail_default"> call DMPlexRestoreCone(dm,0,pIcone,ierr)</div><div class="gmail_default"><br></div><div class="gmail_default">I always get a segmentation fault.</div><div class="gmail_default"><br></div><div class="gmail_default">I've created a simple cuboid mesh with 2x2x2 hexaedral elements.</div><div class="gmail_default">Many other routines are working and give reasonable results.</div><div class="gmail_default"><br></div><div class="gmail_default">Output of DMView</div><div class="gmail_default"><br></div><div class="gmail_default"><div class="gmail_default">DM Object: 1 MPI processes</div><div class="gmail_default"> type: plex</div><div class="gmail_default">DM_0x84000000_0 in 3 dimensions:</div><div class="gmail_default"> 0-cells: 27</div><div class="gmail_default"> 1-cells: 66</div><div class="gmail_default"> 2-cells: 44</div><div class="gmail_default"> 3-cells: 8</div><div class="gmail_default">Labels:</div><div class="gmail_default"> depth: 4 strata of sizes (27, 66, 44, 8)</div><div class="gmail_default"><br></div><div class="gmail_default"><br></div><div class="gmail_default"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 10:57 PM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">OK, thanks a lot.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I had to rename the files and add -ffixed-form as argument to the compiler.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Best regards,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Bernardo</div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 5, 2018 at 8:21 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Apr 5, 2018 at 7:16 PM, Bernardo Rocha <span dir="ltr"><<a href="mailto:bernardomartinsrocha@gmail.com" target="_blank">bernardomartinsrocha@gmail.co<wbr>m</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Hello everyone,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I've been trying to use DMPlex in a Fortran 77 application</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">(unfortunately this is legacy code and I can't move to F90).</div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Is there a way to use DMPlexGetCone on it?</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Although the documentation online says it is only available for F90,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">I'm wondering if there is a trick like the ones in the users manual for routines </div><div style="font-family:arial,helvetica,sans-serif;font-size:small">that return an array. I tried, but I'm not sure it it is right.</div></div></blockquote><div><br></div></span><div>We have standardized our array handling with F90, and I don't think we will go back</div><div>to supporting new things for F77-style arrays.</div><div><br></div><div>That being said, I think all you have to do is compile that source with an F90 compiler. You</div><div>should not have to change anything. If you want the F90 array to look like an F77 array,</div><div>just pass it as a function argument (I think this works).</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Best regards,</div><div style="font-family:arial,helvetica,sans-serif;font-size:small">Bernardo M. Rocha</div></div></blockquote></span></div><span class="gmail-m_-7110851433796089765HOEnZb"><font color="#888888">-- <br><div class="gmail-m_-7110851433796089765m_-5540964522862930894gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~k<wbr>nepley/</a><br></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>