-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
72 lines (55 loc) · 1.45 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#exec(open('main.py').read())
import openseespy.opensees as ops
import os
import math
from collections import defaultdict
#import openseespy.postprocessing.Get_Rendering as opsplt
# set model builder
ops.wipe()
ops.model('basic', '-ndm', 2, '-ndf', 2)
# paraview out
data_name = 'out/model_16'
exec(open('code/out_paraview.py').read())
exec(open('code/units.py').read())
# define and make nDMaterial
exec(open('code/mat_prop.py').read())
# read 'msh' file
f_name = 'gmsh/mesh_4.msh'
exec(open('code/read_msh.py').read())
n_ele = len(Ele)
# create nodes
for i in range(n_node):
ops.node(i+1, *Node[i][1:])
# element thickness
b = 1*m
# rayleigh damping parameters
exec(open('code/damp.py').read())
# create elements
for i in range(n_ele):
if (Ele[i][0] > 0):
ops.element('quad', i+1, *Ele[i][2:], b, 'PlaneStrain', Ele[i][0])
# ops.setElementRayleighDampingFactors(i+1,a0,0,0,a1)
#opsplt.plot_model()
# make viscous boundarys
exec(open('code/vis_bound.py').read())
#exec(open('code/fix_bound.py').read())
# rayleigh damping
#ops.rayleigh(a0,0,0,a1)
#opsplt.plot_model()
exec(open('code/load.py').read())
# analysis commands
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('UmfPack')
#ops.test('EnergyIncr', 1.0e-8, 6)
ops.algorithm('Linear')
ops.integrator('Newmark', 0.5, 0.25)
ops.analysis('Transient')
# records
#exec(open('code/rec.py').read())
# timers
ops.start()
for i in range(400):
ops.analyze(1,0.001)
print(i)
ops.stop()