|
15 | 15 | from pystran import model |
16 | 16 | from pystran import section |
17 | 17 | from pystran import plots |
| 18 | +from pystran import beam |
18 | 19 |
|
19 | 20 | # SI units |
20 | 21 | L = 3.0 |
|
59 | 60 | j = m["joints"][id] |
60 | 61 | print(id, j["displacements"]) |
61 | 62 |
|
62 | | -# print(m['K'][0:m['nfreedof'], 0:m['nfreedof']]) |
63 | 63 |
|
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 | + ) |
76 | 76 |
|
77 | 77 | plots.plot_setup(m) |
78 | 78 | plots.plot_members(m) |
79 | | -# plots.plot_member_numbers(m) |
| 79 | +plots.plot_member_numbers(m) |
80 | 80 | 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") |
83 | 84 | # ax = plots.plot_shear_forces(m, scale=0.50e-3) |
84 | 85 | # ax.set_title('Shear forces') |
85 | 86 | plots.show(m) |
0 commit comments