Can vtk.vtkRectilinearGrid Objects be used directly ?

Hi all,
I am new to paraview.
In my python simulation program I want to use paraview to view temporary data.

Now I now that I can generate a RectilinearGridDataset save it in XML format and then use:

grid = simple.OpenDataFile("./test.vtr")
simple.Show(grid)
simple.Render()
simple.Interact()

to generate an Interactive render of the data set.
Is there a way to skip the need for writing the data to a .vtr file and instead use a vtk.vtkRectilinearGrid object directly as source ?

Cheers,
Tim

Yes, using a TrivialProducer.

https://kitware.github.io/paraview-docs/latest/python/paraview.simple.TrivialProducer.html

1 Like

That helped, thanks a lot !
If anyone wants to know,
here is a link to a question that shows how TrivialProducer is used in a similar case.
https://discourse.paraview.org/t/simple-show-trivialproducer-takes-much-time/6826