# Q Criterion - Gradient of Unstructured Data set NOT Working

**URL:** https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916
**Category:** ParaView Support
**Created:** [September 2, 2021, 9:32am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916 "2021-09-02T09:32:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Akash](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akash/32/6994_2.png) [@Akash](https://discourse.paraview.org/u/Akash)
#### Post date: [September 2, 2021, 9:32am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/1 "2021-09-02T09:32:31Z")

</div>

I have a CSV file with three cols having velocity magnitude. I reconstructed the velocity vector using the calculator : U:0_iHat+U:1_jHat+U:2\*kHat . Then I applied “Gradient of Unstructured Data set” filter to calc QCriterion but the results I am getting are wrong. QCriterion ranges from 0 to 3.4e+38 there are no negative values which is weird.

I have the foam file in another system where just applied “Gradient of Unstructured Data set” to the velocity results ( I didn’t have to reconstruct as it was already there) and the results are coming properly but same thing is not working with the CSV file even though the velocity contour in both matches

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [September 2, 2021, 11:04am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/2 "2021-09-02T11:04:05Z")

</div>

Does the geometry imported from the CSV file consist of only points?  
If there is no 2d or 3d mesh, the **Gradient of Unstructured Data set** filter will not work as expected.

---

<div class="post-metadata">

### Author: ![Akash](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akash/32/6994_2.png) [@Akash](https://discourse.paraview.org/u/Akash)
#### Post date: [September 2, 2021, 11:42am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/3 "2021-09-02T11:42:46Z")

</div>

Ya, those are just data points. Each data point will have its coordinate system, velocity, pressure info column wise the csv file. So its not possible to use **Gradient of Unstructured Data set** filter ?

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [September 2, 2021, 11:46pm UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/4 "2021-09-02T23:46:59Z")

</div>

By constructing a mesh from data points, you can apply the Gradient of Unstructured Data set filter. There are several filters in ParaView to do this.

- Table To StructuredGrid
- Delaunay 2D / 3D
- Resample To Image
- Point Plane Interpolator
- Point Volume Interpolator  
…

You will need to select the filter that best fits the characteristics of your point data.

---

<div class="post-metadata">

### Author: ![Akash](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akash/32/6994_2.png) [@Akash](https://discourse.paraview.org/u/Akash)
#### Post date: [September 3, 2021, 5:52am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/5 "2021-09-03T05:52:41Z")

</div>

I tried to use table to structureGrid filter but I am getting following error:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f1a06a3caeb8ad1bb3c2537e15cfb3cb3c356536.png)

My csv file has 96921 rows ( 801 x values and 121 y values ) its a 2D mesh ( z column value is same throughout). So in “Whole Extent” I gave this:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/0f0baab3838e91c1dd2d9e9ace0710aa134e52bf.png)

What am I doing wrong?

---

<div class="post-metadata">

### Author: ![pcrepier](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/f4b2a3/32.png) [@pcrepier](https://discourse.paraview.org/u/pcrepier)
#### Post date: [September 3, 2021, 6:06am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/6 "2021-09-03T06:06:39Z")

</div>

try with 0 to 800 and 0 to 120 for the extent.  
now the filters thinks you have a 802 by 122 matrix (one point too much)

---

<div class="post-metadata">

### Author: ![Akash](https://discourse.paraview.org/user_avatar/discourse.paraview.org/akash/32/6994_2.png) [@Akash](https://discourse.paraview.org/u/Akash)
#### Post date: [September 3, 2021, 6:13am UTC](https://discourse.paraview.org/t/q-criterion-gradient-of-unstructured-data-set-not-working/7916/7 "2021-09-03T06:13:03Z")

</div>

Thanks it works 🙂
