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

How to model a rectangular plate with a circular hole

0 votes

Hello
I want to model a rectangular plate with a circular hole in the center and then mesh it. Is there anybody here who has done that before?

asked Dec 11, 2015 by jafar FEniCS Novice (670 points)

2 Answers

+2 votes

Have a look at http://geuz.org/gmsh/, it's pretty straight-forward. You can convert the gmsh mesh to dolfin xml using dolfin-convert.

answered Dec 11, 2015 by rwalt FEniCS Novice (480 points)
+2 votes

Use the mshr-package (https://bitbucket.org/fenics-project/mshr):

from dolfin import *    
import mshr
domain = mshr.Rectangle(Point(0,0), Point(4,1))-mshr.Circle(Point(2,0.5), 0.2)
mesh = mshr.generate_mesh(domain, 60)
plot(mesh, interactive=True)
answered Dec 11, 2015 by Øyvind Evju FEniCS Expert (17,700 points)

Thank you so much for your help.

...