Is it possible to pass arguments to a custom ctor of a subclass of Expression from within python without resorting to shared ptrs in the public section of the class? Consider this expression class
namespace dolfin {
class MyFun : public Expression
{
public:
MyFun(const Mesh& mesh): Expression(3), mesh_(mesh) {};
void eval(Array<double>& values, const Array<double>& x, const ufc::cell& ufc_cell) const {
dolfin_assert(ufc_cell.local_facet >= 0);
}
private:
const Mesh& mesh_;
};
}
If the above cpp code is passed as str to dolfin.Expression
I get the following error message:
>>> dolfin.Expression(ccode)
TypeError: new_MyFun() takes exactly one argument (0 given)