1#!python
2cubit.cmd('brick x 2 y 1 z 2')
3cubit.cmd('#{Domain = Id("volume")}')
4cubit.cmd('#{dx = 1/16}')
5cubit.cmd('#{meshSize = dx}')
6cubit.cmd('move vol {Domain} x 1 y 0.5 z 1')
7cubit.cmd('create vertex 0 0 {1-dx} on curve 9')
8cubit.cmd('#{v00 = Id("vertex")}')
9cubit.cmd('create vertex 0 0 {1+dx} on curve 9')
10cubit.cmd('#{v01 = Id("vertex")}')
11cubit.cmd('create vertex {2*dx} 0 {1-dx} on surface 3')
12cubit.cmd('#{v02 = Id("vertex")}')
13cubit.cmd('create vertex {2*dx} 0 {1+dx} on surface 3')
14cubit.cmd('#{v03 = Id("vertex")}')
15cubit.cmd('create curve vertex {v00} vertex {v02} on surface 3')
16cubit.cmd('#{c00 = Id("curve")}')
17cubit.cmd('create curve vertex {v02} vertex {v03} on surface 3')
18cubit.cmd('#{c01 = Id("curve")}')
19cubit.cmd('create curve vertex {v03} vertex {v01} on surface 3 ')
20cubit.cmd('#{c02 = Id("curve")}')
21cubit.cmd('imprint curve {c00} {c01} {c02} with surface 3')
22cubit.cmd('#{patchLC = Id("surface")}')
23cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z 0')
24cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {1-dx}')
25cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {-1+dx}')
26cubit.cmd('surface {patchLC} copy move x {2-2*dx} y 0 z 0')
27cubit.cmd('imprint body all')
28cubit.cmd('delete body 2 3 4 5')
29cubit.cmd('## Unimportant sides and top.')
30cubit.cmd('sideset 1 add surface 1')
31cubit.cmd('sideset 2 add surface 2')
32cubit.cmd('sideset 3 add surface 4')
33cubit.cmd('sideset 4 add surface 6')
34cubit.cmd('sideset 5 add surface 5')
35cubit.cmd('## Bottom with 5 patches cut out.')
36cubit.cmd('sideset 6 add surface 13')
37cubit.cmd('## left center, right center, center front, center back, center center')
38cubit.cmd('sideset 7 add surface 8')
39cubit.cmd('sideset 8 add surface 14')
40cubit.cmd('sideset 9 add surface 15')
41cubit.cmd('sideset 10 add surface 16')
42cubit.cmd('sideset 11 add surface 17')
43cubit.cmd('volume all size {meshSize}')
44cubit.cmd('mesh volume all')
45cubit.cmd('brick x 2 y 1 z 2')
46cubit.cmd('#{Domain = Id("volume")}')
47cubit.cmd('#{dx = 1/8}')
48cubit.cmd('#{meshSize = dx}')
49cubit.cmd('move vol {Domain} x 1 y 0.5 z 1')
50cubit.cmd('create vertex 0 0 {1-dx} on curve 9')
51cubit.cmd('#{v00 = Id("vertex")}')
52cubit.cmd('create vertex 0 0 {1+dx} on curve 9')
53cubit.cmd('#{v01 = Id("vertex")}')
54cubit.cmd('create vertex {2*dx} 0 {1-dx} on surface 3')
55cubit.cmd('#{v02 = Id("vertex")}')
56cubit.cmd('create vertex {2*dx} 0 {1+dx} on surface 3')
57cubit.cmd('#{v03 = Id("vertex")}')
58cubit.cmd('create curve vertex {v00} vertex {v02} on surface 3')
59cubit.cmd('#{c00 = Id("curve")}')
60cubit.cmd('create curve vertex {v02} vertex {v03} on surface 3')
61cubit.cmd('#{c01 = Id("curve")}')
62cubit.cmd('create curve vertex {v03} vertex {v01} on surface 3 ')
63cubit.cmd('#{c02 = Id("curve")}')
64cubit.cmd('imprint curve {c00} {c01} {c02} with surface 3')
65cubit.cmd('#{patchLC = Id("surface")}')
66cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z 0')
67cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {1-dx}')
68cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {-1+dx}')
69cubit.cmd('surface {patchLC} copy move x {2-2*dx} y 0 z 0')
70cubit.cmd('imprint body all')
71cubit.cmd('delete body 2 3 4 5')
72cubit.cmd('## Unimportant sides and top.')
73cubit.cmd('sideset 1 add surface 1')
74cubit.cmd('sideset 2 add surface 2')
75cubit.cmd('sideset 3 add surface 4')
76cubit.cmd('sideset 4 add surface 6')
77cubit.cmd('sideset 5 add surface 5')
78cubit.cmd('## Bottom with 5 patches cut out.')
79cubit.cmd('sideset 6 add surface 13')
80cubit.cmd('## left center, right center, center front, center back, center center')
81cubit.cmd('sideset 7 add surface 8')
82cubit.cmd('sideset 8 add surface 14')
83cubit.cmd('sideset 9 add surface 15')
84cubit.cmd('sideset 10 add surface 16')
85cubit.cmd('sideset 11 add surface 17')
86cubit.cmd('volume all size {meshSize}')
87cubit.cmd('mesh volume all')
88