I am trying to solve Laplace equation on spherical surface using spherical coordinates. First, the mesh coordinates are converted into spherical coordinates and then I have built the functions space and functions on this mesh. But I have failed to write the grad in the weak formulation. The code is
V = FunctionSpace(spherical_mesh, "CG", 1)
u = TrialFunction(V)
v = TestFunctions(V)
w = Function(V)
lamb = .6
f = Expression("lamb*(lamb + 1)*(sin(x[2]))**lamb*sin(lamb*x[1])", lamb = lamb)
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)*Dy(v,2) )*dx
L = inner(f,v)*dx
solve(a == L, w)
I get an error message in compile.log file as 'Manually-specified variables were not used by the project'.
I have checked the code in Support use of coordinates in forms but it is hard to see why the mesh is not used.
Is there any suggestion for me how to write the weak formulation?