# vtu file wrong number of components?

**URL:** https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202
**Category:** ParaView Support
**Tags:** vtk
**Created:** [March 19, 2024, 11:50am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202 "2024-03-19T11:50:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Boone](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@Boone](https://discourse.paraview.org/u/Boone)
#### Post date: [March 19, 2024, 11:50am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/1 "2024-03-19T11:50:14Z")

</div>

Dear all,

I saved a tensor of 9 components (tensor=gradient(gradient(U\_mean)) as a .vtm file. However, when I open the .vtu file (saved in the ascii format which is needed because I plan to modify several components) I notice that there are only 6 columns, despite the NumberOfComponents is 9:

```auto
<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <UnstructuredGrid>
    <Piece NumberOfPoints="596" NumberOfCells="888">
      <PointData>
        <DataArray type="Float64" Name="d2u:metric" NumberOfComponents="9" format="ascii" RangeMin="1.0189702313516165" RangeMax="2406.078773804854">
          0.011074915683517853 3.4870093276789498 -0.0010333100023368995 3.520116960461199 2406.063630272549 -4.073914206947664
          -0.0013522302421430747 -4.316136145040371 0.013886760144184032 -0.000023191794753074483 -0.004883451055908632 0.000021183863282203647
          -0.008957242332288923 -2.710591815298783 0.010902919668410213 0.000026982277631759644 0.008770794340700808 -0.000052094459533691406
....

```

How can I fix this?

Thank you very much for your 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: [March 19, 2024, 12:40pm UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/2 "2024-03-19T12:40:32Z")

</div>

please share your data.

---

<div class="post-metadata">

### Author: ![Boone](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@Boone](https://discourse.paraview.org/u/Boone)
#### Post date: [March 19, 2024, 12:56pm UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/3 "2024-03-19T12:56:00Z")

</div>

Please find attached the result file used to load the data with Paraview, the state, and the .vtu file obtained.  
[data\_0\_0.vtu](https://discourse.paraview.org/uploads/short-url/7VFibDiM2w33jokDeqrLXctrt25.vtu) (170.3 KB)  
[postprocessing.zip](https://discourse.paraview.org/uploads/short-url/7ap1m4jVRFZzfWVPMdu7MWrUYQw.zip) (81.4 KB)  
[data.pvsm](https://discourse.paraview.org/uploads/short-url/zejvx1W1kdgPfysW706U2qkO6iO.pvsm) (1008.4 KB)

---

<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: [March 20, 2024, 8:40am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/4 "2024-03-20T08:40:57Z")

</div>

> [@Boone](#):
>
> I notice that there are only 6 columns, despite the NumberOfComponents is 9:

The number of columns does not matter at all, component are just read in order.

---

<div class="post-metadata">

### Author: ![Boone](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@Boone](https://discourse.paraview.org/u/Boone)
#### Post date: [March 20, 2024, 9:33am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/5 "2024-03-20T09:33:20Z")

</div>

The issue is that I use the .vtu generated with a mesh tool (mmg3d) that is expecting as many columns as the number of components. To solve it, I defined a macro with emacs to rearrange the data in the .vtu file. Thank you for your answer.

---

<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: [March 20, 2024, 9:34am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/6 "2024-03-20T09:34:24Z")

</div>

> [@Boone](#):
>
> mesh tool (mmg3d) that is expecting as many columns as the number of components.

Thats a bug in mmg3d. But if you only export, I dont see why it is an issue.

---

<div class="post-metadata">

### Author: ![Boone](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@Boone](https://discourse.paraview.org/u/Boone)
#### Post date: [March 20, 2024, 10:02am UTC](https://discourse.paraview.org/t/vtu-file-wrong-number-of-components/14202/7 "2024-03-20T10:02:46Z")

</div>

Sorry I made a mistake:

The issue is that I use the .vtu generated **by Paraview** with a mesh tool (mmg3d) that is expecting as many columns as the number of components.
