2 #To create RVE for all the three type of boundary conditions, i.e. (Linear dispacemet, traction and periodic)
5 cubit.cmd('brick x 1 y 1 z 1')
7 str1='block 1 ' +' volume 1'; cubit.cmd(str1)
8 str1='block 1 ' +' name "MAT_ELASTIC"'; cubit.cmd(str1)
9 cubit.cmd('block 1 attribute count 2')
10 Elastic=['200', '0.3']
12 str1='block 1 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
15 str1='surface 4 interval '+str(interval); cubit.cmd(str1)
16 cubit.cmd('surface 4 scheme trimesh')
17 cubit.cmd('mesh surface 4')
18 cubit.cmd('surface 6 scheme copy source surface 4 source vertex 4 target vertex 1 source curve 9 target curve 10 nosmoothing')
19 cubit.cmd('mesh surface 6')
21 str1='surface 3 interval '+str(interval); cubit.cmd(str1)
22 cubit.cmd('surface 3 scheme trimesh')
23 cubit.cmd('mesh surface 3')
24 cubit.cmd('surface 5 scheme copy source surface 3 source vertex 7 target vertex 8 source curve 9 target curve 11 nosmoothing')
25 cubit.cmd('mesh surface 5')
27 str1='surface 1 interval '+str(interval); cubit.cmd(str1)
28 cubit.cmd('surface 1 scheme trimesh')
29 cubit.cmd('mesh surface 1')
30 cubit.cmd('surface 2 scheme copy source surface 1 source vertex 4 target vertex 7 source curve 3 target curve 7 nosmoothing')
31 cubit.cmd('mesh surface 2')
33 cubit.cmd('volume 1 scheme tetmesh')
34 cubit.cmd('mesh volume 1')
36 cubit.cmd('set duplicate block elements on')
37 cubit.cmd('block 2 tet all')
38 cubit.cmd('block 2 element type tetra10')
41 cubit.cmd('sideset 101 surface 2 3 4') # all -ve boundary surfaces
42 cubit.cmd('sideset 101 name "NegBoundSurf"')
44 cubit.cmd('sideset 102 surface 1 5 6') # all +ve boundary surfaces
45 cubit.cmd('sideset 102 name "PosBoundSurf"')
47 cubit.cmd('sideset 103 surface 1 2 3 4 5 6') # all boundary surfaces
48 cubit.cmd('sideset 103 name "AllBoundSurf"')
51 cubit.cmd('save as "/Users/zahur/Documents/moFEM/mofem-cephas/mofem_v0.2/users_modules/homogenisation/meshes/Cube_HOG.cub" overwrite')
57 #cubit.cmd('brick x 1 y 1 z 1')
59 #cubit.cmd('create cylinder height 2 radius 0.35')
60 #cubit.cmd('subtract volume 2 from volume 1')
62 #str1='block 1 ' +' volume 1'; cubit.cmd(str1)
63 #str1='block 1 ' +' name "MAT_ELASTIC"'; cubit.cmd(str1)
64 #cubit.cmd('block 1 attribute count 2')
65 #Elastic=['200', '0.3']
66 #for i in range(0, 2):
67 # str1='block 1 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
70 #str1='surface 4 interval '+str(interval); cubit.cmd(str1)
71 #cubit.cmd('surface 4 scheme trimesh')
72 #cubit.cmd('mesh surface 4')
73 #cubit.cmd('surface 6 scheme copy source surface 4 source vertex 4 target vertex 1 source curve 9 target curve 10 nosmoothing')
74 #cubit.cmd('mesh surface 6')
76 #str1='surface 3 interval '+str(interval); cubit.cmd(str1)
77 #cubit.cmd('surface 3 scheme trimesh')
78 #cubit.cmd('mesh surface 3')
79 #cubit.cmd('surface 5 scheme copy source surface 3 source vertex 7 target vertex 8 source curve 9 target curve 11 nosmoothing')
80 #cubit.cmd('mesh surface 5')
82 #str1='surface 11 interval '+str(interval); cubit.cmd(str1)
83 #cubit.cmd('surface 11 scheme trimesh')
84 #cubit.cmd('mesh surface 11')
85 #cubit.cmd('surface 12 scheme copy source surface 11 source vertex 4 target vertex 7 source curve 3 target curve 7 nosmoothing')
86 #cubit.cmd('mesh surface 12')
88 #cubit.cmd('volume 1 scheme tetmesh')
89 #cubit.cmd('mesh volume 1')
91 #cubit.cmd('set duplicate block elements on')
92 #cubit.cmd('block 2 tet all')
93 #cubit.cmd('block 2 element type tetra10')
96 #cubit.cmd('sideset 101 surface 12 3 4') # all -ve boundary surfaces
97 #cubit.cmd('sideset 102 surface 11 5 6') # all +ve boundary surfaces
98 #cubit.cmd('sideset 103 surface 11 12 3 4 5 6') # all boundary surfaces
100 #cubit.cmd('save as "/Users/zahur/Documents/moFEM/mofem-cephas/mofem_v0.2/users_modules/homogenisation/meshes/Cube_HOG.cub" overwrite')