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

1-dimensional Circle mesh

0 votes

Hello

I wish to have a circle as a mesh, but an empty 1-dimensional one, for instance all point |p|=1 in R^2. I have not been able to find this, could anyone be so kind as to help?

asked Apr 4, 2017 by haakon555 FEniCS Novice (330 points)

1 Answer

0 votes
 
Best answer

Hi, one option which gives you piecewise linear approximation of the circle is as follows

from dolfin import *
from mshr import *

domain = Circle(Point(0, 0), 1)
mesh = generate_mesh(domain, 80)

mesh = BoundaryMesh(mesh, 'exterior')
print 'PI is', sum(cell.volume() for cell in cells(mesh))/2 

For higher order approximations, e.g. Gmsh has support for quadratic lines.

answered Apr 5, 2017 by MiroK FEniCS Expert (80,920 points)
selected Apr 5, 2017 by haakon555
...