Skip to content

[python] Activate python bindings for fufem and provide some fufem python examples

Carsten Gräser requested to merge feature/activate-python-bindings into master

This activates the python bindings for dune-fufem. While, strictly speaking, there are no bindings so far, this allows to use dune-fufem in dune.generator.algorithm code generation.

To demonstrate this, the MR also adds to python examples poisson-pq2.py and linear-elasticity.py which implement the same problem as the corresponding C++ examples. The local assemblers are not written manually but generated using Dune::Fufem::Forms.

Instead of having to write the c++ code for Dune::Fufem::Forms manually, this also provides a rudimentary form of python bindings for Dune::Fufem::Form. These essentially provide lookalike functions of the c++ analogues that generate the necessary c++ expressions as strings which are passed to the dune.generator.algorithm just-in-time compiler utilities.

While this works surprisingly well for just under 300 loc, it's no official part of dune-fufem but just contained in the examples to demonstrate how such bindings could potentially be implemented.

Merge request reports