[petsc-users] Trouble when viewing a subDM in vtk format
Aldo Bonfiglioli
aldo.bonfiglioli at unibas.it
Mon Dec 1 07:22:21 CST 2025
Dear developers,
I wrote a code that extracts subDMs corresponding to the various strata
in the Face Sets.
I run into troubles when I view a subDM or a Vec attached to the subDM
using the VTK format.
More precisely, the problem only occurs on more than one processor when
the rank=0 processor has no points on a given subDM.
For instance, when the attached reproducer is run on 2 procs, the
u_01.vtu file (global u Vec mapped to the subDM corresponding to stratum=1)
only includes the header, but no data. All other u_0?.vtu files can
successfully be loaded and viewed in paraview.
The problem does NOT arise when I view the same objects in HDF5 format.
However, my problem in using the HDF5 lies in the fact that:
while the hdf5 file obtained with DMView can be post-processed with
"petsc/lib/petsc/bin/petsc_gen_xdmf.py" to create a xmf file readable by
paraview
I do not know how to view the field(s) associated with the DM when the
hdf5 file is obtained from VecView.
The reproducer compiles with the latest petsc release.
Thanks,
Aldo
--
Dr. Aldo Bonfiglioli
Associate professor of Fluid Mechanics
Dipartimento di Ingegneria
Universita' della Basilicata
V.le dell'Ateneo Lucano, 10 85100 Potenza ITALY
tel:+39.0971.205203 fax:+39.0971.205215
web: https://urldefense.us/v3/__http://docenti.unibas.it/site/home/docente.html?m=002423__;!!G_uCfscf7eWS!eXE2csxUb1J5bnRosf9LIGxLs17TdstMxQcGs0mbXFroRjzLN81jVmeAWfMr41X8JGEuVm286lVTmDgmi5s1zfsfegJNuWVVWTM$
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rgmsh.F90
Type: text/x-fortran
Size: 26554 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251201/aeae59e0/attachment-0001.bin>
-------------- next part --------------
-dm_plex_dim 3
-dm_plex_shape box
-dm_plex_box_faces 20,20,20
-dm_plex_box_lower 0.,0.,0.
-dm_plex_box_upper 1.,1.,1.
##-dm_plex_filename cube6.msh
##-dm_plex_simplex false
-dm_plex_simplex true
-dm_plex_interpolate
##-dm_plex_check_all
##-dm_plex_filename /home/abonfi/grids/3D/MASA_ns3d/unnested/cube1/cube1.msh
#
# read a solution from an existing file
#
#-viewer_type hdf5
#-viewer_format vtk
#-viewer_filename /home/abonfi/testcases/3D/scalar/advdiff/hiro/DMPlex/Re100/cube0/u.h5
#
##-viewer_binary_filename /home/abonfi/testcases/3D/scalar/advdiff/hiro/DMPlex/Re100/cube1/sol.bin
#
# and write it to u.*
#
###-vec_view hdf5:u.h5
-vec_view vtk:u.vtu
##
## I can read both mesh.h5 and mesh.vtu in paraview
##
-dm_view hdf5:mesh.h5
##-dm_view vtk:mesh.vtu
#
# uncomment the following to write each boundary patch separately in an HDF5 file
# works both serial and parallel
#
-patch_01_dm_view hdf5:patch_01.h5
-patch_02_dm_view hdf5:patch_02.h5
-patch_03_dm_view hdf5:patch_03.h5
-patch_04_dm_view hdf5:patch_04.h5
-patch_05_dm_view hdf5:patch_05.h5
-patch_06_dm_view hdf5:patch_06.h5
#
# uncomment the following to write each boundary patch separately in a VTK file
# it work on one processor, but fails whenever the rank=0 processor has no points
# on a given submesh
#
#
#-patch_01_dm_view vtk:patch_01.vtu
#-patch_02_dm_view vtk:patch_02.vtu
#-patch_03_dm_view vtk:patch_03.vtu
#-patch_04_dm_view vtk:patch_04.vtu
#-patch_05_dm_view vtk:patch_05.vtu
#-patch_06_dm_view vtk:patch_06.vtu
#
#
#
##-dm_plex_view_labels "marker"
##-dm_plex_view_labels "Face Sets"
-petscpartitioner_view
####-dm_petscsection_view
-options_left
More information about the petsc-users
mailing list