v0.14.0
Cube_With_Inclusion.jou
Go to the documentation of this file.
1 #!python
2 #To create RVE for all the three type of boundary conditions, i.e. (Linear dispacemet, traction and periodic)
3 
4 cubit.cmd('new')
5 cubit.cmd('brick x 1 y 1 z 1')
6 
7 interval=5;
8 
9 cubit.cmd('brick x 0.5 y 0.5 z 0.5')
10 
11 cubit.cmd('subtract volume 2 from volume 1 keep')
12 cubit.cmd('delete volume 1')
13 cubit.cmd('imprint volume 2 3')
14 cubit.cmd('merge volume 2 3')
15 
16 str1='surface 13 interval '+str(interval); cubit.cmd(str1)
17 cubit.cmd('surface 13 scheme trimesh')
18 cubit.cmd('mesh surface 13')
19 cubit.cmd('surface 14 scheme copy source surface 13 source vertex 17 target vertex 22 source curve 28 target curve 30 nosmoothing')
20 cubit.cmd('mesh surface 14')
21 
22 str1='surface 18 interval '+str(interval); cubit.cmd(str1)
23 cubit.cmd('surface 18 scheme trimesh')
24 cubit.cmd('mesh surface 18')
25 cubit.cmd('surface 16 scheme copy source surface 18 source vertex 18 target vertex 19 source curve 36 target curve 35 nosmoothing')
26 cubit.cmd('mesh surface 16')
27 
28 str1='surface 17 interval '+str(interval); cubit.cmd(str1)
29 cubit.cmd('surface 17 scheme trimesh')
30 cubit.cmd('mesh surface 17')
31 cubit.cmd('surface 15 scheme copy source surface 17 source vertex 24 target vertex 23 source curve 35 target curve 33 nosmoothing')
32 cubit.cmd('mesh surface 15')
33 
34 interval_inner=interval/2
35 str1='surface 7 8 9 10 11 12 interval '+str(interval_inner); cubit.cmd(str1)
36 cubit.cmd('surface 7 8 9 10 11 12 scheme trimesh')
37 cubit.cmd('mesh surface 7 8 9 10 11 12')
38 
39 cubit.cmd('volume all scheme tetmesh')
40 cubit.cmd('mesh volume all')
41 
42 #Outer part
43 str1='block 1 ' +' volume 3'; cubit.cmd(str1)
44 str1='block 1 ' +' name "MAT_ELASTIC"'; cubit.cmd(str1)
45 cubit.cmd('block 1 attribute count 2')
46 Elastic=['200', '0.3']
47 for i in range(0, 2):
48  str1='block 1 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
49 
50 #Inclusion
51 str1='block 2 ' +' volume 2'; cubit.cmd(str1)
52 str1='block 2 ' +' name "MAT_ELASTIC_Stiff_Inclusion"'; cubit.cmd(str1)
53 cubit.cmd('block 2 attribute count 2')
54 Elastic=['2000', '0.3']
55 for i in range(0, 2):
56  str1='block 2 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
57 
58 
59 cubit.cmd('sideset 101 surface 14 15 16') # all -ve boundary surfaces
60 cubit.cmd('sideset 102 surface 13 17 18') # all +ve boundary surfaces
61 cubit.cmd('sideset 103 surface 14 15 16 13 17 18') # all boundary surfaces
62 
63 cubit.cmd('save as "/Users/zahur/Documents/moFEM/mofem-cephas/mofem_v0.2/users_modules/homogenisation/meshes/RVE_Cube_with_inclusion.cub" overwrite')
64 
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
84 
85 
86 
87 
88 
89 
90 
91 
92 
93 
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107