Suppose I have a nonlinearity f(x) of some sort that appears in my PDE. One way of handling the nonlinearity, that works fine, is to project it into an appropriate function space using project:
f = project(u**3, V)
However, when I try to approximate the nonlinearity by interpolation, I get an error:
f = interpolate(u**3, V)
gives
TypeError: in method 'Function_interpolate', argument 2 of type 'dolfin::GenericFunction const &'
If this is not the way to handle interpolation, is there a way to do it?