Returning data to simulation from catalyst

Is it possible to return data from a catalyst python pipeline to say a c++ simulation?

I think I have some idea of how to return a rendered image with vtk to the simulation.

This should be possible but it’s going to take some customization between the adaptor and the Python scripts. I think you may be able to avoid modifying Catalyst directly to accomplish this goal though.

I guess what you want to do is after calling CoProcess, loop over all the pipelines and see if they have anything to return. After looking through the paraview code though, this makes it seem like its not possible right now.

Alternatively another option is to just have the pipeline save an image and read the image back into the simulation. Thats not very efficient though.

I could just not use catalyst and call vtk directly for now I guess? I really like the idea of a user being able to make their own pipeline and pick which one they want to use at runtime.

Just doing some more digging, I believe the root of the problem is here: https://github.com/Kitware/VTK/blob/master/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx#L595

From what I’ve read PyRun_SimpleString does not let you get at the return value of the string it executes. You need to use PyRun_String for that.