[petsc-users] PetscViewer with 64bit

Matthew Knepley knepley at gmail.com
Sun Feb 12 17:28:24 CST 2023

On Sun, Feb 12, 2023 at 6:15 PM Mike Michell <mi.mike1021 at gmail.com> wrote:

> Dear PETSc team,
> I am a user of PETSc with Fortran. My code uses DMPlex to handle dm
> object. To print out output variable and mesh connectivity, I use VecView()
> by defining PetscSection on that dm and borrow a vector. The type of the
> viewer is set to PETSCVIEWERVTK.
> With 32bit indices, the above work flow has no issue. However, if PETSc is
> configured with 64bit indices, my output .vtu file has an error if I open
> the file with visualization tools, such as Paraview or Tecplot, saying
> that:
> "Cannot read cell connectivity from Cells in piece 0 because the "offsets"
> array is not monotonically increasing or starts with a value other than 0."
> If I open the .vtu file from terminal, I can see such a line:
> ...
> <DataArray type="Int32" Name="connectivity" NumberOfComponents="1"
> format="appended" offset="580860" />
> ...
> I expected "DataArray type="Int64", since the PETSc has 64bit indices.
> Could I get recommendations that I need to check to resolve the issue?

This is probably a bug. We will look at it.

Jed, I saw that Int32 is hardcoded in plexvtu.c, but sizeof(PetscInt) is
used to calculate the offset, which looks inconsistent. Can you take a look?



> Thanks,
> Mike

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/20230212/e85965ea/attachment.html>

More information about the petsc-users mailing list