Thanks Matt. Fixed it now!
Thank you. Sincerely, Prateek Gupta, PhD On Sat, Jul 2, 2022 at 5:10 PM Matthew Knepley <[email protected]> wrote: > On Sat, Jul 2, 2022 at 7:34 AM Matthew Knepley <[email protected]> wrote: > >> On Sat, Jul 2, 2022 at 7:15 AM Prateek Gupta <[email protected]> >> wrote: >> >>> 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. >>> >> >> Your depth ranges overlap: >> >> [0]PETSC ERROR: Petsc has generated inconsistent data >> [0]PETSC ERROR: New depth 2 range [0,4) overlaps with depth 1 range [0,4) >> [0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting. >> [0]PETSC ERROR: Petsc Development GIT revision: v3.17.1-558-g510ea5c820e >> GIT Date: 2022-06-08 21:35:46 -0400 >> [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 >> [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 >> [0]PETSC ERROR: #1 DMPlexCreateDepthStratum() at >> /PETSc3/petsc/petsc-dev/src/dm/impls/plex/plex.c:3864 >> [0]PETSC ERROR: #2 DMPlexStratify() at >> /PETSc3/petsc/petsc-dev/src/dm/impls/plex/plex.c:3984 >> [0]PETSC ERROR: #3 main() at >> /Users/knepley/Downloads/tmp/Prateek/dmplex_dist.cpp:167 >> [0]PETSC ERROR: PETSc Option Table entries: >> [0]PETSC ERROR: -malloc_debug >> >> I will try to figure out why. >> > > 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 > > > https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexCreateFromCellListPetsc/ > > Thanks, > > Matt > > >> Thanks, >> >> Matt >> >> >>> Thanks for your help! >>> >>> >>> Sincerely, >>> Prateek Gupta, PhD >>> >>> >>> On Sat, Jul 2, 2022 at 4:37 PM Matthew Knepley <[email protected]> >>> wrote: >>> >>>> On Sat, Jul 2, 2022 at 3:11 AM Prateek Gupta < >>>> [email protected]> 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/> >>>> >>> >> >> -- >> 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/> >> > > > -- > 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/> > -- Thank you. Sincerely, Prateek Gupta, PhD Phone:- +91 92891 88977 +91 9999812651
