Hi!
I want to make a hollow circular structured mesh. I am using the code below. How can I make the first and last edge be the same?
from dolfin import *
import numpy
Theta = 2*pi
ri = 1.0 # Inner radius
ro = 5.0 # Outer radius
nr = 10 # Divisions in r direction
nt = 50 # Divisions in theta direction
mesh = RectangleMesh(Point(ri, 0), Point(ro, 1), nr, nt, "crossed")
x = mesh.coordinates()[:,0]
y = mesh.coordinates()[:,1]
s = 1.3
def cylinder(r, s):
return [r*numpy.cos(Theta*s),r*numpy.sin(Theta*s)]
x_circ, y_circ = cylinder(x, y)
xy_circ_coor = numpy.array([x_circ, y_circ]).transpose()
mesh.coordinates()[:] = xy_circ_coor
plot(mesh, title="hollow cylinder")
interactive()