# DataArray with NumberOfComponents=2 not recongnized as vector

**URL:** https://discourse.paraview.org/t/dataarray-with-numberofcomponents-2-not-recongnized-as-vector/15272
**Category:** ParaView Support
**Created:** [August 22, 2024, 3:29am UTC](https://discourse.paraview.org/t/dataarray-with-numberofcomponents-2-not-recongnized-as-vector/15272 "2024-08-22T03:29:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![FrancisGiraldeau](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francisgiraldeau/32/15064_2.png) [@FrancisGiraldeau](https://discourse.paraview.org/u/FrancisGiraldeau)
#### Post date: [August 22, 2024, 3:29am UTC](https://discourse.paraview.org/t/dataarray-with-numberofcomponents-2-not-recongnized-as-vector/15272/1 "2024-08-22T03:29:15Z")

</div>

Here is un unstructured grid with a scalar field and its gradient, which is a vector field with two components. The data loads fine, and the vector data seems correct, but all filters that require a vector input are disabled, such as Glyph and Streamtracer. The only way I was able to get the vector field was to use the Calculator with grad\_X\*iHat+grad\_Y+jHat, which is not necessary, because the vector data is already present.

Here is the paraview data collection to pinpoint the issue. Is there something missing in the XML such that paraview actually interprets the data as a vector, or is it a bug with paraview itself?

Thanks!

 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d0515d7fd25eb82a1edfa6073d1add4fe5ec983b.png)

[ParaView.tar.gz](https://discourse.paraview.org/uploads/short-url/7hLUEks7jmGlVu3OCQY1qII5ttq.gz) (6.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: [August 22, 2024, 8:15am UTC](https://discourse.paraview.org/t/dataarray-with-numberofcomponents-2-not-recongnized-as-vector/15272/2 "2024-08-22T08:15:03Z")

</div>

> [@FrancisGiraldeau](#):
>
> The only way I was able to get the vector field was to use the Calculator with grad\_X\*iHat+grad\_Y+jHat, which is not necessary, because the vector data is already present.

A 2D vector is not a vector in ParaView world, 3 components vectors are needed. Indeed, a Calculator is the easiest way to workaround this, or you could fix your data to contains a 3 component vector instead.

---

<div class="post-metadata">

### Author: ![FrancisGiraldeau](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francisgiraldeau/32/15064_2.png) [@FrancisGiraldeau](https://discourse.paraview.org/u/FrancisGiraldeau)
#### Post date: [August 22, 2024, 11:04am UTC](https://discourse.paraview.org/t/dataarray-with-numberofcomponents-2-not-recongnized-as-vector/15272/3 "2024-08-22T11:04:19Z")

</div>

Ho gosh, that’s right! Works great with a vector of 3 components.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/a/aff0f1ab9d525db2e377c4ede3ab358a1057ffaa.png)

Thanks for the info!
