[petsc-users] DMPlexInterpolate error nonconforming object sizes
Prateek Gupta
prateekgupta1709 at gmail.com
Sat Jul 2 06:15:15 CDT 2022
Hi Matt,
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.
Thanks for your help!
Sincerely,
Prateek Gupta, PhD
On Sat, Jul 2, 2022 at 4:37 PM Matthew Knepley <knepley at gmail.com> wrote:
> On Sat, Jul 2, 2022 at 3:11 AM Prateek Gupta <prateekgupta1709 at gmail.com>
> wrote:
>
>> Hi,
>> 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,
>>
>> [0]PETSC ERROR: Nonconforming object sizes
>> [0]PETSC ERROR: The number of vertices in first DM 20 != 0 in the second
>> DM
>>
>> The call trace looks like this,
>> [0]PETSC ERROR: #1 DMPlexCopyCoordinates() line 1448 in
>> /build/petsc-zg3KH7/petsc-3.12.4+dfsg1/src/dm/impls/plex/plexinterpolate.c
>> [0]PETSC ERROR: #2 DMPlexInterpolate() line 1394 in
>> /build/petsc-zg3KH7/petsc-3.12.4+dfsg1/src/dm/impls/plex/plexinterpolate.c
>>
>> The code snippet for interpolation is exactly same as in plexfluent.c
>> except for the petscCall function,
>>
>> --------------------------------------------------
>> if (interpolate) {
>> DM idm;
>> PetscCall(DMPlexInterpolate(*dm, &idm));
>> PetscCall(DMDestroy(dm));
>> dm = idm;
>> }
>> --------------------------------------------------
>>
>> 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?
>>
>
> My guess is that the first DM is invalid. If you send the code, I will go
> through it.
>
> Thanks,
>
> Matt
>
>
>> Thank you.
>> Sincerely,
>> Prateek Gupta, PhD
>>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220702/059e9619/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmplex_example.zip
Type: application/zip
Size: 3558 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220702/059e9619/attachment-0001.zip>
More information about the petsc-users
mailing list