<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 23, 2017 at 11:15 AM, Vaclav Hapla <span dir="ltr"><<a href="mailto:vaclav.hapla@erdw.ethz.ch" target="_blank">vaclav.hapla@erdw.ethz.ch</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">Hello<br>
<br>
The DMPlex example src/dm/impls/plex/examples/<wbr>tests/ex18.c fails with  -cell_simplex 0 :<br>
<br>
[0]PETSC ERROR: Null argument, when expecting valid pointer<br>
[0]PETSC ERROR: Null Object: Parameter # 1<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Development GIT revision: v3.8.2-360-gb71d430  GIT Date: 2017-11-23 09:02:30 -0600<br>
[0]PETSC ERROR: ./ex18 on a arch-linux-gcc-salvus named salvus-vm by haplav Thu Nov 23 17:03:16 2017<br>
[0]PETSC ERROR: Configure options --download-chaco --download-exodusii --download-hdf5 --download-med --download-metis --download-netcdf --download-parmetis --download-ptscotch --download-triangle --download-ctetgen --with-cc=mpicc --with-cxx=mpicxx --with-eigen-dir=/usr --with-fc=mpifort --with-python=1 --with-shared-libraries=1 --with-valgrind-dir=/opt/<wbr>valgrind/valgrind-3.13 PETSC_ARCH=arch-linux-gcc-<wbr>salvus<br>
[0]PETSC ERROR: #1 DMGetDimension() line 4048 in /scratch/petsc-dev/src/dm/<wbr>interface/dm.c<br>
[0]PETSC ERROR: #2 DMPlexCreateFromDAG() line 2704 in /scratch/petsc-dev/src/dm/<wbr>impls/plex/plexcreate.c<br>
[0]PETSC ERROR: #3 CreateQuad_2D() line 302 in /scratch/petsc-dev/src/dm/<wbr>impls/plex/examples/tests/<wbr>ex18.c<br>
[0]PETSC ERROR: #4 CreateMesh() line 425 in /scratch/petsc-dev/src/dm/<wbr>impls/plex/examples/tests/<wbr>ex18.c<br>
[0]PETSC ERROR: #5 main() line 464 in /scratch/petsc-dev/src/dm/<wbr>impls/plex/examples/tests/<wbr>ex18.c<br>
<br>
<br>
The problem is that the DM is never created in this case. It could be fixed by adding<br>
  ierr = DMCreate(comm, dm);CHKERRQ(ierr);<br>
  ierr = DMSetType(*dm, DMPLEX);CHKERRQ(ierr);<br>
to the beginning of CreateQuad_2D and CreateHex_3D in ex18.c.<br>
<br>
However, I rather suggest to<br>
1) change the DM argument of these functions to DM* to unify them with CreateSimplex_2D and CreateSimplex_3D,<br>
2) alter DMPlexCreateFromDAG so that DM is strictly output parameter. I don't understand why it couldn't create the DMPlex on its own - see the manual page: "dm - The empty DM object, usually from DMCreate() and DMSetDimension()".<br></blockquote><div><br></div><div>This happened because its a partial cut & paste. Only the Simplex functions have been updated. The CreateFromDag() should change to</div><div>a DMPlexCreateFromCellListParallel(). I will do it today hopefully.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I can fix that as suggested above if you agree.<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Vaclav</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_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/~knepley/</a><br></div></div></div></div></div>
</div></div>