Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion structuralcodes/sections/_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def compute_area_moments(geometry, material=None):
[0, 1, 0],
mesh_size=self.mesh_size,
)
# Change sign due to moment sign convention
iyz *= -1
# Integrate a dummy strain profile for getting first
# and second moment respect z axis and product moment
(
Expand All @@ -192,13 +194,15 @@ def compute_area_moments(geometry, material=None):
tri=tri,
mesh_size=self.mesh_size,
)
# Change sign due to moment sign convention
izz *= -1
if abs(abs(izy) - abs(iyz)) > 10:
error_str = 'Something went wrong with computation of '
error_str += f'moments of area: iyz = {iyz}, izy = {izy}.\n'
error_str += 'They should be equal but are not!'
raise RuntimeError(error_str)

return abs(sy), abs(sz), abs(iyy), abs(izz), abs(iyz)
return sy, sz, iyy, izz, iyz

# Create a dummy material for integration of area moments
# This is used for J, S etc, not for E_J E_S etc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def prepare_input(
# and stress coefficients for each part.
prepared_input = []
# 1. Rotate section in order to have neutral axis horizontal
angle = atan2(strain[2], strain[1])
angle = -atan2(strain[2], strain[1])

rotated_geom = geo.rotate(angle)
# 2. Get y coordinate of neutral axis in this new CRS
Expand Down