small problem with vtk files .pvtp

Hello,

I like to report a small inconsistency when dumping vtp and thus pvtp files using LAMMPS (10 Dec 2025).
When I run the script in.crystal_vtp

units metal
dimension 3
boundary s s s
lattice diamond 5.43
region box block 0 3 0 4 0 5 units lattice
create_box 1 box
create_atoms 1 box
mass 1 28.0855

dump reference_vtp all vtk 1000000 dump.reference.*%.vtp id type x y z
dump_modify reference_vtp pad 6

run 0

with mpirun -n 4 lmp -in in.crystal_vtp I get the following files:

dump_0.vtp     # should not be generated; content is dump.reference.000000_0.vtp
dump.reference.000000_0.vtp
dump.reference.000000_1.vtp
dump.reference.000000_2.vtp
dump.reference.000000_3.vtp
dump.reference.000000_boundingBox.vtr
dump.reference.000000.pvtp

Now, dump.reference.000000.pvtp content is

<?xml version="1.0"?>
<VTKFile type="PPolyData" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <PPolyData GhostLevel="0">
    <PPointData>
      <PDataArray type="Int32" Name="id"/>
      <PDataArray type="Int32" Name="type"/>
    </PPointData>
    <PPoints>
      <PDataArray type="Float32" Name="Points" NumberOfComponents="3"/>
    </PPoints>
    <Piece Source="dump_0.vtp"/>     # <======== that's an ERROR =========
  </PPolyData>
</VTKFile>

But it should reference to the portions of the dump file written by P processors, i.e.

<?xml version="1.0"?>
<VTKFile type="PPolyData" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <PPolyData GhostLevel="0">
    <PPointData>
      <PDataArray type="Int32" Name="id"/>
      <PDataArray type="Int32" Name="type"/>
    </PPointData>
    <PPoints>
      <PDataArray type="Float32" Name="Points" NumberOfComponents="3"/>
    </PPoints>
    <Piece Source="dump.reference.000000_0.vtp"/>
    <Piece Source="dump.reference.000000_1.vtp"/>
    <Piece Source="dump.reference.000000_2.vtp"/>
    <Piece Source="dump.reference.000000_3.vtp"/>
  </PPolyData>
</VTKFile>

Usually, one opens dump.reference.000000.pvtp with paraview and then paraview reads the referenced portions of the dump file. But with the current pvtp file that’s not possible.
I currently use a python script after a lammps run to fix the pvtp file(s).

@lcontinuum
Thanks for your bug report and sorry for the long delay before fixing it.
I have confirmed the issue and there is now a pull request that addresses it: fix dump vtk parallel summary referencing wrong piece files by akohlmey · Pull Request #5012 · lammps/lammps · GitHub

1 Like

Thank you for the fix. Once it hits a new stable release, I’ll test it.

That is about the worst time to make such a test. It would be far more useful and helpful to other users of the VTK dump style if the fix was confirmed before we release a stable version.

Our current plan is to have a feature release in about three weeks and then focus on testing and bugfixes for a couple of months, so that a stable release is currently expected in late August or early September. But we follow the “we release it when it is done” paradigm, so deadlines may shift. At the moment we have extremely many open pull requests, so reviewing them will take time.

Hmmm, so I just cloned your branch bugfix-vtk-pvtp-pieces compiled it using Ubuntu 24.04 and just tested it with two of my input files. Looks good.
Thank you!
Forgot to mention: Paraview reads and visualizes the portioned files now correct.

1 Like