Skip to content

Commit f1753d9

Browse files
committed
set config for debug
1 parent 230c495 commit f1753d9

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

examples/t-shape-1.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from pystran import model
1616
from pystran import section
1717
from pystran import plots
18+
from pystran import beam
1819

1920
# SI units
2021
L = 3.0
@@ -59,27 +60,27 @@
5960
j = m["joints"][id]
6061
print(id, j["displacements"])
6162

62-
# print(m['K'][0:m['nfreedof'], 0:m['nfreedof']])
6363

64-
# print(m['U'][0:m['nfreedof']])
65-
66-
67-
# if norm(m['joints'][1]['displacements'] - [-8.59409726e-04, 5.77635277e-05, 5.00764459e-03, 2.39333188e-03, -1.62316861e-03, 6.81331291e-04]) > 1.e-5:
68-
# raise ValueError('Displacement calculation error')
69-
# else:
70-
# print('Displacement calculation OK')
71-
72-
# if norm(m['joints'][2]['displacements'] - [-0.00117605, 0.00325316, 0.00525552, 0.00128843, 0.00172094, -0.00077147]) > 1.e-5:
73-
# raise ValueError('Displacement calculation error')
74-
# else:
75-
# print('Displacement calculation OK')
64+
for k in m["beam_members"].keys():
65+
member = m["beam_members"][k]
66+
connectivity = member["connectivity"]
67+
i, j = m["joints"][connectivity[0]], m["joints"][connectivity[1]]
68+
f = beam.beam_3d_end_forces(member, i, j)
69+
print(f"Member {k}: ")
70+
print(
71+
f" Joint {connectivity[0]}: N={f['Ni']:.5}, Qy={f['Qyi']:.5}, Qz={f['Qzi']:.5}, T={f['Ti']:.5}, My={f['Myi']:.5}, Mz={f['Mzi']:.5}: "
72+
)
73+
print(
74+
f" Joint {connectivity[1]}: N={f['Nj']:.5}, Qy={f['Qyj']:.5}, Qz={f['Qzj']:.5}, T={f['Tj']:.5}, My={f['Myj']:.5}, Mz={f['Mzj']:.5}: "
75+
)
7676

7777
plots.plot_setup(m)
7878
plots.plot_members(m)
79-
# plots.plot_member_numbers(m)
79+
plots.plot_member_numbers(m)
8080
plots.plot_deformations(m, 100.0)
81-
plots.plot_moments(m, 0.00001, "y")
82-
plots.plot_moments(m, 0.00001, "z")
81+
plots.plot_beam_orientation(m, 0.5)
82+
# plots.plot_moments(m, 0.00001, "y")
83+
# plots.plot_moments(m, 0.00001, "z")
8384
# ax = plots.plot_shear_forces(m, scale=0.50e-3)
8485
# ax.set_title('Shear forces')
8586
plots.show(m)

0 commit comments

Comments
 (0)