[Gmsh] biperiodic conditions on a 3D non-extrudable geometry

gdemesy at physics.utoronto.ca gdemesy at physics.utoronto.ca
Thu Feb 18 15:13:28 CET 2010


Dear Gmsh Users and Developers,

I would need to impose biperiodic boundary conditions on two sets of  
parallel surfaces in the attached geometry (respectively parallel to  
zOx and zOy).

Originally, I was planning to use identical unstructured mesh on these  
surfaces, but as far as I understood, my only options consist in using  
(i) an extrusion of surfaces or (ii) the Transfinite Algo which both  
lead to structured surface mesh.

I have considered these two last options:
(i) I did not manage to extrude the mesh in both directions. Thus,  
after extruding one surface in one direction (say Ox) and deleting all  
the middle entries (as mentioned in  
http://www.geuz.org/pipermail/gmsh/2009/004416.html), I still have to  
extrude it in the Oy direction, which leads me to define some points  
twice (?).

(ii) I tried to use Transfinite Surfaces, like in the attached geo  
file. I used MeshAdapt for the 2D part which generates proper 2D  
meshes. Everything seems to be OK until the 3D meshing part:
- Delaunay overwrites my identical surface mesh as mentioned in some  
past mail.
- Frontal leads to unexpected multiple "Error : Edge a - b multiple  
times in surface mesh"

Is there any workaround?
Should I use Extrude instead?

Eventually, I would like to end up with a fine mesh in the so-called  
groove physical volume (n°6000), and ideally a mesh that goes  
progressively coarser when reaching the top (resp. bottom) of the  
physical region 5000=PML_top (resp. 1000=PML_bot). However, it seems  
that Transfinite doesn't enjoy this kind of setting, e.g.  
"paramaille_hol>paramaille". Would you have any solution in mind,  
compatible with my earlier issue ?

Thank you very much for your time.

Best,

Guillaume Demésy,
Postdoc at University of Toronto.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------- next part --------------
nm = 1e-9;
lambda0    = 700*nm;
n_hol  = 1;
n_sup  = 1;
n_sub  = 1;
paramaille     = 10;
paramaille_pml = 10;
paramaille_hol = 10;
lc_sup     = lambda0/(paramaille*n_sup);
lc_sup_pml = lambda0/(paramaille_pml*n_sup);
lc_sub     = lambda0/(paramaille*n_sub);
lc_sub_pml = lambda0/(paramaille_pml*n_sub);
lc_hol     = lambda0/(paramaille_hol*n_hol);

period_x = 300*nm;
period_y = 300*nm;
h_sup    = 200*nm;
h_hol    = 150*nm;
h_sub    = 200*nm;
PML_bot  = 500*nm;
PML_top  = 500*nm;
d_hol    = 250*nm;
// d_hol    = 100*nm;

Point(1) = {-period_x/2,-period_y/2, -PML_bot-h_sub, lc_sub_pml};
Point(2) = {-period_x/2, period_y/2, -PML_bot-h_sub, lc_sub_pml};
Point(3) = { period_x/2, period_y/2, -PML_bot-h_sub, lc_sub_pml};
Point(4) = { period_x/2,-period_y/2, -PML_bot-h_sub, lc_sub_pml};

Point(5) = {-period_x/2,-period_y/2, -h_sub, lc_sub};
Point(6) = {-period_x/2, period_y/2, -h_sub, lc_sub};
Point(7) = { period_x/2, period_y/2, -h_sub, lc_sub};
Point(8) = { period_x/2,-period_y/2, -h_sub, lc_sub};

Point(9)  = {-period_x/2,-period_y/2, 0, lc_hol};
Point(10) = {-period_x/2, period_y/2, 0, lc_hol};
Point(11) = { period_x/2, period_y/2, 0, lc_hol};
Point(12) = { period_x/2,-period_y/2, 0, lc_hol};

Point(13) = {-period_x/2,-period_y/2, h_hol, lc_hol};
Point(14) = {-period_x/2, period_y/2, h_hol, lc_hol};
Point(15) = { period_x/2, period_y/2, h_hol, lc_hol};
Point(16) = { period_x/2,-period_y/2, h_hol, lc_hol};

Point(17) = {-period_x/2,-period_y/2, h_hol+h_sup, lc_sup};
Point(18) = {-period_x/2, period_y/2, h_hol+h_sup, lc_sup};
Point(19) = { period_x/2, period_y/2, h_hol+h_sup, lc_sup};
Point(20) = { period_x/2,-period_y/2, h_hol+h_sup, lc_sup};

Point(21) = {-period_x/2,-period_y/2, h_hol+h_sup+PML_top, lc_sup_pml};
Point(22) = {-period_x/2, period_y/2, h_hol+h_sup+PML_top, lc_sup_pml};
Point(23) = { period_x/2, period_y/2, h_hol+h_sup+PML_top, lc_sup_pml};
Point(24) = { period_x/2,-period_y/2, h_hol+h_sup+PML_top, lc_sup_pml};


Point(25) = {       0 ,  0       , 0     , lc_hol};
Point(26) = { d_hol/2 ,  0       , 0     , lc_hol};
Point(27) = {-d_hol/2 ,  0       , 0     , lc_hol};
Point(28) = {       0 ,  d_hol/2 , 0     , lc_hol};
Point(29) = {       0 , -d_hol/2 , 0     , lc_hol};

Point(30) = {       0 ,  0       , h_hol , lc_hol};
Point(31) = { d_hol/2 ,  0       , h_hol , lc_hol};
Point(32) = {-d_hol/2 ,  0       , h_hol , lc_hol};
Point(33) = {       0 ,  d_hol/2 , h_hol , lc_hol};
Point(34) = {       0 , -d_hol/2 , h_hol , lc_hol};

Line(7) = {1, 4};
Line(8) = {4, 3};
Line(9) = {3, 2};
Line(10) = {2, 1};
Line(11) = {5, 8};
Line(12) = {8, 7};
Line(13) = {7, 6};
Line(14) = {6, 5};
Line(15) = {9, 12};
Line(16) = {12, 11};
Line(17) = {11, 10};
Line(18) = {10, 9};
Line(19) = {14, 13};
Line(20) = {13, 16};
Line(21) = {16, 15};
Line(22) = {15, 14};
Line(23) = {17, 20};
Line(24) = {20, 19};
Line(25) = {19, 18};
Line(26) = {18, 17};
Line(27) = {21, 24};
Line(28) = {24, 23};
Line(29) = {23, 22};
Line(30) = {22, 21};
Line(31) = {21, 17};
Line(32) = {17, 13};
Line(33) = {13, 9};
Line(34) = {9, 5};
Line(35) = {5, 1};
Line(36) = {24, 20};
Line(37) = {20, 16};
Line(38) = {16, 12};
Line(39) = {12, 8};
Line(40) = {8, 4};
Line(41) = {23, 19};
Line(42) = {19, 15};
Line(43) = {15, 11};
Line(44) = {11, 7};
Line(45) = {7, 3};
Line(46) = {22, 18};
Line(47) = {18, 14};
Line(48) = {14, 10};
Line(49) = {10, 6};
Line(50) = {6, 2};

Circle(51) = {32, 30, 34};
Circle(52) = {34, 30, 31};
Circle(53) = {31, 30, 33};
Circle(54) = {33, 30, 32};
Circle(55) = {27, 25, 29};
Circle(56) = {29, 25, 26};
Circle(57) = {26, 25, 28};
Circle(58) = {28, 25, 27};
Line(59) = {32, 27};
Line(60) = {31, 26};
Line(61) = {29, 34};
Line(62) = {28, 33};

Line Loop(63) = {51, -61, -55, -59};
Ruled Surface(64) = {63};
Line Loop(65) = {52, 60, -56, 61};
Ruled Surface(66) = {65};
Line Loop(67) = {53, -62, -57, -60};
Ruled Surface(68) = {67};
Line Loop(69) = {54, 59, -58, 62};
Ruled Surface(70) = {69};
Line Loop(71) = {51, 52, 53, 54};
Ruled Surface(72) = {71};
Line Loop(73) = {55, 56, 57, 58};
Ruled Surface(74) = {73};
Line Loop(75) = {9, 10, 7, 8};
Plane Surface(76) = {75};
Line Loop(77) = {13, 14, 11, 12};
Plane Surface(78) = {77};
Line Loop(79) = {17, 18, 15, 16};
Plane Surface(80) = {73, 79};
Line Loop(81) = {22, 19, 20, 21};
Plane Surface(82) = {71, 81};
Line Loop(83) = {25, 26, 23, 24};
Plane Surface(84) = {83};
Line Loop(85) = {30, 27, 28, 29};
Plane Surface(86) = {85};
Line Loop(87) = {50, -9, -45, 13};
Plane Surface(88) = {87};
Line Loop(89) = {44, 13, -49, -17};
Plane Surface(90) = {89};
Line Loop(91) = {43, 17, -48, -22};
Plane Surface(92) = {91};
Line Loop(93) = {42, 22, -47, -25};
Plane Surface(94) = {93};
Line Loop(95) = {41, 25, -46, -29};
Plane Surface(96) = {95};
Line Loop(97) = {40, -7, -35, 11};
Plane Surface(98) = {97};
Line Loop(99) = {39, -11, -34, 15};
Plane Surface(100) = {99};
Line Loop(101) = {38, -15, -33, 20};
Plane Surface(102) = {101};
Line Loop(103) = {23, 37, -20, -32};
Plane Surface(104) = {103};
Line Loop(105) = {27, 36, -23, -31};
Plane Surface(106) = {105};
Line Loop(107) = {50, 10, -35, -14};
Plane Surface(108) = {107};
Line Loop(109) = {49, 14, -34, -18};
Plane Surface(110) = {109};
Line Loop(111) = {48, 18, -33, -19};
Plane Surface(112) = {111};
Line Loop(113) = {47, 19, -32, -26};
Plane Surface(114) = {113};
Line Loop(115) = {46, 26, -31, -30};
Plane Surface(116) = {115};
Line Loop(117) = {28, 41, -24, -36};
Plane Surface(118) = {117};
Line Loop(119) = {42, -21, -37, 24};
Plane Surface(120) = {119};
Line Loop(121) = {21, 43, -16, -38};
Plane Surface(122) = {121};
Line Loop(123) = {44, -12, -39, 16};
Plane Surface(124) = {123};
Line Loop(125) = {12, 45, -8, -40};
Plane Surface(126) = {125};


// // Transfinite Line {19,21,18,16} = period_y/lc_hol + 1;
// // Transfinite Line {20,22,15,17} = period_x/lc_hol + 1;

// // parallel to zOx
Transfinite Surface {88}  = {3,2,6,7}     Right;
Transfinite Surface {98}  = {1,4,8,5}     Left;

Transfinite Surface {90}  = {7,6,10,11}   Right;
Transfinite Surface {100} = {5,8,12,9}    Left;

Transfinite Surface {92}  = {11,10,14,15} Right;
Transfinite Surface {102} = {9,12,16,13}  Left;

Transfinite Surface {94}  = {19,18,14,15} Left;
Transfinite Surface {104} = {17,20,13,16} Right;

Transfinite Surface {96}  = {19,18,22,23} Right;
Transfinite Surface {106} = {17,20,24,21} Left;

// // parallel to xOz
Transfinite Surface {126}  = {4,3,7,8}     Right;
Transfinite Surface {108}  = {2,1,5,6}     Left;

Transfinite Surface {124}  = {8,7,11,12}   Right;
Transfinite Surface {110}  = {6,5,9,10}    Left;

Transfinite Surface {122}  = {12,11,15,16} Right;
Transfinite Surface {112}  = {10,9,13,14}  Left;

Transfinite Surface {120}  = {16,15,19,20} Right;
Transfinite Surface {114}  = {14,13,17,18} Left;

Transfinite Surface {118}  = {20,19,23,24} Right;
Transfinite Surface {116}  = {18,17,21,22} Left;


Surface Loop(127) = {92, 122, 102, 112, 80, 82, 70, 64, 66, 68};
Volume(128) = {127};
Surface Loop(129) = {72, 70, 64, 66, 68, 74};
Volume(130) = {129};
Surface Loop(131) = {116, 96, 118, 86, 106, 84};
Volume(132) = {131};
Surface Loop(133) = {84, 114, 94, 120, 104, 82, 72};
Volume(134) = {133};
Surface Loop(135) = {74, 80, 90, 124, 100, 110, 78};
Volume(136) = {135};
Surface Loop(137) = {108, 88, 76, 98, 126, 78};
Volume(138) = {137};

Physical Surface(200) = {126, 124, 122, 120, 118};                 // X +
Physical Surface(201) = {108, 110, 112, 114, 116};                 // X -
Physical Surface(300) = {88, 90, 92, 94, 96};                      // Y +
Physical Surface(301) = {98, 100, 102, 104, 106};                  // Y -
Physical Surface(500) = {76, 86};                                  // Diri
Physical Surface(600) = {78, 80, 82, 84, 72, 74, 64, 66, 68, 70};  // Cont

Physical Volume(1000) = {138};                                     // PML_bot
Physical Volume(2000) = {136};                                     // subs
Physical Volume(3000) = {128};                                     // groove
Physical Volume(4000) = {134};                                     // super
Physical Volume(5000) = {132};                                     // PML_top
Physical Volume(6000) = {130};                                     // hole


// // // Use the frontal algo to make sure that the periodic surface mesh is
// // // not modified when meshing the volume
// // // 2D mesh algorithm (1=MeshAdapt, 5=Delaunay, 6=Frontal)
// // // 3D mesh algorithm (1=Delaunay, 4=Frontal)
Mesh.Algorithm   = 1;
Mesh.Algorithm3D = 4;