Hello All,
I have a reader that constructs a vtkUnstructuredGrid object that consists of VTK_TETRA cells. I assign an array at each of the nodes in the vtkUnstructuredGrid object. I would like to use vtkGradientFilter to compute the gradient across the unstructured grid using the array as the input.
I have gone through the following page (https://vtk.org/doc/nightly/html/classvtkGradientFilter.html#abed5e8488ed308deed09cb5daf24838a), but the example provided relies on using ports, but I do not have ports on my unstructuredGrid object (to my knowledge).
This is how I am apptempting to Calculate the gradient:
vtkNew<vtkGradientFilter> gradient;
gradient->SetInputData(unstructuredGrid);
gradient->SetInputScalars(3, "u");
gradient->SetResultArrayName("u_grad");
gradient->Update();
Any Help is greatly appreciated!