Hi Dave,
Thank you for your fast answer.
To postprocess the files in python, I use the PetscBinaryIO package that is provided with PETSc, yes.
I load the file like this :
import numpy as np
import meshio
import PetscBinaryIO as pio
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
mpl.use('Agg')
restartname = "restart_00001001.bin"
print("Reading {} ...".format(restartname))
io = pio.PetscBinaryIO()
fh = open(restartname)
objecttype = io.readObjectType(fh)
data = None
if objecttype == 'Vec':
data = io.readVec(fh)
print("Size of data = ", data.size)
print("Size of a single variable (4 variables) = ", data.size / 4)
assert(np.isclose(data.size / 4.0, np.floor(data.size / 4.0)))
Then I load the mesh (it's from Gmsh so I use the meshio package) :
meshname = "ForwardFacing.msh"
print("Reading {} ...".format(meshname))
mesh = meshio.read(meshname)
print("Number of vertices = ", mesh.points.shape[0])
print("Number of cells = ", mesh.cells_dict['quad'].shape[0])
From the 'data' and the 'mesh' I use tricontourf from matplotlib to plot the figure.
I removed the call to ...SetUseMPIIO... and it gives the same kind of data yes (I attached a figure of the data obtained with the binary viewer without MPI I/O).
Maybe it's just a connectivity issue ? Maybe the way the Vec is written by the PETSc viewer somehow does not match the connectivity from the ori Gmsh file but some other connectivity of the partitionned DMPlex ? If so, is there a way to get the latter ? I know the binary viewer does not work on DMPlex, the VTK viewer yields a corrupted dataset and I have issues with HDF5 viewer with MPI (see another recent thread of mine) ...
Thanks again for your help !!