Simulation Application With ParaView

Hi, I am creating a simulation (code written in C++). I want to create a simple frontend which will basically take some inputs and vtk file. I like to incorporate para view visualization and other filters in the frontend which will basically run my C++ code in backend. Any leads how I can incorporate paraView in my frontend form and how to take some inputs from paraview and pass it to my C++ source code?

Are you looking to create a ParaView based application ?

https://www.paraview.org/Wiki/Writing_Custom_Applications

Yes. The idea is to use paraview for visualization, applying forces to regions and meshing. But I am doing this on Mac. Seems like there are a lot of issues on Mac with paraview

That is just not true. ParaView is compatible with ParaView and many users are using ParaView on MacOS perfectly.

If you’ve found any MacOS specific issue, please share it.

Thanks for a quick response. The issue is not with Paraview GUI iteself. I am writing a python script with Pyside2 (which is built on QT) to create a new GUI. But my script would use paraview to display, visualize and apply forces.

Firstly, after installing Paraview GUI, I tried importing paraview, paraview.simple and paraview.qt but it seems to not find these packages in my script. If it run my script from pvpython it get’s rid of paraview and paraview.simple errors but paraview.qt error is still there.

I am writing a python script with Pyside2

Are you using Python or C++ ?

paraview.qt but it seems to not find these packages in my script.

Pyside2 is not included in ParaView python modules.

So I have a backend code written in C++ which is the main part of my application. But for the frontend/GUI I am using Python. As far as I know paraview.qt is not just for Pyside2. For example from paraview.qt import something would give me error that No Module name ‘paraview.qt’ and I could not resolve this issue. What are your suggestions?

paraview.qt is not a thing that exist.

What are your suggestions?

There is a PythonQt plugin which is only available in ParaView master (it was broken for some releases but was recently fixed). That being said, I’d suggest to write your front end in C++, with proper Qt + ParaView C++ code.

Thank you for the suggestions. One last question, so I am planning to make my application commercial and for Qt commercial versions I would have to pay. I am in my initial phases so I was wondering is there any alternate to Qt where I don’t have to pay for the commercial usage?

No suggestions here.

1 Like

Can we use python directly from our console or do we need to use pvpython?

You can use python as you see fit.

If you mean that you want to access ParaView python modules from any python interpreter, yes you can.

Just add ParaView python modules to the PYTHONPATH.

1 Like

Thank you for your response. I have another question related to Qt. I know paraview is built using Qt. And now if I make custom application using paraview (indirectly I am using Qt) so will I need to pay for Qt license if I plan to make my application commercial?

This is not legal advice, consult a (open source specialized) lawyer for legal advice.

If you want a commercial license of Qt, yes you need to pay for it.
If you want a LGPL license license of Qt, there is nothing to pay but you need to respect the LGPL license terms.

Nothing in the LGPL license prevents you to “make you application commercial”.
If you only link against Qt, the LGPL license terms let you license you application as you see fit.

This is not legal advice, consult a (open source specialized) lawyer for legal advice.

1 Like

Thank you so much!
Sorry to bug you again. I tried to add Paraview Python to my PYTHONPATH but still could not import paraview.simple
My paraview python is in: Applications/ParaView-5.11.0.app/Contents/Python/paraview
And I am doing this on mac

You need to use the same python version as the ParaView binary release for this to work, and this may not be reliable.

At some point, you may want to build ParaView yourself and it will just work.

My python version and the binary is the same i.e. 3.9.
By building Paraview myself you mean paraview superbuild?https://gitlab.kitware.com/paraview/paraview-superbuild

No I mean ParaView: https://gitlab.kitware.com/paraview/paraview/-/blob/master/Documentation/dev/build.md

It does not seem to have the section for mac. Does it work for mac?

There is no getting started section for MacOS, but the generic section below is for all supported platforms, which include MacOS.

1 Like