Solving PDE in Python to run simulations in Rust

I am doing some simulations for particles mostly in Rust. However, Rust does not seem to have a reliable partial differential equation solver (PDE) so I am using Python to solve the PDE. I am not sure how to even begin implementing Python in Rust other than using PyO3. I have a solution as a VectorFunctionSpace object ( in Python, that I need to reference mutiple times (in Python) to get the electric field at a point for each time step in the simulation.

I am running the simulation portion in Rust because it is much faster than Python, and the speed of the PDE solver should still be faster than running it all in Python.

It looks like DOLFIN is actually mostly written in C++ and python is a convenient interface on top? Using the C++ interface directly from rust would probably be a better option than trying to call the python code.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.