This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Access Expression (from Python) in some C code

+3 votes

Hello everybody,

we currently face a rather unusual problem. We have some non FEM solver for our Problems, that we also solve using FEniCS. The question is now as follows. We define some Expression like:

Expression("x[0] + x[1]")

Now we would like to access this expression from the C code that is interfaced using the Python C API. Optimally, we would interface the generated code behind the expression object as we only get the PyObj reference through the interface. As I understand, the interfacing is done with SWIG in FEniCS. So my question is, whether this can be achieved at all and if so with reasonable effort. Any ideas are much appreciated.

Many thanks in advance,
Jo

asked Apr 20, 2015 by jenom FEniCS Novice (690 points)
...