Dear FEniCS users,
I’d like to compute the mean curvature on curved surface. I referred to the presentation by Marie E. Rognes here. It seems that differential operators on curved surface such grad(), div()
have been implemented in FEniCS.
Take unit sphere for example. I expect the following code will give the mean curvature of unit sphere, which is -1. But the actual results of the following code are very small numbers, like array([ 9.95379322e-12, 9.03699026e-12, -6.24288584e-12, 1.24366276e-11, ...])
. Is there something wrong in the code or misunderstanding of how to use the differential operators on curved surface on my part?
Thanks in advance.
from dolfin import *
import pygalmesh
import meshio
s = pygalmesh.Ball([0, 0, 0], 1.0)
mesh = pygalmesh.generate_surface_mesh(
s, angle_bound=5, radius_bound=0.1, distance_bound=0.1 )
meshio.write("sphere.xml", mesh)
mesh = Mesh("sphere.xml")
order = 3
e_X = Expression(("x[0]", "x[1]", "x[2]"), degree=order)
V0 = VectorFunctionSpace(mesh, "CG", order, dim=3)
V1 = FunctionSpace(mesh, "DG", order-2)
X = project(e_X, V0)
H = project(0.5*dot(div(grad(X)), X), V1)
H.compute_vertex_values()