question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What's the proper way to open parallel VTK files (*.pvtu)?

See original GitHub issue

First thanks for this wonderful package! It is a much more sane way to manipulate VTK files in Python…

I wonder what’s the proper way to open parallel VTK files? It consists of a header file (*.pvtu) that points to normal VTK files (*.vtu). In ParaView, you can simply open the top-level *.pvtu file, and ParaView will automatically assemble the small VTK files into a single object.

Directly calling vtki.read('*.pvtu') leads to OSError: This file was not able to be automatically read by vtki.. So I open each small VTU file and use vtki.pointset.UnstructuredGrid.merge() to put them together. The full reproducible code is at https://github.com/JiaweiZhuang/vtk_experiments/blob/master/vtki_read_pvtu.ipynb, with small sample data files.

However, merge() seems to have problems at the boundaries between different subdomains:

pvtu_plot_density

The blue/green lines are artifacts that shouldn’t exist in the original data. They correspond to the boundaries of domain-decomposition:

pvtu_plot_node

Here each color represents a VTK file.

Thus I wonder what’s the proper way to open and merge parallel VTK files? Would it be useful to add an API similar to Xarray’s open_mfdataset() to deal with multiple files?

Disclaimer: I have zero experience with VTK, but need to process some VTK files for a class project. Please forgive me if I miss anything obvious 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
banesullivancommented, Apr 19, 2019

It’s now on the master branch and an example is live in docs: http://docs.vtki.org/examples/00-load/read-parallel.html

1reaction
JiaweiZhuangcommented, Apr 19, 2019

Yes I think that’s okay!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is it? How to open a PVTU file? - FILExt
a pvtu Parallel (Partitioned) VTK Unstructured Data is a special file format by Kitware, Inc. and should only be edited and saved with...
Read more >
[Paraview] How to merge .vtk files to visualize the result in ...
If you want to be able to open a single file and have the data for ... you should look into the parallel...
Read more >
Parallel Files — PyVista 0.37.0 documentation
The VTK library supports parallel file formats. Reading meshes broken up into several files is natively supported by VTK and PyVista. import os...
Read more >
[General] Generating vtu and pvtu files - Forums - CFD Online
Hello, I am new to this forum and paraview as well. I have some large vtk files that need to be processed, and...
Read more >
Distributed I/O with vtkXMLPUnstructuredGridWriter - Support
vtu files are generated properly, the .pvtu file appears to be overwritten by each rank (or at least the .pvtu file is generated...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found