Creating mesh from list of points on a curved surface

Hi,

I would like to solve the Poisson equation (as in the Poisson equation in FEniCSx tutorial) but on a section of a spherical surface. I have the list of points (x,y,z) on the spherical surface, and I would like to use triangular or quadrilateral elements.

In the tutorial a rectangular mesh is created using the line

domain = mesh.create_unit_square(MPI.COMM_WORLD, 80, 80, mesh.CellType.quadrilateral).

However, I would like to create similar type of domain but by supplying only the list of points on the surface. In this case how can I do that? I have copied my code for generating list of points on the spherical surface.

##############################################
a = 1
thetamin = 0.1np.pi
thetamax = 0.2
np.pi
phimin = 0np.pi
phimax = 0.2
np.pi
phi = phimin
curve =
while (phi <= phimax):
theta = thetamin
while (theta <= thetamax):
xcoor = a * np.cos(theta) * np.cos(phi)
ycoor = a * np.cos(theta) * np.sin(phi)
zcoor = a * np.sin(theta)
curve = curve + [[xcoor, ycoor, zcoor]]
theta = theta + (thetamax-thetamin)/50
phi = phi + (phimax-phimin)/50

curve = np.array(curve)

##################################################

In the above snippet the variable “curve” lists some 3D-points which lie on a spherical surface. How can I now create a mesh using the points listed in the variable “curve”?

See for instance:

or
https://jsdokken.com/dolfinx_docs/meshes.html