# About "gradient of unstructured data set" filter

**URL:** https://discourse.paraview.org/t/about-gradient-of-unstructured-data-set-filter/6935
**Category:** ParaView Support
**Created:** [April 12, 2021, 2:20pm UTC](https://discourse.paraview.org/t/about-gradient-of-unstructured-data-set-filter/6935 "2021-04-12T14:20:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jeff](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://discourse.paraview.org/u/jeff)
#### Post date: [April 12, 2021, 2:20pm UTC](https://discourse.paraview.org/t/about-gradient-of-unstructured-data-set-filter/6935/1 "2021-04-12T14:20:22Z")

</div>

I just started learning CFD  
My problem is that the function of calculating vorticity in the filter is in the source code. I don’t understand the mathematical equation it represents.  
Does anyone know how to write this source code as a mathematical equation.  
The picture is the mathematical equation I want to calculate the vorticity

 ![1](https://discourse.paraview.org/uploads/default/original/2X/8/82a6adbafc93888120c9d57beb5782987a20852e.jpeg) ![2](https://discourse.paraview.org/uploads/default/original/2X/2/2522bfb0cbf18feaaee8fba60a6f94d9462bcf77.jpeg)

---

<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: [April 15, 2021, 12:15am UTC](https://discourse.paraview.org/t/about-gradient-of-unstructured-data-set-filter/6935/2 "2021-04-15T00:15:20Z")

</div>

Hello,

The variable gradients represents the velocity gradient tensor, and each component of the gradients array is as follows:

> gradients[0]=\partial u/\partial x  
> gradients[1]=\partial u/\partial y  
> gradients[2]=\partial u/\partial z  
> gradients[3]=\partial v/\partial x  
> gradients[4]=\partial v/\partial y  
> gradients[5]=\partial v/\partial z  
> gradients[6]=\partial w/\partial x  
> gradients[7]=\partial w/\partial y  
> gradients[8]=\partial w/\partial z

Therefore, the source code, expressed as a mathematical expression, is shown below:

> vorticity[0] = gradients[7]-gradients[5] = \partial w/\partial y - \partial v/\partial z  
> vorticity[1] = gradients[2]-gradients[6] = \partial u/\partial z - \partial w/\partial x  
> vorticity[2] = gradients[3]-gradients[1] = \partial v/\partial x - \partial u/\partial y

---

<div class="post-metadata">

### Author: ![jeff](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://discourse.paraview.org/u/jeff)
#### Post date: [April 15, 2021, 11:36am UTC](https://discourse.paraview.org/t/about-gradient-of-unstructured-data-set-filter/6935/3 "2021-04-15T11:36:22Z")

</div>

Thank you
