# probe gradient of FE solution at points inside cell

**URL:** https://discourse.paraview.org/t/probe-gradient-of-fe-solution-at-points-inside-cell/14520
**Category:** ParaView Support
**Created:** [April 30, 2024, 8:45am UTC](https://discourse.paraview.org/t/probe-gradient-of-fe-solution-at-points-inside-cell/14520 "2024-04-30T08:45:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![simonw](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@simonw](https://discourse.paraview.org/u/simonw)
#### Post date: [April 30, 2024, 8:45am UTC](https://discourse.paraview.org/t/probe-gradient-of-fe-solution-at-points-inside-cell/14520/1 "2024-04-30T08:45:34Z")

</div>

[data.vtu](https://discourse.paraview.org/uploads/short-url/ez4Sd33kXZJCMx8UsrPTEGRxtsJ.vtu) (1.4 KB)

Above vtu file consists of four quad cells and contains a displacement u (vector) and pressure (scalar) field. Bilinear FE basis functions are used for interpolating the nodal values.

When I apply gradient filter to displacement field and probe it at points inside cell, the gradient components do not match with bilinear interpolation formula, however, the displacement matches. In FE-program, calculation is as follows:  
u = N\_i u\_i ( i = 1,…,4 and N\_i bilinear basis functions)  
grad\_u = grad(N\_i) u\_i

Example:

Point of evaluation (p) = -0.629564, 3.43459

u(p) = 0.385659, 22.127  
(same as probing in paraview)

grad\_u(p) = -0.621251, 0.0447329, 0.816307, 2.12841  
(paraview = -0.546745, 0.0430582, 1.36277, 2.11613)

As you can see, the displacement at point p is correct and matches bilinear interpolation formula. However, the (in-plane) components of the gradient mismatch.

That said, is the gradient computation in paraview not based on the same interpolation functions as the ones used for interpolating the function itself?
