<div dir="ltr"><div dir="ltr">On Sat, Jul 2, 2022 at 3:11 AM Prateek Gupta <<a href="mailto:prateekgupta1709@gmail.com">prateekgupta1709@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><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>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:1px solid rgb(204,204,204);padding-left:1ex"><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" class="gmail_signature"><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>