Bad orientation

Dear colleages,

I am trying to solve a 3D problem on a thick slice with a pentagonal hole.

I have used gmsh to build up the mesh with the following code

cl1=0.5;
Mesh.Format=30;

Point(1)={-1,0,0,cl1};
Point(2)={1,0,0,cl1};
Point(3)={-1.8,-1,0,cl1};
Point(4)={1.8,-1,0,cl1};
Point(5)={0,-2,0,cl1};

Point(6)={-1,0,-5,cl1};
Point(7)={1,0,-5,cl1};
Point(8)={-1.8,-1,-5,cl1};
Point(9)={1.8,-1,-5,cl1};
Point(10)={0,-2,-5,cl1};

Point(11)={-5,3,0,cl1};
Point(12)={5,3,0,cl1};
Point(13)={-5,-15,0,cl1};
Point(14)={5,-15,0,cl1};

Point(15)={-5,3,-5,cl1};
Point(16)={5,3,-5,cl1};
Point(17)={-5,-15,-5,cl1};
Point(18)={5,-15,-5,cl1};

Line(1) = {3, 1};
Line(2) = {1, 2};
Line(3) = {2, 4};
Line(4) = {4, 5};
Line(5) = {5, 3};
Line(6) = {10, 9};
Line(7) = {9, 7};
Line(8) = {7, 6};
Line(9) = {6, 8};
Line(10) = {8, 10};
Line(11) = {10, 5};
Line(12) = {9, 4};
Line(13) = {7, 2};
Line(14) = {6, 1};
Line(15) = {8, 3};
Line(16) = {11, 12};
Line(17) = {12, 14};
Line(18) = {14, 13};
Line(19) = {13, 11};
Line(20) = {13, 17};
Line(21) = {17, 18};
Line(22) = {18, 16};
Line(23) = {16, 15};
Line(24) = {15, 17};
Line(25) = {18, 14};
Line(26) = {12, 16};
Line(27) = {15, 11};
Line Loop(1) = {5, -15, 10, 11};
Plane Surface(1) = {1};
Line Loop(2) = {11, -4, -12, -6};
Plane Surface(2) = {2};
Line Loop(3) = {12, -3, -13, -7};
Plane Surface(3) = {3};
Line Loop(4) = {13, -2, -14, -8};
Plane Surface(4) = {4};
Line Loop(5) = {14, -1, -15, -9};
Plane Surface(5) = {5};
Line Loop(10) = {23, 27, 16, 26};
Plane Surface(10) = {10};
Line Loop(11) = {22, -26, 17, -25};
Plane Surface(11) = {11};
Line Loop(12) = {21, 25, 18, 20};
Plane Surface(12) = {12};
Line Loop(13) = {27, -19, 20, -24};
Plane Surface(13) = {13};
Line Loop(14) = {16, 17, 18, 19};
Line Loop(15) = {2, 3, 4, 5, 1};
Plane Surface(14) = {14, 15};
Line Loop(16) = {22, 23, 24, 21};
Line Loop(17) = {6, 7, 8, 9, 10};
Plane Surface(15) = {16, 17};
Surface Loop(1) = {14, 10, 15, 11, 12, 13, 1, 5, 4, 3, 2};
Volume(1) = {1};

all look fine but when read the mesh with freefem

load “msh3”;
mesh3 Th(“pentagono.mesh”);

the error is "read mesh ok 0Mesh3, num Tetra:= 41384, num Vertice:= 8636 num boundary Triangles:= 7536 Mesh3::meshS, num Triangles:= 7536, num Vertice:= 3768 num boundary Edges:= 354
read mesh ok 0Mesh3, num Tetra:= 41384, num Vertice:= 8636 num boundary Triangles:= 7536
Mesh3::meshS, num Triangles:= 7536, num Vertice:= 3768 num boundary Edges:= 354
Bad orientation: The adj border element defined by [ 16 246 ] is oriented in the same direction in element 3922 and in the element 446 ****** bug in mesh construction? orientation parameter?
"

I do not know if freefem has the capability of handling with this.

Does someone deal with a problem like this?

Thanks in advance

Jose

Dear colleages,

I am still working on generating with GMSH and reading the mesh with FreeFem for a slice with a pentagonal hole:
cl1=0.5;
Mesh.Format=1;
// Select older mesh version, for compatibility of FF++
Mesh.MshFileVersion = 2.2;

Point(1)={-1,0,0,cl1};
Point(2)={1,0,0,cl1};
Point(3)={-1.8,-1,0,cl1};
Point(4)={1.8,-1,0,cl1};
Point(5)={0,-2,0,cl1};

