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

UnitCircleMesh Error

0 votes

Hello,
I am very new in Fenics. I know that some functions have been renamed in the new version of Fenics. For example UnistCircle has been renamed to UnitCircleMesh. I just tried to run the code "membrane1.py" that I got from Fenics website but when I run it I get an error saying
" UnitCircleMesh is not defined".
I tried but I could not fix it. I took a picture of the this error that you can see in the below link:

https://drive.google.com/open?id=0B2no47hz4q0seVZta2NXdXhRZms

Does anybody happen to know where the problem is?! Thanks in advance for your help.

Jafar

asked Oct 20, 2015 by jafar FEniCS Novice (670 points)

2 Answers

0 votes

UnitCircle was removed altogether, so you will need to use the mshr component to make a circular mesh.

answered Oct 20, 2015 by chris_richardson FEniCS Expert (31,740 points)
0 votes

Adding to the answer above:

This is what you need:

domain = mshr.Circle(Point(0.,0.),1.0,60)
mesh = mshr.generate_mesh(domain, 60, "cgal")
answered Oct 20, 2015 by Chaitanya_Raj_Goyal FEniCS User (4,150 points)

Thanks for your response.
I did what you told me. But it seems like mshr is also not defined!

https://drive.google.com/open?id=0B7UyhtsxhIoaNlYwR2Rxc3E1UEE

Do you know where the problem is?!

Making meshes is offloaded to a different package called mshr. You might have to get that before the example will run. (go to https://bitbucket.org/fenics-project/mshr/wiki/Home for mshr)

Does that work for you?

Hello,
Yes. Thanks. It finally worked.

...