dolfin.compilemodules.expressions.compile_expressions(cppargs, generic_function_members=None, mesh_function_members=None, mpi_comm=None)

Compiles a list of either C++ expressions of full subclasses of dolfin::Expression class.

The expression can either be a str in which case it is interpreted as a scalar expression and a scalar Expression is generated.

If the expression is a tuple consisting of more than one str it is interpreted as a vector expression, and a rank 1 Expression is generated.

A tuple of tuples of str objects is interpreted as a matrix expression, and a rank 2 Expression is generated.

If an expression string contains a name, it is assumed to be a scalar parameter name, and is added as a public member of the generated expression. The names of these parameters are then returned in a list together with the compiled expression class.

If ‘cppargs’ include a class definition it is interpreted as c++ code with complete implementations of a subclasses of dolfin::Expression.

kwargs propagates the default member values for any generated parameter.