VtkOutput problem: .vtu files instead of .vtk files

I run the code with vtk output. The output is only .vtu files instead of .vtk files.
I couldn’t visualize those .vtu files with Paraview software. On the output message, when I tried to open those files was as follows.

[code]ERROR: In C:\bbd\8fbebceb\build\superbuild\paraview\src\VTK\IO\XML\vtkXMLUnstructuredDataReader.cxx, line 681

vtkXMLUnstructuredGridReader (000001A1AC6925D0): 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.[/code]

Could you please tell me how I can solve this issue? How can I get .vtk files from .vtu files.
Thank you so much.

My problem was solved.
When I used the latest version, it produced the .vtu files. Couldn’t view in Paraview.
When I used the 2020 version, it produced the .vtk files. Can visualize in Paraview.
I don’t know why.

We indeed changed the default VTK output from the legacy format (.vtk) to the xml format (.vtu) (which also allows for binary output) in the meantime. However, Paraview (if not very very old) should be able to cope with both. You can also enforce the legacy format with a latest versions of ngsolve adding “legacy=True” in the VTKOutput constructor.


I changed bool legacy = False to bool legacy =True in VtkOuput.hpp file, I still get vtu files. I also used the latest version of Paraview, but I still couldn’t visualize vtu file. Perhaps I made a mistake somewhere.

Best wishes,

Well, you changed the default argument on the C+±side, but when called from python, the VTKOutput will still use the python-default which is false. So, simply use legacy=True when instantiating the VTKOutput object.

Alternatively you can use tools like meshio to convert vtk to vtu, e.g. install pip install meshio and then call meshio convert test.vtu test.vtk.