Example pile

From Nemesis
(Difference between revisions)
Jump to: navigation, search
(Auxiliary File: pile[nc].dat)
m (Main file: pile.slv)
 
(9 intermediate revisions by one user not shown)
Line 126: Line 126:
  
 
###############################################################################
 
###############################################################################
# loadcase
+
# analysis
 
###############################################################################
 
###############################################################################
 
analysis.static()
 
analysis.static()
Line 137: Line 137:
 
</pre>
 
</pre>
  
=Auxiliary File: pile[ns].dat=
+
=Auxiliary file: pile[ns].dat=
 
<pre>
 
<pre>
 
112    -0.8    0
 
112    -0.8    0
Line 195: Line 195:
 
</pre>
 
</pre>
  
=Auxiliary File: pile[np].dat=
+
=Auxiliary file: pile[np].dat=
 
<pre>
 
<pre>
 
210 -0.2 0
 
210 -0.2 0
Line 214: Line 214:
 
</pre>
 
</pre>
  
=Auxiliary File: pile[nc].dat=
+
=Auxiliary file: pile[nc].dat=
 
<pre>
 
<pre>
 
111 -0.4 0
 
111 -0.4 0
Line 227: Line 227:
 
</pre>
 
</pre>
  
=Auxiliary File: pile[es].dat=
+
=Auxiliary file: pile[es].dat=
 
<pre>
 
<pre>
 +
112 111 121 122
 +
113 112 122 123
 +
114 113 123 124
 +
115 114 124 125
 +
116 115 125 126
 +
117 116 126 127
 +
122 121 131 132
 +
123 122 132 133
 +
124 123 133 134
 +
125 124 134 135
 +
126 125 135 136
 +
127 126 136 137
 +
132 131 141 142
 +
133 132 142 143
 +
134 133 143 144
 +
135 134 144 145
 +
136 135 145 146
 +
137 136 146 147
 +
142 141 151 152
 +
143 142 152 153
 +
144 143 153 154
 +
145 144 154 155
 +
146 145 155 156
 +
147 146 156 157
 +
152 151 161 162
 +
153 152 162 163
 +
154 153 163 164
 +
155 154 164 165
 +
156 155 165 166
 +
157 156 166 167
 +
162 161 171 172
 +
163 162 172 173
 +
164 163 173 174
 +
165 164 174 175
 +
166 165 175 176
 +
167 166 176 177
 +
172 171 181 182
 +
173 172 182 183
 +
174 173 183 184
 +
175 174 184 185
 +
176 175 185 186
 +
177 176 186 187
 +
182 181 191 192
 +
183 182 192 193
 +
184 183 193 194
 +
185 184 194 195
 +
186 185 195 196
 +
187 186 196 197
 
</pre>
 
</pre>
  
=Auxiliary File: pile[ep].dat=
+
=Auxiliary file: pile[ep].dat=
 
<pre>
 
<pre>
 +
111 210 220 121
 +
121 220 230 131
 +
131 230 240 141
 +
141 240 250 151
 +
151 250 260 161
 +
161 260 270 171
 +
171 270 280 181
 +
181 280 290 191
 +
210 211 214 220
 +
211 212 215 214
 +
212 213 216 215
 +
213 290 280 216
 +
220 214 240 230
 +
214 215 250 240
 +
215 216 260 250
 +
216 280 270 260
 
</pre>
 
</pre>
 
[[Category:Examples]]
 
[[Category:Examples]]

Latest revision as of 12:28, 12 March 2007

Contents

[edit] Main file: pile.slv

import string
try:
	nsfile = open("pile[ns].dat",'r')
	npfile = open("pile[np].dat",'r')
	ncfile = open("pile[nc].dat",'r')
	esfile = open("pile[es].dat",'r')
	epfile = open("pile[ep].dat",'r')

except IOError:
	sys.exit(0)

domain.dim(3)
db.SQLite("pile")

