On Sunday 20 September 2009 23:32:19 Anders Logg wrote:
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]);
}
};
"""
code ="""
class MyFunction : public Function
{
public:
MyFunction(boost::shared_ptr<FunctionSpace> V) : Function(V) {}
void eval(double* values, const Data& data) const
{
values[0] = sin(data.x[0]);
}
};
"""
Should work.