- Thank you received: 1
VtkOutput problem: .vtu files instead of .vtk files
3 years 2 months ago - 3 years 2 months ago #3997
by dong
VtkOutput problem: .vtu files instead of .vtk files was created by dong
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.
Could you please tell me how I can solve this issue? How can I get .vtk files from .vtu files.
Thank you so much.
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.
Could you please tell me how I can solve this issue? How can I get .vtk files from .vtu files.
Thank you so much.
Last edit: 3 years 2 months ago by dong.
3 years 2 months ago #3998
by dong
Replied by dong on topic VtkOutput problem: .vtu files instead of .vtk files
Updated:
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.
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.
3 years 2 months ago #4000
by schruste
Replied by schruste on topic VtkOutput problem: .vtu files instead of .vtk files
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.
Best,
Christoph
Best,
Christoph
3 years 2 months ago - 3 years 2 months ago #4001
by dong
Replied by dong on topic VtkOutput problem: .vtu files instead of .vtk files
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,
Dong
Best wishes,
Dong
Last edit: 3 years 2 months ago by dong.
3 years 2 months ago #4002
by schruste
Replied by schruste on topic VtkOutput problem: .vtu files instead of .vtk files
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`.
Best,
Christoph
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`.
Best,
Christoph
Time to create page: 0.115 seconds