Hello, I'm new to Fenics (running it in Ubuntu 12.04 LTS) and trying various meshes from the tutorial (Section 1.4.2. in the FEniCS book). However running the code
Theta = pi/2
a, b = 1, 5.0
nr = 10 # divisions in r direction
nt = 20 # divisions in theta direction
mesh = Rectangle(a, 0, b, 1, nr, nt, "crossed")
# First make a denser mesh towards r=a
x = mesh.coordinates()[:,0]
y = mesh.coordinates()[:,1]
s = 1.3
def denser(x, y):
return [a + (b-a)*((x-a)/(b-a))**s, y]
x_bar, y_bar = denser(x, y)
xy_bar_coor = numpy.array([x_bar, y_bar]).transpose()
mesh.coordinates()[:] = xy_bar_coor
plot(mesh, title="stretched mesh")
def cylinder(r, s):
return [r*numpy.cos(Theta*s), r*numpy.sin(Theta*s)]
x_hat, y_hat = cylinder(x_bar, y_bar)
xy_hat_coor = numpy.array([x_hat, y_hat]).transpose()
mesh.coordinates()[:] = xy_hat_coor
plot(mesh, title="hollow cylinder")
interactive()
results in the error message
TypeError: new_Rectangle expected 4 arguments, got 7
Could it be due to differences between my FEniCS version and the one assumed in the book? I've recently upgraded FEniCS via the package manager. How do I check the version by the way?
Thanks a lot.
Seb