Select Git revision
mainAntTweakBar.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
InfiniteBox.geo 5.85 KiB
SetFactory("OpenCASCADE");
Function Cuboid
l12 = newl; Line(l12) = {pnt[0], pnt[1]};
l23 = newl; Line(l23) = {pnt[1], pnt[2]};
l34 = newl; Line(l34) = {pnt[2], pnt[3]};
l41 = newl; Line(l41) = {pnt[3], pnt[0]};
l56 = newl; Line(l56) = {pnt[4], pnt[5]};
l67 = newl; Line(l67) = {pnt[5], pnt[6]};
l78 = newl; Line(l78) = {pnt[6], pnt[7]};
l85 = newl; Line(l85) = {pnt[7], pnt[4]};
l15 = newl; Line(l15) = {pnt[0], pnt[4]};
l26 = newl; Line(l26) = {pnt[1], pnt[5]};
l37 = newl; Line(l37) = {pnt[2], pnt[6]};
l48 = newl; Line(l48) = {pnt[3], pnt[7]};
ll1 = newll; Line Loop(ll1) = { l12, l23, l34, l41 };
ll2 = newll; Line Loop(ll2) = { l56, l67, l78, l85 };
ll3 = newll; Line Loop(ll3) = { l12, l26, -l56, -l15 };
ll4 = newll; Line Loop(ll4) = { l23, l37, -l67, -l26 };
ll5 = newll; Line Loop(ll5) = { l34, l48, -l78, -l37 };
ll6 = newll; Line Loop(ll6) = { l41, l15, -l85, -l48 };
s1 = news; Plane Surface(s1) = { ll1 } ;
s2 = news; Plane Surface(s2) = { ll2 } ;
s3 = news; Plane Surface(s3) = { ll3 } ;
s4 = news; Plane Surface(s4) = { ll4 } ;
s5 = news; Plane Surface(s5) = { ll5 } ;
s6 = news; Plane Surface(s6) = { ll6 } ;
sl = newsl; Surface Loop(sl) = { s1, s2, s3, s4, s5, s6 };
v = newv; Volume(v) = { sl };
Printf("Cuboid v=%g", v);
If( Flag_TransfInf )
//Mesh.Algorithm3D = 4;
// (4=Frontal, 5=Frontal Delaunay, 6=Frontal Hex, 7=MMG3D, 9=R-tree)
For num In { l12:l85 }
Transfinite Line{ num } = 10;
EndFor
For num In { l15:l48 }
Transfinite Line{ num } = 5;
EndFor
For num In { s1:s6 }
Transfinite Surface{ num } ;
EndFor
Transfinite Volume{ v } ;
EndIf
Return
DefineConstant[
Flag_InfiniteBox = {1, Choices{0,1}, Name "Infinite box/Add infinite box"}
Flag_TransfInf = {0, Choices{0,1}, Name "Infinite box/Transfinite mesh", Visible 0}
ratioInf = {2, Name "Infinite box/Ratio ext-int", Visible Flag_InfiniteBox}
ratioBox = {1.25, Name "Infinite box/Ratio int-content", Visible Flag_InfiniteBox}
ratioLc = {10, Name "Infinite box/Ratio int-Lc", Visible Flag_InfiniteBox}
xInt = {1, Name "Infinite box/xInt", Visible 0}
yInt = {1, Name "Infinite box/yInt", Visible 0}
zInt = {1, Name "Infinite box/zInt", Visible 0}
xExt = {xInt*ratioInf, Name "Infinite box/xExt", Visible 0}
yExt = {yInt*ratioInf, Name "Infinite box/yExt", Visible 0}
zExt = {zInt*ratioInf, Name "Infinite box/zExt", Visible 0}
xCnt = {0, Name "Infinite box/xCenter", Visible 0}
yCnt = {0, Name "Infinite box/yCenter", Visible 0}
zCnt = {0, Name "Infinite box/zCenter", Visible 0}
];
// Compute parameters related to the Infinite box