I want to use spatial coordinates in a weak formulation.
x = SpatialCoordinate(mesh)
u_exact = (sin(x[2]))**lamb*sin(lamb*x[1])
f = lamb*(lamb + 1.)*(sin(x[2]))**lamb*sin(lamb*x[1])
a = ( Dx(u,0)*Dx(v,0) + 1./(x[0])**2*Dx(u,1)*Dx(v,1) \
+ 1./(x[0]*sin(x[1]))**2*Dx(u,2)*Dx(v,2) )*dx
l = f*v*dx
A = assemble(a)
L = assemble(l)
But I get an error:
TypeError: nb_float should return float object
I would be so happy if there is any suggestion for this error. Moreover, if I try it on other function;
x = SpatialCoordinate(mesh)
u1 = ( expm1( 1./(62.6975 - (x[0]**2 + x[1]**2 + x[2]**2)) ) + 1.)*v*dx
U1 = assemble(u1)
u2 = ( x[0]**2 + x[1]**2 + x[2]**2 )**.5*v*dx
U2 = assemble(u2)
U2 works fine but U1 gives the same type of error. I am not able to get what is wrong. Thanks in advance.