# GradientOfUnstructuredDataSet VS PythonCalculator's gradient

**URL:** https://discourse.paraview.org/t/gradientofunstructureddataset-vs-pythoncalculators-gradient/3390
**Category:** ParaView Support
**Created:** [January 23, 2020, 3:10pm UTC](https://discourse.paraview.org/t/gradientofunstructureddataset-vs-pythoncalculators-gradient/3390 "2020-01-23T15:10:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hasadi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hasadi](https://discourse.paraview.org/u/hasadi)
#### Post date: [January 23, 2020, 3:10pm UTC](https://discourse.paraview.org/t/gradientofunstructureddataset-vs-pythoncalculators-gradient/3390/1 "2020-01-23T15:10:10Z")

</div>

I try to get gradient of a vector field in Paraview. However using GradientOfUnstructuredDataSet will generate different results than PythonCalculator’s gradient.

Here is my expression input for python calculator: gradient(inputs[0].PointData[‘Txj’])

 ![image](https://discourse.paraview.org/uploads/default/original/2X/0/04da9173b0cce843a6f79352c56f59aff1267854.png)

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [January 23, 2020, 3:22pm UTC](https://discourse.paraview.org/t/gradientofunstructureddataset-vs-pythoncalculators-gradient/3390/2 "2020-01-23T15:22:44Z")

</div>

Try turning on the `Faster Approximation` option for the `Gradient Of Unstructured Data Set` filter. When I tried this and I turned that on, the results seemed to match more closely.

When computing gradients on a finite mesh, you are only able to estimate them using finite differences. And depending on how define the finite differences are defined, you can get different answers. By default, the `Gradient Of Unstructured Data Set` is doing some extra work to make a more accurate gradient.

---

<div class="post-metadata">

### Author: ![hasadi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/h/f475e1/32.png) [@hasadi](https://discourse.paraview.org/u/hasadi)
#### Post date: [January 23, 2020, 3:29pm UTC](https://discourse.paraview.org/t/gradientofunstructureddataset-vs-pythoncalculators-gradient/3390/3 "2020-01-23T15:29:39Z")

</div>

Thanks for your answer,