Point(6)={-1,0,-5,cl1};
Point(7)={1,0,-5,cl1};
Point(8)={-1.8,-1,-5,cl1};
Point(9)={1.8,-1,-5,cl1};
Point(10)={0,-2,-5,cl1};

Point(11)={-5,3,0,cl1};
Point(12)={5,3,0,cl1};
Point(13)={-5,-15,0,cl1};
Point(14)={5,-15,0,cl1};

Point(15)={-5,3,-5,cl1};
Point(16)={5,3,-5,cl1};
Point(17)={-5,-15,-5,cl1};
Point(18)={5,-15,-5,cl1};

Line(1) = {3, 1};
Line(2) = {1, 2};
Line(3) = {2, 4};
Line(4) = {4, 5};
Line(5) = {5, 3};
Line(6) = {10, 9};
Line(7) = {9, 7};
Line(8) = {7, 6};
Line(9) = {6, 8};
Line(10) = {8, 10};
Line(11) = {10, 5};
Line(12) = {9, 4};
Line(13) = {7, 2};
Line(14) = {6, 1};
Line(15) = {8, 3};
Line(16) = {11, 12};
Line(17) = {12, 14};
Line(18) = {14, 13};
Line(19) = {13, 11};
Line(20) = {13, 17};
Line(21) = {17, 18};
Line(22) = {18, 16};
Line(23) = {16, 15};
Line(24) = {15, 17};
Line(25) = {18, 14};
Line(26) = {12, 16};
Line(27) = {15, 11};
Line Loop(1) = {5, -15, 10, 11};
Plane Surface(1) = {1};
Line Loop(2) = {11, -4, -12, -6};
Plane Surface(2) = {2};
Line Loop(3) = {12, -3, -13, -7};
Plane Surface(3) = {3};
Line Loop(4) = {13, -2, -14, -8};
Plane Surface(4) = {4};
Line Loop(5) = {14, -1, -15, -9};
Plane Surface(5) = {5};
Line Loop(10) = {23, 27, 16, 26};
Plane Surface(10) = {10};
Line Loop(11) = {22, -26, 17, -25};
Plane Surface(11) = {11};
Line Loop(12) = {21, 25, 18, 20};
Plane Surface(12) = {12};
Line Loop(13) = {27, -19, 20, -24};
Plane Surface(13) = {13};
Line Loop(14) = {16, 17, 18, 19};
Line Loop(15) = {2, 3, 4, 5, 1};
Plane Surface(14) = {14, 15};
Line Loop(16) = {22, 23, 24, 21};
Line Loop(17) = {6, 7, 8, 9, 10};
Plane Surface(15) = {16, 17};
Surface Loop(1) = {14, 10, 15, 11, 12, 13, 1, 5, 4, 3, 2};
Volume(1) = {1};

when I tried to read the resulting mesh with

// Level of output
verbosity = 10;
//
// Loading of libraries
//
load “msh3”
load “gmsh”;
load “iovtk”;
//load “medit”;
//
// Loading the mesh. It is hardly needed specifying the procedence with gmshload3
//
mesh3 Th3I=gmshload3(“pentagonV2.msh”);

the error message is

5665 vertices
closing file 24009 6078
24009 tetrahedrons
6078 triangles
30459 numElements
– GMesh3 , n V: 5665 , n Elm: 24009 , n B Elm: 6078mes 877 674.198 , bb: (-5 -15 -5) , (5 3 0)
– BuildAdj:nva= 3 4 6078
– warning true boundary element 102 is no in correct orientation
– warning true boundary element 103 is no in correct orientation
– warning true boundary element 104 is no in correct orientation
– warning true boundary element 105 is no in correct orientation
– warning true boundary element 106 is no in correct orientation
– warning true boundary element 107 is no in correct orientation
– warning true boundary element 108 is no in correct orientation
– warning true boundary element 109 is no in correct orientation
– warning true boundary element 110 is no in correct orientation
Warning change orientation of 1938 faces
Warning error in boundary oriention 1938 faces

These are my last efforts after consulting to the GMSH community, but I must confess I am quite lost.

If you have any suggestion, or suspect this could be a bug, any idea will be welcomed

Thank you in advance,

Jose

Here is how you can have FreeFEM reorient the mesh for you.

load "msh3";
lockOrientation = false;
mesh3 Th("pentagono.mesh");
lockOrientation = true;
mesh3 renumbered = Th;
fespace Vh(renumbered, P1);
Vh u = x + y + z;
load "medit"
medit("Th", Th, u);
1 Like