I am using a programmable filter capable of reading cell centered data. It converts some arrays from cell data to point data and then it performs some calculations with the new point-based data (see code below).
However, this firstly requires sending the converted point data arrays to the output and then to call them again in order to perform further calculations with these arrays. This is not memory efficient because I only want to have the new arrays in the output (not the converted ones).
So, how can I read the new point based arrays from vtkCellDataToPointData without storing it in the output?
I provided some data in order to show this. I want only the “NewArray” in the output.
Thanks in advance!
use pass arrays to extract a copy with the arrays of interest
use CellToPoints to operate on the arrays we care about
c2p = vtk.vtkCellDataToPointData()
iterate over blocks and copy in the result
for in_block, output_block in iter:
Further calculation with the point data:
Vx = output_block.PointData[“Vx”]
Vy = output_block.PointData[“Vx”]
NewArray = VxVx+VyVy