[petsc-users] DMPlexSetRefinementFunction

David Fuentes fuentesdt at gmail.com
Wed Jan 2 18:27:05 CST 2019


Hi,

Starting with TS example 45

$ pwd
/opt/apps/PETSc/petsc-3.10.2
$ ls src/ts/examples/tutorials/ex45.c
src/ts/examples/tutorials/ex45.c

petsc configured with: ./config/configure.py --with-shared-libraries
--with-clanguage=c++ --CFLAGS='-g -O0' --CXXFLAGS='-g -O0'  --with-c2html=0
--download-ctetgen  --download-triangle --with-debugging=yes
--download-netcdf  --download-zlib  --download-exodusii --download-hdf5
--download-pnetcdf

I'm trying to refine the DMPlexCreateBoxMesh  with the
DMPlexSetRefinementFunction.
It generally seems to be working, except that the refined element is
slightly offset from what I was expecting.
Based on my application specific criteria, element id number 7 is flagged
to be refined by the DMPlexSetRefinementFunction but when I open in
paraview, it looks like element id number 8 is being refined. See attached
pic.

[image: Screen Shot 2019-01-02 at 6.02.02 PM.png]
[image: Screen Shot 2019-01-02 at 6.02.11 PM.png]

Is it possible that the maxVolumes array is 'off by one' when transfering
to tetgen data structures somehow ?

https://bitbucket.org/petsc/petsc/src/bd27d3f284687498e4c4678d234c0e308a5bc236/src/dm/impls/plex/plexadapt.c?at=master&fileviewer=file-view-default#plexadapt.c-252



(gdb) bt
#0  DMPlexRefine_CTetgen (dm=0x932180, maxVolumes=0x919710,
dmRefined=0x7fffffffb938) at
/opt/apps/PETSc/petsc-3.10.2/src/dm/impls/plex/generators/ctetgen/ctetgenerate.c:182
#1  0x00007ffff6b76401 in DMPlexRefine_Internal (dm=0x932180,
adaptLabel=0x0, dmRefined=0x7fffffffb938) at
/opt/apps/PETSc/petsc-3.10.2/src/dm/impls/plex/plexadapt.c:252
#2  0x00007ffff6b72720 in DMRefine_Plex (dm=0x932180, comm=0x6b,
dmRefined=0x7fffffffb938) at
/opt/apps/PETSc/petsc-3.10.2/src/dm/impls/plex/plexrefine.c:10361
#3  0x00007ffff6dad8ff in DMRefine (dm=0x932180, comm=0x6b,
dmf=0x7fffffffb938) at
/opt/apps/PETSc/petsc-3.10.2/src/dm/interface/dm.c:1808
#4  0x0000000000405274 in CreateMesh (comm=0x7ffff5891680
<ompi_mpi_comm_world>, dm=0x7fffffffb9d0, ctx=0x7fffffffba00) at
/rsrch1/ip/dtfuentes/github/thermoembo/tutorials/exac.c:253
#5  0x00000000004063c4 in main (argc=32, argv=0x7fffffffdb68) at
/rsrch1/ip/dtfuentes/github/thermoembo/tutorials/exac.c:336
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190102/fc293577/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-01-02 at 6.02.02 PM.png
Type: image/png
Size: 24717 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190102/fc293577/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-01-02 at 6.02.11 PM.png
Type: image/png
Size: 23658 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190102/fc293577/attachment-0003.png>


More information about the petsc-users mailing list