Skip to content
Snippets Groups Projects
Commit a6a23009 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

No commit message

No commit message
parent ec3890db
No related branches found
No related tags found
No related merge requests found
lc = 0.3;
DefineConstant[ N = {4, Name "Number of elements per edge"} ];
// example of a purely hexahedral mesh using only transfinite
// mesh constraints
// example of a purely hexahedral mesh using transfinite constraints and/or
// extrusion
Point(1) = {-2,0,0,lc};
Point(2) = {-1,0,0,lc};
Point(3) = {-1,1,0,lc};
Point(4) = {-2,1,0,lc};
Point(5) = {-2,0,1,lc};
Point(6) = {-1,0,1,lc};
Point(7) = {-1,1,1,lc};
Point(8) = {-2,1,1,lc};
Point(1) = {-2,0,0};
Point(2) = {-1,0,0};
Point(3) = {-1,1,0};
Point(4) = {-2,1,0};
Point(5) = {-2,0,1};
Point(6) = {-1,0,1};
Point(7) = {-1,1,1};
Point(8) = {-2,1,1};
Line(1) = {4,3};
Line(2) = {3,2};
Line(3) = {2,1};
......@@ -37,7 +37,9 @@ Line Loop(24) = {6,-12,3,10};
Plane Surface(25) = {24};
Surface Loop(1) = {17,-25,-23,-21,19,15};
Volume(1) = {1};
Transfinite Line{1:4,6:13} = 5;
/*
By hand:
Transfinite Line{1:4,6:13} = N+1;
Transfinite Surface {15} = {1,2,3,4};
Transfinite Surface {17} = {5,6,7,8};
Transfinite Surface {19} = {1,5,8,4};
......@@ -45,44 +47,51 @@ Transfinite Surface {21} = {4,8,7,3};
Transfinite Surface {23} = {2,6,7,3};
Transfinite Surface {25} = {1,5,6,2};
Transfinite Volume{1} = {1,2,3,4,5,6,7,8};
Recombine Surface{15:25:2};
Or automatically:
*/
Transfinite Line "*" = N+1;
Transfinite Surface "*";
Transfinite Volume "*";
Recombine Surface "*";
// the same by extruding a transfinite surface mesh
Point(51) = {0,0,0,lc};
Point(52) = {1,0,0,lc};
Point(53) = {1,1,0,lc};
Point(54) = {0,1,0,lc};
Point(51) = {0,0,0};
Point(52) = {1,0,0};
Point(53) = {1,1,0};
Point(54) = {0,1,0};
Line(51) = {54,53};
Line(52) = {53,52};
Line(53) = {52,51};
Line(54) = {51,54};
Line Loop(55) = {52,53,54,51};
Plane Surface(56) = {55};
Transfinite Line{51:54} = 5;
Transfinite Line{51:54} = N+1;
Transfinite Surface{56} = {51,52,53,54};
Recombine Surface{56};
Extrude {0,0,1} {
Surface{56}; Layers{4}; Recombine;
Surface{56}; Layers{N}; Recombine;
}
// and the same by using only extrusions
Point(100) = {2,0,0,lc};
Point(100) = {2,0,0};
l[] = Extrude {1,0,0}{
Point{100}; Layers{4};
Point{100}; Layers{N};
};
s[] = Extrude {0,1,0}{
Line{l[1]}; Layers{4}; Recombine;
Line{l[1]}; Layers{N}; Recombine;
};
Extrude {0,0,1}{
Surface{s[1]}; Layers{4}; Recombine;
Surface{s[1]}; Layers{N}; Recombine;
}
// add some labels
If(!PostProcessing.NbViews)
View "Mesh Info" {
T3(-1.5,1.5,0.5,66574){ "Pure Transfinite" };
T3(0.5,1.5,0.5,66574){ "Extruded Transfinite" };
T3(2.5,1.5,0.5,66574){ "Pure Extruded" };
};
EndIf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment