# VTK - separate mesh and data files

**URL:** https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134
**Category:** ParaView Support
**Tags:** vtk
**Created:** [August 11, 2022, 12:08pm UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134 "2022-08-11T12:08:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![nikic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/n/94ad74/32.png) [@nikic](https://discourse.paraview.org/u/nikic)
#### Post date: [August 11, 2022, 12:08pm UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/1 "2022-08-11T12:08:10Z")

</div>

Hi! I am running a simulation on a static, unstructured mesh. Currently I output the variables at every timestep using .vtu files, but it seems wasteful to output the mesh points & connectivity that many times since the mesh does not evolve.

Is it possible to point the .vtu file containing cell data to a separate points/connectivity file? And if so, what might that look like? Thank you!

---

<div class="post-metadata">

### Author: ![jfausty](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jfausty/32/9405_2.png) [@jfausty](https://discourse.paraview.org/u/jfausty)
#### Post date: [August 12, 2022, 8:20am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/2 "2022-08-12T08:20:57Z")

</div>

Hi @nikic,

You might want to take a look at the “.pvtu” format ([https://kitware.github.io/vtk-examples/site/VTKFileFormats/](https://kitware.github.io/vtk-examples/site/VTKFileFormats/)). You might be able to use the indirection provided by the format (usually to read distributed datasets) to read your field and mesh files independently.

If that does not work, I would advise you to look into the XDMF format ([XDMF Model and Format - XdmfWeb](https://xdmf.org/index.php/XDMF_Model_and_Format)) supported by ParaView. While changing the format of your files may be cumbersome, this file format is really meant for the kind of storage optimizations you are describing.

Hope that helps!

Best regards,

Julien

---

<div class="post-metadata">

### Author: ![metorm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/metorm/32/10783_2.png) [@metorm](https://discourse.paraview.org/u/metorm)
#### Post date: [January 29, 2023, 11:42am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/3 "2023-01-29T11:42:07Z")

</div>

Hi there @jfausty , I think you have a good point.

My understanding is that you are proposing to use a vtu file to hold all the geometry point information, another file to hold the field data at a particular moment, and then a pvtu file to link these files together.

However, I looked up the documentation and tutorials for the vtk library and didn’t find any relevant examples. The relevant functions of the `vtkXMLPUnstructuredGridWriter` class do not look like the functionality I want. Can you provide a simple example to show me how to do this?

Or, did you @nikic already achieved this, and could you show me your implementation?

Many thanks!

---

<div class="post-metadata">

### Author: ![nikic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/n/94ad74/32.png) [@nikic](https://discourse.paraview.org/u/nikic)
#### Post date: [February 1, 2023, 1:50pm UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/4 "2023-02-01T13:50:59Z")

</div>

Hi @metorm, I have not achieved this yet unfortunately, been occupied with other work! And @jfausty - a belated thank you for the suggestions!

I believe the .pvtu files allow you to combine several individual .vtu files. However as @metorm says, I don’t think VTK has the functionality to direct the points data to a separate file.

Had a brief look at xdmf - this might be closer to what I’m trying to achieve. It looks like you can include a points array in an .h5 file, and point the xdmf file to it. I haven’t seen an explicit example though, so that’s just a guess. Will update this thread if I try it successfully, please do the same!

---

<div class="post-metadata">

### Author: ![metorm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/metorm/32/10783_2.png) [@metorm](https://discourse.paraview.org/u/metorm)
#### Post date: [February 2, 2023, 9:07am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/5 "2023-02-02T09:07:50Z")

</div>

I posted my exploration [here](https://stackoverflow.com/a/75320663/4503060) for reference. Basically, I think we cannot achieve this without modifying VTU itself.

---

<div class="post-metadata">

### Author: ![nikic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/n/94ad74/32.png) [@nikic](https://discourse.paraview.org/u/nikic)
#### Post date: [February 2, 2023, 10:33am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/6 "2023-02-02T10:33:01Z")

</div>

Hi @metorm, that is a shame. As I said before, I’ll try at some point to use xdmf instead of vtu files, but it’s quite some effort so may take a while.

Side note - you might want to check out this plugin. It doesn’t address the problem of large data sizes, but it may help with paraview visualisation times.  
[https://www.kitware.com/staticmeshplugin/](https://www.kitware.com/staticmeshplugin/)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 5, 2024, 8:32am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/7 "2024-01-05T08:32:56Z")

</div>

Im afraid such a feature is not planned for the VTU XML format but may be added in the vtkHDF format in the future.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 5, 2024, 8:33am UTC](https://discourse.paraview.org/t/vtk-separate-mesh-and-data-files/10134/8 "2024-01-05T08:33:50Z")

</div>

[https://gitlab.kitware.com/vtk/vtk/-/issues/19216](https://gitlab.kitware.com/vtk/vtk/-/issues/19216)
