2#To create RVE for all the three type of boundary conditions, i.e. (Linear dispacemet, traction and periodic)
5cubit.cmd('brick x 1 y 1 z 1')
8str1='block 1 ' +' volume 1'; cubit.cmd(str1)
9str1='block 1 ' +' name "MAT_MOISTURE"'; cubit.cmd(str1)
10cubit.cmd('block 1 attribute count 1')
13 str1='block 1 attribute index ' + str(i+1) +' '+Moisture[i]; cubit.cmd(str1)
15str1='surface 4 interval '+str(interval); cubit.cmd(str1)
16cubit.cmd('surface 4 scheme trimesh')
17cubit.cmd('mesh surface 4')
18cubit.cmd('surface 6 scheme copy source surface 4 source vertex 4 target vertex 1 source curve 9 target curve 10 nosmoothing')
19cubit.cmd('mesh surface 6')
21str1='surface 1 interval '+str(interval); cubit.cmd(str1)
22cubit.cmd('surface 1 scheme trimesh')
23cubit.cmd('mesh surface 1')
24cubit.cmd('surface 2 scheme copy source surface 1 source vertex 4 target vertex 7 source curve 3 target curve 7 nosmoothing')
25cubit.cmd('mesh surface 2')
27str1='surface 3 interval '+str(interval); cubit.cmd(str1)
28cubit.cmd('surface 3 scheme trimesh')
29cubit.cmd('mesh surface 3')
30cubit.cmd('surface 5 scheme copy source surface 3 source vertex 7 target vertex 8 source curve 9 target curve 11 nosmoothing')
31cubit.cmd('mesh surface 5')
33cubit.cmd('volume 1 scheme tetmesh')
34cubit.cmd('mesh volume 1')
36cubit.cmd('sideset 101 surface 2 3 4') # all -ve boundary surfaces
37cubit.cmd('sideset 102 surface 1 5 6') # all +ve boundary surfaces
38cubit.cmd('sideset 103 surface 1 2 3 4 5 6') # all boundary surfaces
40cubit.cmd('save as "/Users/zahur/Documents/moFEM/mofem-cephas/mofem_v0.2/users_modules/homogenisation/meshes/Cube_moisture.cub" overwrite')