### Generating mesh on unit sphere by specifying the maximum element size

246
views
0
10 months ago by

Hi all,

I am new to fenics. Is it possible to generate the mesh on unit sphere by specifying the maximum element size rather no-of divisons ?

Community: FEniCS Project

3
10 months ago by
In the FEniCS tutorial, you can find for the unit disk that "The cell size will be (approximately) equal to the diameter of the domain divided by the resolution" (Sec. 2.4.2 Defining the mesh). For the unit sphere, something like this seems to work:
from fenics import Point, mesh
from mshr import Sphere, generate_mesh

cell_size = 0.33
sphere = Sphere(Point(0.0, 0.0, 0.0), radius)

mesh = generate_mesh(sphere, resolution)
print(mesh.hmax())
0
10 months ago by
Thanks for the quick response Adam.
written 10 months ago by Adam Janecka