Dear ParaView community,
I am using ParaView 5.8.0 to post-process some data generated through a fluid dynamics numerical framework. I have a set of paired pvtu and h5part outputs, the first pair corresponding to the initial model run and the following pairs matching each model restart (from a checkpoint). Each file contains a certain number of fields with data distributed at discrete timesteps. My goal is to integrate both in time and space the values given by a specific array contained in the h5part, using data held by arrays in the pvtu. The h5part structure is Polygonal Mesh, but the result of the integration is on a regular, structured mesh, for simplicity (on the post-processing algorithm side). Currently, I use a Programmable Filter to achieve my goal. For each pvtu/h5part, I first apply an Extract Timesteps filter and then a Group Timesteps filter. The Programmable Filter is applied on all resulting Group Timesteps objects in the pipeline, which means that inputs are of type Multi-Block Dataset. I successfully manage to access all the arrays I need from my inputs and generate my final Numpy array which represents values distributed on a regular, 2-D structured grid. At this point, all I have managed to do is to set Output Data Set Type to vtkPolyData and use the information I could extract from the ParaView Guide to properly output the data (I have limited VTK knowledge). This looks like the following:
from vtk.numpy_interface import algorithms as algs from vtk.numpy_interface import dataset_adapter as dsa coords = algs.make_vector(xCoords, yCoords, zCoords) # zCoords is constant for all points pts = vtk.vtkPoints() pts.SetData(dsa.numpyTovtkDataArray(coords, 'Points')) output.SetPoints(pts) numPts = pts.GetNumberOfPoints() ptIds = vtk.vtkIdList() ptIds.SetNumberOfIds(numPts) for i in range(numPts): ptIds.SetId(i, i) output.Allocate(1) output.InsertNextCell(vtk.VTK_POLY_VERTEX, ptIds) output.PointData.append(finalArray, 'myIntegration')
I attach below the result, where finalArray is represented as colored points.
U400Gap15MaIntMelt.pdf (1.9 MB)
I am decently happy with this result, but I am wondering if there is a way to have this data displayed as a surface instead of points? I have tried to make the output of the programmable filter a vtkRectilinearGrid, but I have never managed to properly output anything (that is where my limited VTK knowledge comes into play). I have also tried to apply a Point Plane Interpolator, but I cannot manage to make it work (that is also where my limited VTK knowledge comes into play). I know that my current output is only a subset of the 2-D grid (I have masked the Numpy array), but I would also be happy to use the full grid if that is a requirement to make the representation continuous.
Any help/suggestion greatly appreciated.
EDIT: I have managed to achieve what I wanted through the PointPlaneInterpolator filter. The main difference with before is that I changed the Z-range of the Bounding Box under Plane Bounds to make it contain the Z location of my data, rather than being strictly equal to this latter, which is the default behaviour. Perhaps that is something to look into? Anyway, feel free to close this question.