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

Problem with importing mesh from GMESH to FEniCS

0 votes

Hello
I have created a 2D mesh in GMSH and I am trying to import it to the FEniCS. Here is my mesh created in the gmsh:
enter image description here
After importing to the FEniCS by dolfin-converter I am getting this:
enter image description here
As you can see the mesh for the central rectangle is completely missed!
Here is the script of the GEO file:

cl__1 = 1;
Point(1) = {0, 0, 0, 0.001};
Point(2) = {0.015, 0, 0, 0.001};
Point(3) = {0.015, 0.01, 0, 0.001};
Point(4) = {0, 0.01, 0, 0.001};
Point(5) = {0.005, 0.0045, 0, 0.1};
Point(6) = {0.005, 0.0055, 0, 0.1};
Point(7) = {0.01, 0.0055, 0, 0.1};
Point(8) = {0.01, 0.0045, 0, 0.1};

Line(1) = {4, 3};
Line(2) = {2, 3};
Line(3) = {1, 2};
Line(4) = {4, 1};
Line(5) = {6, 7};
Line(6) = {7, 8};
Line(7) = {8, 5};
Line(8) = {5, 6};
Line Loop(11) = {1, -2, -3, -4, -8, -7, -6, -5};
Plane Surface(11) = {11};
Line Loop(12) = {5, 6, 7, 8};
Plane Surface(12) = {12};

Transfinite Surface{12};
Recombine Surface{12};
Transfinite Line{5,7}=40 Using Bump 0.05;
Transfinite Line{6,8}=10 Using Bump 0.05;

Transfinite Line{1,3}=20;
Transfinite Line{2,4}=20;

I already know where the problem is. When I remove this line from the script:

 Recombine Surface{12};

The mesh for the central rectangle is imported but it is not structured anymore as shown in the first figure. Does anybody know how to fix this problem?
Thanks!

asked Jun 7, 2017 by Leo FEniCS Novice (840 points)

1 Answer

0 votes
 
Best answer

As far as I know FEniCS is not supporting QUAD (Q4) element. Try to mesh central region also with triangular element.

Thanks

answered Jun 7, 2017 by hirshikesh FEniCS User (1,890 points)
selected Jun 7, 2017 by Leo

I thought FEniCS supported the quad elements as for the rectangular domains it is better to use quad elements. Anyway, thanks for letting me know.

...