[petsc-users] PetscViewer with 64bit
Mike Michell
mi.mike1021 at gmail.com
Sun Feb 12 17:38:14 CST 2023
Thanks for the comments.
To be precise on the question, the entire part of the header of the .vtu
file is attached:
<?xml version="1.0"?>
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
<UnstructuredGrid>
<Piece NumberOfPoints="4872" NumberOfCells="4000">
<Points>
<DataArray type="Float64" Name="Position" NumberOfComponents="3"
format="appended" offset="0" />
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1"
format="appended" offset="116932" />
<DataArray type="Int32" Name="offsets" NumberOfComponents="1"
format="appended" offset="372936" />
<DataArray type="UInt8" Name="types" NumberOfComponents="1"
format="appended" offset="404940" />
</Cells>
<CellData>
<DataArray type="Int32" Name="Rank" NumberOfComponents="1"
format="appended" offset="408944" />
</CellData>
<PointData>
<DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0"
NumberOfComponents="1" format="appended" offset="424948" />
</PointData>
</Piece>
<Piece NumberOfPoints="4872" NumberOfCells="4000">
<Points>
<DataArray type="Float64" Name="Position" NumberOfComponents="3"
format="appended" offset="463928" />
</Points>
<Cells>
<DataArray type="Int32" Name="connectivity" NumberOfComponents="1"
format="appended" offset="580860" />
<DataArray type="Int32" Name="offsets" NumberOfComponents="1"
format="appended" offset="836864" />
<DataArray type="UInt8" Name="types" NumberOfComponents="1"
format="appended" offset="868868" />
</Cells>
<CellData>
<DataArray type="Int32" Name="Rank" NumberOfComponents="1"
format="appended" offset="872872" />
</CellData>
<PointData>
<DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0"
NumberOfComponents="1" format="appended" offset="888876" />
</PointData>
</Piece>
</UnstructuredGrid>
<AppendedData encoding="raw">
Thanks,
Mike
> 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,
>
> Matt
>
>
>> 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/b2424713/attachment-0001.html>
More information about the petsc-users
mailing list