zs=[0.,1.,2.,3.,4.,5.,6.,7.5,8.0,8.5,9.0,9.5,10.0]
zp=[0.,1.,2.,3.,4.,5.,6.,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0]
zc=[0.,1.,2.,3.,4.,5.,6.,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0]
###############################################################################
# nodes
###############################################################################
nd=[]
# soil nodes
temp=[]
for line in nsfile.readlines():
	words=string.split(line)
	temp.append([int(words[0]),float(words[1]),float(words[2])])
for i in range(len(zs)):
	for j in range(len(temp)):
		nd.append([(i+1)*1000+temp[j][0],temp[j][1],temp[j][2],zs[i]])
# pile nodes
temp=[]
for line in npfile.readlines():
	words=string.split(line)
	temp.append([int(words[0]),float(words[1]),float(words[2])])
for i in range(len(zp)):
	for j in range(len(temp)):
		nd.append([(i+1)*1000+temp[j][0],temp[j][1],temp[j][2],zp[i]])
# common nodes
temp=[]
for line in ncfile.readlines():
	words=string.split(line)
	temp.append([int(words[0]),float(words[1]),float(words[2])])
for i in range(len(zc)):
	for j in range(len(temp)):
		nd.append([(i+1)*1000+temp[j][0],temp[j][1],temp[j][2],zc[i]])

###############################################################################
# elems
###############################################################################
el=[]
# soil elems
temp=[]
for line in esfile.readlines():
	words=string.split(line)
	temp.append([int(words[0]),int(words[1]),int(words[2]),int(words[3])])
for i in range(len(zs)-1):
	for j in range(len(temp)):
		el.append([(i+1)*1000+temp[j][0],(i+1)*1000+temp[j][0],(i+1)*1000+temp[j][1],(i+1)*1000+temp[j][2],(i+1)*1000+temp[j][3],(i+2)*1000+temp[j][0],(i+2)*1000+temp[j][1],(i+2)*1000+temp[j][2],(i+2)*1000+temp[j][3],1])
# pile elems
temp=[]
for line in epfile.readlines():
	words=string.split(line)
	temp.append([int(words[0]),int(words[1]),int(words[2]),int(words[3])])
for i in range(len(zp)-1):
	for j in range(len(temp)):
		el.append([(i+1)*1000+temp[j][0],(i+1)*1000+temp[j][0],(i+1)*1000+temp[j][1],(i+1)*1000+temp[j][2],(i+1)*1000+temp[j][3],(i+2)*1000+temp[j][0],(i+2)*1000+temp[j][1],(i+2)*1000+temp[j][2],(i+2)*1000+temp[j][3],2])


material.plainStrainElasticIsotropic(1, 1E3, 0., 0.)
material.plainStrainElasticIsotropic(2, 1E6, 0., 0.)

for i in range(len(nd)):
	node.add(nd[i][0],nd[i][1],nd[i][2],nd[i][3])

for i in range(len(el)):
	element.brick8d(el[i][0],el[i][1],el[i][2],el[i][3],el[i][4],el[i][5],el[i][6],el[i][7],el[i][8],el[i][9])

###############################################################################
# constraints
###############################################################################
for i in range(len(nd)):
	x=nd[i][1]
	y=nd[i][2]
	z=nd[i][3]
	if z==0:
		node.fix(nd[i][0],1)
		node.fix(nd[i][0],2)
		node.fix(nd[i][0],3)
	elif x==-5.8 or x==5.8:
		node.fix(nd[i][0],1)
	elif y== 0.0 or y==6.5:
		node.fix(nd[i][0],2)
		
###############################################################################
# loadcase
###############################################################################
lc.define(1,"horizontal")
h=len(zp)
p=10
load.node(h*1000+111,1,p)
load.node(h*1000+121,1,p)
load.node(h*1000+131,1,p)
load.node(h*1000+141,1,p)
load.node(h*1000+151,1,p)
load.node(h*1000+161,1,p)
load.node(h*1000+171,1,p)
load.node(h*1000+181,1,p)
load.node(h*1000+191,1,p)
load.node(h*1000+210,1,p)
load.node(h*1000+211,1,p)
load.node(h*1000+212,1,p)
load.node(h*1000+213,1,p)
load.node(h*1000+290,1,p)
load.node(h*1000+220,1,p)
load.node(h*1000+214,1,p)
load.node(h*1000+215,1,p)
load.node(h*1000+216,1,p)
load.node(h*1000+280,1,p)
load.node(h*1000+230,1,p)
load.node(h*1000+240,1,p)
load.node(h*1000+250,1,p)
load.node(h*1000+260,1,p)
load.node(h*1000+270,1,p)

