how to use vtkGradientFilter to get the gradient of each point in an unstructured grid in codes


I am trying to use vtkGradientFilter to calculate the gradient at each point. However I didn’t find an example that fits my need.

What I have is a .vtu file. It is an unstructured grid with 5 triangle cells. What I’d like to do is to get the gradient of each triangle vertex as something like vtkDataSet that I can access the gradient vector value.
testInput.vtu (1.0 KB)

I followed the example here: ( but cannot find a way to print or read the gradient.

Any help would be appreciated! Thank you!