# vtm to vtr conversion

**URL:** https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806
**Category:** ParaView Support
**Tags:** vtk
**Created:** [November 28, 2024, 4:36am UTC](https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806 "2024-11-28T04:36:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![djr4cfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@djr4cfd](https://discourse.paraview.org/u/djr4cfd)
#### Post date: [November 28, 2024, 4:36am UTC](https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806/1 "2024-11-28T04:36:05Z")

</div>

I have to compare two sets of output files. One is from OpenFOAM, and the other is from my own CFD solver. OpenFOAM generated files in .vtm format when I used “foamToVTK”. These are VTK multi-block files. Even though I am simulating a 2D problem, the output is 3D, which is the standard procedure in OpenFOAM. On the other hand, my CFD solver generates output in .vtr format.

I need to subtract the field variables (velocity and pressure fields) from both these output files somehow so that I can extract the difference/error between these two. If the mesh is exactly the same, we can use “appendAttributes”, but this is not working here.

If somebody can guide me in this direction, it would greatly help.

---

<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: [November 28, 2024, 9:16am UTC](https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806/2 "2024-11-28T09:16:14Z")

</div>

You may want to use ResampleWithDataSet to resample the openfoam data into your dataset.

You can then use Calculator on the results to compute the difference or anything else.

---

<div class="post-metadata">

### Author: ![djr4cfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@djr4cfd](https://discourse.paraview.org/u/djr4cfd)
#### Post date: [November 28, 2024, 11:24am UTC](https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806/3 "2024-11-28T11:24:50Z")

</div>

Thank you for the quick suggestion. I will try this.

---

<div class="post-metadata">

### Author: ![djr4cfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/919ad9/32.png) [@djr4cfd](https://discourse.paraview.org/u/djr4cfd)
#### Post date: [December 6, 2024, 11:14am UTC](https://discourse.paraview.org/t/vtm-to-vtr-conversion/15806/4 "2024-12-06T11:14:23Z")

</div>

I tried and this is exactly what I needed. Thanks a lot!
