<div dir="ltr"><div dir="ltr">Thanks for the note. <br>I understood that PETSc calculates the offsets for me through "boffset" variable in plexvtu.c file. Please correct me if it is wrong.<br><br>If plexvtu.c has a bug, it could be around "write file header" part in which the boffset is also computed. Is this correct? I am not using complex number.<br>There are several mixed parts among "Int32, UInt8, PetscInt_FMT, PetscInt64_FMT" in writing the header. <br><br>Which combination of those flags is correct for 64bit indices? I am gonna modify plexvtu.c file with "#if defined(PETSC_USE_64BIT_INDICES)" statement, but I do not know what is the correct form of the header flag for 64bit indices. <br><br>It is also confusing to me:<br>boffset += gpiece[r].ncells * sizeof(PetscInt) + sizeof(int);<br>How is sizeof(PetscInt) different from sizeof(int)?<br><br>Thanks,<br>Mike<br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br>On Tue, Feb 14, 2023 at 11:45 AM Mike Michell <<a href="mailto:mi.mike1021@gmail.com" target="_blank">mi.mike1021@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">I was trying to modify the header flags from "Int32" to "Int64", but the problem was not resolved. Could I get any additional comments?<br></div></div></blockquote><div><br></div><div>The calculated offsets are not correct I think.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thanks,<br>Mike<br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>Thanks for the comments. </div><div>To be precise on the question, the entire part of the header of the .vtu file is attached:</div><div><br></div><div><?xml version="1.0"?><br><VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian"><br> <UnstructuredGrid><br> <Piece NumberOfPoints="4872" NumberOfCells="4000"><br> <Points><br> <DataArray type="Float64" Name="Position" NumberOfComponents="3" format="appended" offset="0" /><br> </Points><br> <Cells><br> <DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="appended" offset="116932" /><br> <DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="appended" offset="372936" /><br> <DataArray type="UInt8" Name="types" NumberOfComponents="1" format="appended" offset="404940" /><br> </Cells><br> <CellData><br> <DataArray type="Int32" Name="Rank" NumberOfComponents="1" format="appended" offset="408944" /><br> </CellData><br> <PointData><br> <DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0" NumberOfComponents="1" format="appended" offset="424948" /><br> </PointData><br> </Piece><br> <Piece NumberOfPoints="4872" NumberOfCells="4000"><br> <Points><br> <DataArray type="Float64" Name="Position" NumberOfComponents="3" format="appended" offset="463928" /><br> </Points><br> <Cells><br> <DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="appended" offset="580860" /><br> <DataArray type="Int32" Name="offsets" NumberOfComponents="1" format="appended" offset="836864" /><br> <DataArray type="UInt8" Name="types" NumberOfComponents="1" format="appended" offset="868868" /><br> </Cells><br> <CellData><br> <DataArray type="Int32" Name="Rank" NumberOfComponents="1" format="appended" offset="872872" /><br> </CellData><br> <PointData><br> <DataArray type="Float64" Name="Vec_0x37c89c0_4Field_0.0" NumberOfComponents="1" format="appended" offset="888876" /><br> </PointData><br> </Piece><br> </UnstructuredGrid><br> <AppendedData encoding="raw"><br></div><div><br></div><div><br></div><div>Thanks,</div><div>Mike</div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br>On Sun, Feb 12, 2023 at 6:15 PM Mike Michell <<a href="mailto:mi.mike1021@gmail.com" target="_blank">mi.mike1021@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear PETSc team,<div><br></div><div>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. </div><div><br></div><div>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: </div><div>"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."</div><div><br></div><div>If I open the .vtu file from terminal, I can see such a line:</div><div>...</div><div><DataArray type="Int32" Name="connectivity" NumberOfComponents="1" format="appended" offset="580860" /><br></div><div>...</div><div><br></div><div>I expected "DataArray type="Int64", since the PETSc has 64bit indices. Could I get recommendations that I need to check to resolve the issue? </div></div></blockquote><div><br></div><div>This is probably a bug. We will look at it.</div><div><br></div><div>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?</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks,</div><div>Mike</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div></div>