@@ -1043,8 +1043,8 @@ def calc_plastic(progress=None):
10431043 calc_plastic ()
10441044
10451045 def calculate_stress (self , N = 0 , Vx = 0 , Vy = 0 , Mxx = 0 , Myy = 0 , M11 = 0 , M22 = 0 , Mzz = 0 ):
1046- """Calculates the cross-section stress resulting from design actions and returns a
1047- :class:`~sectionproperties.analysis.section.StressPost` object allowing
1046+ """Calculates the cross-section stress resulting from design actions and returns
1047+ a :class:`~sectionproperties.analysis.section.StressPost` object allowing
10481048 post-processing of the stress results.
10491049
10501050 :param float N: Axial force
@@ -1055,33 +1055,36 @@ def calculate_stress(self, N=0, Vx=0, Vy=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0):
10551055 :param float M11: Bending moment about the centroidal 11-axis
10561056 :param float M22: Bending moment about the centroidal 22-axis
10571057 :param float Mzz: Torsion moment about the centroidal zz-axis
1058+
10581059 :return: Object for post-processing cross-section stresses
10591060 :rtype: :class:`~sectionproperties.analysis.section.StressPost`
10601061
1061- Note that a geometric and warping analysis must be performed before a stress analysis is
1062- carried out::
1062+ Note that a geometric analysis must be performed prior to performing a stress
1063+ analysis. Further, if the shear force or torsion is non-zero a warping analysis
1064+ must also be performed::
10631065
10641066 section = Section(geometry)
10651067 section.calculate_geometric_properties()
10661068 section.calculate_warping_properties()
10671069 stress_post = section.calculate_stress(N=1e3, Vy=3e3, Mxx=1e6)
10681070
1069- :raises RuntimeError: If a geometric and warping analysis have not been performed prior to
1070- calling this method
1071+ :raises RuntimeError: If a geometric and warping analysis (if required) have not
1072+ been performed prior to calling this method
10711073 """
10721074
10731075 # check that a geometric and warping analysis has been performed
1074- if (
1075- None
1076- in [
1077- self .section_props .area ,
1078- self .section_props .ixx_c ,
1079- self .section_props .cx ,
1080- self .section_props .j ,
1081- ]
1082- and self .section_props .omega is None
1083- ):
1084- err = "Perform a geometric and warping analysis before carrying out a stress analysis."
1076+ if None in [
1077+ self .section_props .area ,
1078+ self .section_props .ixx_c ,
1079+ self .section_props .cx ,
1080+ self .section_props .j ,
1081+ ]:
1082+ err = "Perform a geometric analysis before carrying out a stress analysis."
1083+ raise RuntimeError (err )
1084+
1085+ if self .section_props .omega is None and (Vx == 0 or Vy == 0 or Mzz == 0 ):
1086+ err = "Perform a warping analysis before carrying out a stress analysis "
1087+ err += "with non-zero shear forces or torsion moment."
10851088 raise RuntimeError (err )
10861089
10871090 def calc_stress (progress = None ):
0 commit comments