def one_vertical_total_stress(self, z_c):
        """
        Determine the vertical total stress at a single depth z_c.

        :param z_c: depth from surface
        """
        total_stress = 0.0
        depths = self.depths
        end = 0
        for layer_int in range(1, len(depths) + 1):
            l_index = layer_int - 1
            if z_c > depths[layer_int - 1]:
                if l_index < len(depths) - 1 and z_c > depths[l_index + 1]:
                    height = depths[l_index + 1] - depths[l_index]
                    bottom_depth = depths[l_index + 1]
                else:
                    end = 1
                    height = z_c - depths[l_index]
                    bottom_depth = z_c

                if bottom_depth <= self.gwl:
                    total_stress += height * self.layer(layer_int).unit_dry_weight
                else:
                    if self.layer(layer_int).unit_sat_weight is None:
                        raise AnalysisError("Saturated unit weight not defined for layer %i." % layer_int)
                    sat_height = bottom_depth - max(self.gwl, depths[l_index])
                    dry_height = height - sat_height
                    total_stress += dry_height * self.layer(layer_int).unit_dry_weight + \
                                    sat_height * self.layer(layer_int).unit_sat_weight
            else:
                end = 1
            if end:
                break
        return total_stress
def one_vertical_total_stress ( self , z_c ) : total_stress = 0.0 depths = self . depths end = 0 for layer_int in range ( 1 , len ( depths ) + 1 ) : l_index = layer_int - 1 if z_c > depths [ layer_int - 1 ] : if l_index < len ( depths ) - 1 and z_c > depths [ l_index + 1 ] : height = depths [ l_index + 1 ] - depths [ l_index ] bottom_depth = depths [ l_index + 1 ] else : end = 1 height = z_c - depths [ l_index ] bottom_depth = z_c if bottom_depth <= self . gwl : total_stress += height * self . layer ( layer_int ) . unit_dry_weight else : if self . layer ( layer_int ) . unit_sat_weight is None : raise AnalysisError ( "Saturated unit weight not defined for layer %i." % layer_int ) sat_height = bottom_depth - max ( self . gwl , depths [ l_index ] ) dry_height = height - sat_height total_stress += dry_height * self . layer ( layer_int ) . unit_dry_weight + sat_height * self . layer ( layer_int ) . unit_sat_weight else : end = 1 if end : break return total_stress
Determine the vertical total stress at a single depth z_c.

        :param z_c: depth from surface