14.7.5. Plot steel and reinforced concrete fiber sections (ops_vis)ΒΆ
Example .py
file can be downloaded here
:
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 | import openseespy.opensees as ops
import openseespy.postprocessing.ops_vis as opsv
# import opensees as ops # local compilation
# import ops_vis as opsv # local
import matplotlib.pyplot as plt
ops.wipe()
ops.model('basic', '-ndm', 2, '-ndf', 3) # frame 2D
# 1. rotated steel shape
fib_sec_1 = [['section', 'Fiber', 1, '-GJ', 1.0e6],
['patch', 'quad', 1, 4, 1, 0.032, 0.317, -0.311, 0.067, -0.266, 0.005, 0.077, 0.254],
['patch', 'quad', 1, 1, 4, -0.075, 0.144, -0.114, 0.116, 0.075, -0.144, 0.114, -0.116],
['patch', 'quad', 1, 4, 1, 0.266, -0.005, -0.077, -0.254, -0.032, -0.317, 0.311, -0.067]
]
# fib_sec_1 list can be used both for plotting and OpenSees commands defining
# the actual fiber section in the OpenSees domain. Normally you would have to
# use regular section('Fiber', ...), fiber(), layer(), patch() commands with
# the same data to define the fiber section. However do not use both
# ways in the same model.
# opsv.fib_sec_list_to_cmds(fib_sec_1)
# 2. RC section
Bcol = 0.711
Hcol = Bcol
c = 0.076 # cover
y1col = Hcol/2.0
z1col = Bcol/2.0
y2col = 0.5*(Hcol-2*c)/3.0
nFibZ = 1
nFib = 20
nFibCover, nFibCore = 2, 16
As9 = 0.0006446
fib_sec_2 = [['section', 'Fiber', 3, '-GJ', 1.0e6],
['patch', 'rect', 2, nFibCore, nFibZ, c-y1col, c-z1col, y1col-c, z1col-c],
['patch', 'rect', 3, nFib, nFibZ, -y1col, -z1col, y1col, c-z1col],
['patch', 'rect', 3, nFib, nFibZ, -y1col, z1col-c, y1col, z1col],
['patch', 'rect', 3, nFibCover, nFibZ, -y1col, c-z1col, c-y1col, z1col-c],
['patch', 'rect', 3, nFibCover, nFibZ, y1col-c, c-z1col, y1col, z1col-c],
['layer', 'straight', 4, 4, As9, y1col-c, z1col-c, y1col-c, c-z1col],
['layer', 'straight', 4, 2, As9, y2col, z1col-c, y2col, c-z1col],
['layer', 'straight', 4, 2, As9, -y2col, z1col-c, -y2col, c-z1col],
['layer', 'straight', 4, 4, As9, c-y1col, z1col-c, c-y1col, c-z1col]]
# opsv.fib_sec_list_to_cmds(fib_sec_2)
matcolor = ['r', 'lightgrey', 'gold', 'w', 'w', 'w']
opsv.plot_fiber_section(fib_sec_1, matcolor=matcolor)
plt.axis('equal')
# plt.savefig('fibsec_wshape.png')
matcolor = ['r', 'lightgrey', 'gold', 'w', 'w', 'w']
opsv.plot_fiber_section(fib_sec_2, matcolor=matcolor)
plt.axis('equal')
# plt.savefig('fibsec_rc.png')
plt.show()
|