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('set exodus netcdf4 off')
46cubit.cmd('set large exodus on')
47cubit.cmd('export mesh "/scratch/dpkouri/ROL-Trilinos/packages/rol/example/PDE-OPT/topo-opt/elasticity/wheel1.e" overwrite')
48cubit.cmd('brick x 2 y 1 z 2')
49cubit.cmd('#{Domain = Id("volume")}')
50cubit.cmd('#{dx = 1/8}')
51cubit.cmd('#{meshSize = dx}')
52cubit.cmd('move vol {Domain} x 1 y 0.5 z 1')
53cubit.cmd('create vertex 0 0 {1-dx} on curve 9')
54cubit.cmd('#{v00 = Id("vertex")}')
55cubit.cmd('create vertex 0 0 {1+dx} on curve 9')
56cubit.cmd('#{v01 = Id("vertex")}')
57cubit.cmd('create vertex {2*dx} 0 {1-dx} on surface 3')
58cubit.cmd('#{v02 = Id("vertex")}')
59cubit.cmd('create vertex {2*dx} 0 {1+dx} on surface 3')
60cubit.cmd('#{v03 = Id("vertex")}')
61cubit.cmd('create curve vertex {v00} vertex {v02} on surface 3')
62cubit.cmd('#{c00 = Id("curve")}')
63cubit.cmd('create curve vertex {v02} vertex {v03} on surface 3')
64cubit.cmd('#{c01 = Id("curve")}')
65cubit.cmd('create curve vertex {v03} vertex {v01} on surface 3 ')
66cubit.cmd('#{c02 = Id("curve")}')
67cubit.cmd('imprint curve {c00} {c01} {c02} with surface 3')
68cubit.cmd('#{patchLC = Id("surface")}')
69cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z 0')
70cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {1-dx}')
71cubit.cmd('surface {patchLC} copy move x {1-dx} y 0 z {-1+dx}')
72cubit.cmd('surface {patchLC} copy move x {2-2*dx} y 0 z 0')
73cubit.cmd('imprint body all')
74cubit.cmd('delete body 2 3 4 5')
75cubit.cmd('## Unimportant sides and top.')
76cubit.cmd('sideset 1 add surface 1')
77cubit.cmd('sideset 2 add surface 2')
78cubit.cmd('sideset 3 add surface 4')
79cubit.cmd('sideset 4 add surface 6')
80cubit.cmd('sideset 5 add surface 5')
81cubit.cmd('## Bottom with 5 patches cut out.')
82cubit.cmd('sideset 6 add surface 13')
83cubit.cmd('## left center, right center, center front, center back, center center')
84cubit.cmd('sideset 7 add surface 8')
85cubit.cmd('sideset 8 add surface 14')
86cubit.cmd('sideset 9 add surface 15')
87cubit.cmd('sideset 10 add surface 16')
88cubit.cmd('sideset 11 add surface 17')
89cubit.cmd('volume all size {meshSize}')
90cubit.cmd('mesh volume all')
91