Hi, in my algorithm (about NS Equation) I need to calculate this term :
$$ U_h = V_h + \nabla \rho_h $$
$ U_h$ is in VectorFunctionSpace(Th, "DG", 2)
$ V_h$ is in VectorFunctionSpace(Th, "CG", 2)
$ \rho_h $ is in FunctionSpace(Th, "CG", 1)
I think $\nabla \rho_h $ is a constant vector on each element but discontinue , so I try these codes to make these functions are all in the same space without changing their value :
interpolate(V_h, VectorFunctionSpace(Th, "DG", 2))
interpolate(grad(rho_h), VectorFunctionSpace(Th, "DG", 2))
the first line is running, but the second line can't run errors are:
File "/usr/lib/python2.7/dist-packages/dolfin/fem/interpolation.py", line 64, in interpolate
Pv.interpolate(v)
TypeError: in method 'Function_interpolate', argument 2 of type 'dolfin::GenericFunction const &'
Thanks & Happy new year!