Skip to content

Commit ae1e20e

Browse files
committed
Torsion results clarified
1 parent 94fa7b8 commit ae1e20e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

PyNite/BeamSegZ.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
@author: D. Craig Brinck, SE
66
"""
7-
from numpy import full
7+
from numpy import full, array
88

99
# %%
1010
# A mathematically continuous beam segment
@@ -138,10 +138,12 @@ def Torsion(self, x = 0):
138138
# The torsional moment is constant across the segment
139139
# This can be updated in the future for distributed torsional forces
140140

141-
if isinstance(x, (int, float)):
142-
return self.T1
143-
else:
141+
#As the return value is not calculated as a function of x (for now), we need to check
142+
#whether x is an array, and if so, return a results array of the same length
143+
if isinstance(x, array):
144144
return full(len(x), self.T1)
145+
else:
146+
return self.T1
145147

146148
def slope(self, x, P_delta=False):
147149
"""Returns the slope of the elastic curve at any point `x` along the segment.

0 commit comments

Comments
 (0)