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

Does mesh for sphere only apply to surface?

+2 votes

I think this was in fact already asked here:

http://fenicsproject.org/qa/322/how-to-create-a-3d-mesh-for-a-sphere-not-just-a-surface-mesh

But I'm not sure I am convinced of the answer. Here is a relevant bit of code to generate the situation I am talking about:

import dolfin

sphere = dolfin.Sphere(dolfin.Point(0.0, 0.0, 0.0), 5.0)
mesh = dolfin.Mesh(sphere, 32)

dolfin.plot(mesh)
dolfin.interactive()

And it seems from the plot that in fact only the surface is being meshed not the whole volume. Am I missing something here?

Thanks in advance.

asked Jan 30, 2014 by mtrogdon FEniCS Novice (180 points)
edited Jan 30, 2014 by johanhake

1 Answer

+7 votes
 
Best answer

No point of using plot to determine the topological dimension as it only shows the surface of the a 3D mesh anyway. The proper way is to:

print mesh.topology().dim()
answered Jan 30, 2014 by johanhake FEniCS Expert (22,480 points)
selected Jan 30, 2014 by Jan Blechta

Of course. Thanks for the reply, should have known that!

...