###############################################################################
# analysis
###############################################################################
analysis.static()
reorder.rCM()
soe.band()
analysis.run(1,1)

db.store("pile_soln")
db.exportToVtk("pile_soln")

[edit] Auxiliary file: pile[ns].dat

112     -0.8    0
113     -1.4    0
114     -2.2    0
115     -3.2    0
116     -4.4    0
117     -5.8    0
122     -0.8    0.4483
123     -1.4    0.7845
124     -2.2    1.2328
125     -3.2    1.7931
126     -4.4    2.4655
127     -5.8    3.25
132     -0.8    0.8966
133     -1.4    1.569
134     -2.2    2.4655
135     -3.2    3.5862
136     -4.4    4.931
137     -5.8    6.5
142     -0.4164 0.8966
143     -0.7504 1.569
144     -1.1958 2.4655
145     -1.7525 3.5862
146     -2.4206 4.931
147     -3.2    6.5
152     0       0.8966
153     0       1.569
154     0       2.4655
155     0       3.5862
156     0       4.931
157     0       6.5
162     0.4164  0.8966
163     0.7504  1.569
164     1.1958  2.4655
165     1.7525  3.5862
166     2.4206  4.931
167     3.2     6.5
172     0.8     0.8966
173     1.4     1.569
174     2.2     2.4655
175     3.2     3.5862
176     4.4     4.931
177     5.8     6.5
182     0.8     0.4483
183     1.4     0.7845
184     2.2     1.2328
185     3.2     1.7931
186     4.4     2.4655
187     5.8     3.25
192     0.8     0
193     1.4     0
194     2.2     0
195     3.2     0
196     4.4     0
197     5.8     0

[edit] Auxiliary file: pile[np].dat

210	-0.2	0
211	-0.0843	0
212	0	0
213	0.0843	0
290	0.2	0
220	-0.2	0.1121
214	-0.0843	0.1121
215	0	0.1121
216	0.0843	0.1121
280	0.2	0.1121
230	-0.2	0.2281
240	-0.0843	0.2281
250	0	0.2281
260	0.0843	0.2281
270	0.2	0.2281

[edit] Auxiliary file: pile[nc].dat

111	-0.4	0
121	-0.349	0.1955
131	-0.2644	0.3002
141	-0.1543	0.369
151	0	0.4
161	0.1543	0.369
171	0.2644	0.3002
181	0.349	 0.1955
191	0.4	0

[edit] Auxiliary file: pile[es].dat

112	111	121	122
113	112	122	123
114	113	123	124
115	114	124	125
116	115	125	126
117	116	126	127
122	121	131	132
123	122	132	133
124	123	133	134
125	124	134	135
126	125	135	136
127	126	136	137
132	131	141	142
133	132	142	143
134	133	143	144
135	134	144	145
136	135	145	146
137	136	146	147
142	141	151	152
143	142	152	153
144	143	153	154
145	144	154	155
146	145	155	156
147	146	156	157
152	151	161	162
153	152	162	163
154	153	163	164
155	154	164	165
156	155	165	166
157	156	166	167
162	161	171	172
163	162	172	173
164	163	173	174
165	164	174	175
166	165	175	176
167	166	176	177
172	171	181	182
173	172	182	183
174	173	183	184
175	174	184	185
176	175	185	186
177	176	186	187
182	181	191	192
183	182	192	193
184	183	193	194
185	184	194	195
186	185	195	196
187	186	196	197

[edit] Auxiliary file: pile[ep].dat

111	210	220	121
121	220	230	131
131	230	240	141
141	240	250	151
151	250	260	161
161	260	270	171
171	270	280	181
181	280	290	191
210	211	214	220
211	212	215	214
212	213	216	215
213	290	280	216
220	214	240	230
214	215	250	240
215	216	260	250
216	280	270	260
Personal tools