Reputation: 45
I have a vti
file which contains certain geometry with hexagonal mesh. After a loading step a field variable name "concentration" changes and must be changed back zero. There is one possibility in paraview by hard way. Can any body share a way how to open, edit a field variable and overwrite a vti
file with python.
Thanks.
Upvotes: 1
Views: 514
Reputation: 2488
You can use vtk
python module to do that.
vtkXMLImageDataReader
array = reader.GetOutput().GetCellData().GetArray("concentration")
array.InsertTuple(i, 0)
vtkXMLImageDataWriter
See the read/write example
That is the native VTK solution. There is some other ways, as using numpy to modify the data array, or do it in ParaView python scripting
Upvotes: 2