<div><div dir="ltr"><div dir="auto">Thanks Matt. Fixed it now!<br></div></div></div><div><div dir="ltr"><div><br></div><div><br></div><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div>Thank you.<br>Sincerely,<br>Prateek Gupta, PhD</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 2, 2022 at 5:10 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr">On Sat, Jul 2, 2022 at 7:34 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr">On Sat, Jul 2, 2022 at 7:15 AM Prateek Gupta <<a href="mailto:prateekgupta1709@gmail.com" target="_blank">prateekgupta1709@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Hi Matt, <br></div><div>you are right about the first DM being invalid. I wasn't reading the cells properly. But now that I have fixed it, the code seems to hang in an infinite loop in DMPlexStratify. I am attaching the working snippet which exhibits the issue.</div></div></blockquote><div><br></div><div>Your depth ranges overlap:</div><div><br></div><div>[0]PETSC ERROR: Petsc has generated inconsistent data<br>[0]PETSC ERROR: New depth 2 range [0,4) overlaps with depth 1 range [0,4)<br>[0]PETSC ERROR: See <a href="https://petsc.org/release/faq/" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Development GIT revision: v3.17.1-558-g510ea5c820e GIT Date: 2022-06-08 21:35:46 -0400<br>[0]PETSC ERROR: ./dmplex_dist on a arch-master-debug named MacBook-Pro.fios-router.home by knepley Sat Jul 2 07:33:55 2022<br>[0]PETSC ERROR: Configure options --PETSC_ARCH=arch-master-debug --download-bamg --download-chaco --download-ctetgen --download-egads --download-eigen --download-exodusii --download-fftw --download-hpddm --download-ks --download-libceed --download-libpng --download-metis --download-ml --download-mmg --download-mumps --download-netcdf --download-opencascade --download-p4est --download-parmetis --download-parmmg --download-pnetcdf --download-pragmatic --download-ptscotch --download-scalapack --download-slepc --download-suitesparse --download-superlu_dist --download-tetgen --download-triangle --with-cmake-exec=/PETSc3/petsc/apple/bin/cmake --with-ctest-exec=/PETSc3/petsc/apple/bin/ctest --with-hdf5-dir=/PETSc3/petsc/apple --with-mpi-dir=/PETSc3/petsc/apple --with-petsc4py=1 --with-shared-libraries --with-slepc --with-zlib --download-bison<br>[0]PETSC ERROR: #1 DMPlexCreateDepthStratum() at /PETSc3/petsc/petsc-dev/src/dm/impls/plex/plex.c:3864<br>[0]PETSC ERROR: #2 DMPlexStratify() at /PETSc3/petsc/petsc-dev/src/dm/impls/plex/plex.c:3984<br>[0]PETSC ERROR: #3 main() at /Users/knepley/Downloads/tmp/Prateek/dmplex_dist.cpp:167<br>[0]PETSC ERROR: PETSc Option Table entries:<br>[0]PETSC ERROR: -malloc_debug<br></div><div><br></div><div>I will try to figure out why.</div></div></div></blockquote><div><br></div><div>The problem is that vertices are numbered _after_ cells, so you need to add n_elements to every vertex number. Or you could consider calling</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexCreateFromCellListPetsc/" target="_blank">https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexCreateFromCellListPetsc/</a></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-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div class="gmail_quote"><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Thanks for your help!<br></div><div><br></div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><br>Sincerely,<br>Prateek Gupta, PhD</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 2, 2022 at 4:37 PM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr">On Sat, Jul 2, 2022 at 3:11 AM Prateek Gupta <<a href="mailto:prateekgupta1709@gmail.com" target="_blank">prateekgupta1709@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Hi, <br></div><div>I am trying to create a minimal example of reading nodes and elements from a text file and creating dmplex mesh. So far I am following the procedure as in plexfluent.c. However, while trying to interpolate the mesh, I get the error, <br></div><div><br></div><div>[0]PETSC ERROR: Nonconforming object sizes<br>[0]PETSC ERROR: The number of vertices in first DM 20 != 0 in the second DM</div><div><br></div><div>The call trace looks like this, <br></div><div>[0]PETSC ERROR: #1 DMPlexCopyCoordinates() line 1448 in /build/petsc-zg3KH7/petsc-3.12.4+dfsg1/src/dm/impls/plex/plexinterpolate.c<br>[0]PETSC ERROR: #2 DMPlexInterpolate() line 1394 in /build/petsc-zg3KH7/petsc-3.12.4+dfsg1/src/dm/impls/plex/plexinterpolate.c</div><div><br></div><div>The code snippet for interpolation is exactly same as in plexfluent.c except for the petscCall function, <br></div><div><br></div><div>--------------------------------------------------<br></div><div> if (interpolate) {<br> DM idm;<br> PetscCall(DMPlexInterpolate(*dm, &idm));<br> PetscCall(DMDestroy(dm));<br> dm = idm;<br> }</div><div>--------------------------------------------------</div><div><br></div><div>dm is the DM object declared within main only. Any help will be appreciated. I can guess that the idm object doesn't have memory allocated for copying the vertices, but my question is how come it works off-the-bat for fluent/gmsh files using functions in plexfluent.c and plexgmsh.c. Is there a way to allocate just the vertices? Or do I need to use DMPlexSetChart for idm object before interpolating?</div></div></blockquote><div><br></div><div>My guess is that the first DM is invalid. If you send the code, I will go through it.</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-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div>Thank you.<br>Sincerely,<br>Prateek Gupta, PhD<br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><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.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>
</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div>Thank you.<br>Sincerely,<br>Prateek Gupta, PhD<br></div></div></div></div><div>Phone:- +91 92891 88977<br></div><div> +91 9999812651<br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>