This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

UnitSphere mesh?

0 votes

did the UnitSphere mesh from the FEniCS tutorial section 4.1 not make it to version 1.2.0 ?
Neither UnitSquare nor UnitSquareMesh seems to exist in FEniCS 1.2.0.
best, achim.

asked Dec 3, 2013 by achim FEniCS Novice (260 points)

2 Answers

+1 vote

In Dolfin 1.2, its base class has been changed to dolfin.cpp.mesh.CSGPrimitive3D with different algorithm to generate mesh (in my opinion).
You can use the following to generate the unit sphere mesh:

center = Point()
sphere = Sphere(center,1)
mesh = Mesh(sphere,20) # 20 specify the resolution of the mesh

answered Dec 3, 2013 by jying FEniCS User (2,020 points)
+1 vote

UnitSquareMesh is available (UnitSquare is deprecated).

To create a unit sphere with the development version (1.2+) see dolfin/demo/documented/built-in_meshes/. You will require CGAL.

answered Dec 7, 2013 by Garth N. Wells FEniCS Expert (35,930 points)
...