Should the following code work? It fails for me with

TypeError: in method 'new_MyFunction', argument 1 of type 
'dolfin::FunctionSpace const &'

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

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

  void eval(double* values, const Data& data) const
  {
    values[0] = sin(data.x[0]);
  }
};
"""

from dolfin import *

mesh = UnitSquare(3, 3)
V = FunctionSpace(mesh, "DG", 0)
v = Function(V, code)

plot(v)

--
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