Is it possible to add member functions to JIT-compiled C++ functions
that will be accessible in Python?

I want to do something like

code = """
class MyFunction : public Function
{
public:

  std::vector<double> _values;

  MyFunction(FunctionSpace& V) : Function(V) {}

  void eval(double* values, const Data& data) const
  {
    values[0] = _values[data.cell().index()];
  }

  void update(stuff)
  {
    // Recompute _values here
  }

};"""

When I try this, the update() function is not accessible from Python.

--
Anders

Attachment: signature.asc
Description: Digital signature

_______________________________________________
DOLFIN-dev mailing list
[email protected]
http://www.fenics.org/mailman/listinfo/dolfin-dev

Reply via email to