-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainMPI.py
76 lines (59 loc) · 1.62 KB
/
mainMPI.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
73
74
75
76
import openseespy.opensees as ops
import os
import math
from collections import defaultdict
#import openseespy.postprocessing.Get_Rendering as opsplt
# parallel parameters
pid = ops.getPID()
np = ops.getNP()
# set model builder
ops.wipe()
ops.model('basic', '-ndm', 2, '-ndf', 2)
# paraview out
data_name = 'out/model_1'
#exec(open('code/out_paraview.py').read())
exec(open('code/units.py').read())
# parallel
if (pid == 0):
# read 'msh' file
f_name = 'gmsh/mesh_4.msh'
exec(open('code/read_msh.py').read())
n_ele = len(Ele)
# define and make nDMaterial
exec(open('code/mat_prop.py').read())
# create nodes
for i in range(n_node):
ops.node(i+1, *Node[i][1:])
# element thickness
b = 1*mCn = AρVp (3)
Ct = AρVs
# 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())
else:
ops.node(1, 0.0, 0.0)
# analysis commands
ops.constraints('Transformation')
ops.numberer('ParallelPlain')
ops.system('Mumps')
ops.test('NormDispIncr', 1e-6, 6)
ops.algorithm('Newton')
ops.integrator('Newmark', 0.5, 0.25)
ops.analysis('Transient')
# timers
ops.start()
ops.analyze(10,0.001)
ops.stop()
print(ops.nodeDisp(1,1))