v0.14.0
nitsche_test.jou
Go to the documentation of this file.
1 #!python
2 autofactor=5;
3 cubit.cmd('set duplicate block elements on')
4 
5 #=============================================================
6 #Geometry
7 #=============================================================
8 
9 cubit.cmd('reset')
10 
11 cubit.cmd('brick x 1 y 1 z 1')
12 cubit.cmd('create sphere radius 0.3')
13 #cubit.cmd('move Volume 2 x 0.14 y 0.14 z 0.14')
14 cubit.cmd('subtract volume 2 from volume 1 ')
15 cubit.cmd('delete volume 2')
16 
17 #=============================================================
18 #Defining blocks for elastic, transversely-isotropic and potential flow problems
19 #=============================================================
20 
21 vol=['all']
22 mat=['MAT_ELASTIC_1']
23 for i in range(0, 1):
24  str1='block ' + str(i+1) +' volume '+vol[i]; cubit.cmd(str1)
25  str1='block ' + str(i+1) +' name "'+mat[i] + '"'; cubit.cmd(str1)
26 
27 #=============================================================
28 #Surface elements
29 #=============================================================
30 cubit.cmd('sideset 103 surface 1 4 3 2 6 5') # all boundary surfaces
31 cubit.cmd('sideset 102 surface 1 5 6 ') # all -ve boundary surfaces
32 cubit.cmd('sideset 101 surface 2 4 3 ') # all +ve boundary surfaces
33 
34 #=============================================================
35 #Material properties for matrix part
36 #=============================================================
37 
38 cubit.cmd('block 1 attribute count 2')
39 Em=3.5e3; Enu=0.3; #giga to mega as we used dimension in mm
40 
41 Elastic=[str(Em), str(Enu)]
42 for i in range(0, 2):
43  str1='block 1 attribute index ' + str(i+1) +' '+Elastic[i]; cubit.cmd(str1)
44 
45 #=============================================================
46 #Defining surfaces for dispacement, traction and periodic boundary conditions
47 #=============================================================
48 
49 cubit.cmd('surface 1 scheme trimesh')
50 str1='surface 1 size auto factor '+str(autofactor); cubit.cmd(str1)
51 cubit.cmd('mesh surface 1')
52 cubit.cmd('surface 4 scheme trimesh')
53 str1='surface 4 size auto factor '+str(autofactor); cubit.cmd(str1)
54 cubit.cmd('mesh surface 4')
55 cubit.cmd('surface 3 scheme trimesh')
56 str1='surface 3 size auto factor '+str(autofactor); cubit.cmd(str1)
57 cubit.cmd('mesh surface 3')
58 
59 cubit.cmd('surface 2 scheme copy source surface 1 source vertex 2 target vertex 5 source curve 1 target curve 5 nosmoothing')
60 cubit.cmd('mesh surface 2')
61 cubit.cmd('surface 6 scheme copy source surface 4 source vertex 3 target vertex 2 source curve 3 target curve 1 nosmoothing')
62 cubit.cmd('mesh surface 6')
63 cubit.cmd('surface 5 scheme copy source surface 3 source vertex 7 target vertex 8 source curve 9 target curve 11 nosmoothing')
64 cubit.cmd('mesh surface 5')
65 
66 #mesh
67 str1='volume all size auto factor '+str(autofactor); cubit.cmd(str1)
68 cubit.cmd('volume all scheme tetmesh')
69 cubit.cmd('mesh volume all')
70 
71 #=============================================================
72 #High order geomety approximation
73 #=============================================================
74 cubit.cmd('block 5 tet all')
75 cubit.cmd('block 5 element type tetra10')
76