def get_min_max_state_data(self): """ get the surrounding curve of all 'lcc' values """ lcc_arr = self.lcc_arr min_arr = ndmin(lcc_arr, axis=0) max_arr = ndmax(lcc_arr, axis=0) return min_arr, max_arr
def _get_ls_values(self): '''get the outputs for SLS ''' f_ctk = self.f_ctk f_m = self.f_m A = self.ls_table.A # [m**2/m] W = self.ls_table.W # [m**3/m] n_sig1_lo = self.ls_table.n_sig1_lo # [kN/m] m_sig1_lo = self.ls_table.m_sig1_lo # [kNm/m] sig_n_sig1_lo = n_sig1_lo / A / 1000. # [MPa] sig_m_sig1_lo = m_sig1_lo / W / 1000. # [MPa] n_sig1_up = self.ls_table.n_sig1_up m_sig1_up = self.ls_table.m_sig1_up sig_n_sig1_up = n_sig1_up / A / 1000. sig_m_sig1_up = m_sig1_up / W / 1000. eta_n_sig1_lo = sig_n_sig1_lo / f_ctk eta_m_sig1_lo = sig_m_sig1_lo / f_m eta_tot_sig_lo = eta_n_sig1_lo + eta_m_sig1_lo eta_n_sig1_up = sig_n_sig1_up / f_ctk eta_m_sig1_up = sig_m_sig1_up / f_m eta_tot_sig_up = eta_n_sig1_up + eta_m_sig1_up eta_tot = ndmax(hstack([ eta_tot_sig_up, eta_tot_sig_lo]), axis=1)[:, None] return { 'sig_n_sig1_lo':sig_n_sig1_lo, 'sig_m_sig1_lo':sig_m_sig1_lo, 'sig_n_sig1_up':sig_n_sig1_up, 'sig_m_sig1_up':sig_m_sig1_up, 'eta_n_sig1_lo':eta_n_sig1_lo, 'eta_m_sig1_lo':eta_m_sig1_lo, 'eta_tot_sig_lo':eta_tot_sig_lo, 'eta_n_sig1_up':eta_n_sig1_up, 'eta_m_sig1_up':eta_m_sig1_up, 'eta_tot_sig_up':eta_tot_sig_up, 'eta_tot':eta_tot, }
def get_min_max_state_data(self): ''' get the surrounding curve of all 'lcc' values ''' lcc_arr = self.lcc_arr min_arr = ndmin(lcc_arr, axis=0) max_arr = ndmax(lcc_arr, axis=0) return min_arr, max_arr
def _get_max_n_tex( self ): return ndmax( self.n_tex )
def export_hf_lc(self): """exports the hinge forces for each loading case separately """ from matplotlib import pyplot sr_columns = self.sr_columns dict = self.max_sr_grouped_dict length_xy_quarter = self.length_xy_quarter def save_bar_plot( x, y, filename="bla", xlabel="xlabel", ylabel="ylavel", ymin=-10, ymax=10, width=0.1, xmin=0, xmax=1000, figsize=[10, 5], ): fig = pyplot.figure(facecolor="white", figsize=figsize) ax1 = fig.add_subplot(1, 1, 1) ax1.bar(x, y, width=width, align="center", color="blue") ax1.set_xlim(xmin, xmax) ax1.set_ylim(ymin, ymax) ax1.set_xlabel(xlabel, fontsize=22) ax1.set_ylabel(ylabel, fontsize=22) fig.savefig(filename, orientation="portrait", bbox_inches="tight") pyplot.clf() X = array(self.geo_data_dict["X_hf"]) Y = array(self.geo_data_dict["Y_hf"]) # symmetric axes # idx_sym = where(abs(Y[:, 0] - 2.0 * length_xy_quarter) <= 0.0001) X_sym = X[idx_sym].reshape(-1) idx_r0_r1 = where(abs(X[:, 0] - 2.0 * length_xy_quarter) <= 0.0001) X_r0_r1 = Y[idx_r0_r1].reshape(-1) F_int = self.lc_arr for i, lc_name in enumerate(self.lc_name_list): filename = self.lc_list[i].plt_export max_N_ip = max(int(ndmax(F_int[i, :, 0], axis=0)) + 1, 1) max_V_ip = max(int(ndmax(F_int[i, :, 1], axis=0)) + 1, 1) max_V_op = max(int(ndmax(F_int[i, :, 2], axis=0)) + 1, 1) F_int_lc = F_int[i, :, :] # first row N_ip, second V_ip third V_op F_sym = F_int_lc[idx_sym, :].reshape(-1, len(sr_columns)) F_r0_r1 = F_int_lc[idx_r0_r1, :].reshape(-1, len(sr_columns)) save_bar_plot( X_sym, F_sym[:, 0].reshape(-1), # xlabel = '$X$ [m]', ylabel = '$N^{ip}$ [kN]', xlabel="$X$ [m]", ylabel="$N^{*}$ [kN]", filename=filename + "N_ip" + "_sym", xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_N_ip, ymax=max_N_ip, figsize=[10, 5], ) save_bar_plot( X_sym, F_sym[:, 1].reshape(-1), xlabel="$X$ [m]", ylabel="$V_{ip}$ [kN]", filename=filename + "V_ip" + "_sym", xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_V_ip, ymax=max_V_ip, figsize=[10, 5], ) save_bar_plot( X_sym, F_sym[:, 2].reshape(-1), # xlabel = '$X$ [m]', ylabel = '$V_{op}$ [kN]', xlabel="$X$ [m]", ylabel="$V^{*}$ [kN]", filename=filename + "V_op" + "_sym", xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_V_op, ymax=max_V_op, figsize=[10, 5], ) # r0_r1 # save_bar_plot( X_r0_r1, F_r0_r1[:, 0].reshape(-1), # xlabel = '$Y$ [m]', ylabel = '$N_{ip}$ [kN]', xlabel="$Y$ [m]", ylabel="$N^{*}$ [kN]", filename=filename + "N_ip" + "_r0_r1", xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_N_ip, ymax=max_N_ip, figsize=[5, 5], ) save_bar_plot( X_r0_r1, F_r0_r1[:, 1].reshape(-1), xlabel="$Y$ [m]", ylabel="$V_{ip}$ [kN]", filename=filename + "V_ip" + "_r0_r1", xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_V_ip, ymax=max_V_ip, figsize=[5, 5], ) save_bar_plot( X_r0_r1, F_r0_r1[:, 2].reshape(-1), # xlabel = '$Y$ [m]', ylabel = '$V_{op}$ [kN]', xlabel="$Y$ [m]", ylabel="$V^{*}$ [kN]", filename=filename + "V_op" + "_r0_r1", xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_V_op, ymax=max_V_op, figsize=[5, 5], )
def _get_max_eta_R_tot(self): return ndmax(self.eta_R_tot)
def _get_max_Rres(self): return ndmax(self.Rres)
def plot_assess_value(self, title = None, add_assess_values_from_file = None, save_assess_values_to_file = None): '''plot the assess value for all loading case combinations ''' #---------------------------------------- # script to get the maximum values of 'assess_value' # at all given coordinate points for all possible loading # case combinations: #---------------------------------------- # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- assess_value_list = [] for lcc in lcc_list: # get the ls_table object and retrieve its 'ls_class' # (= LSTable_ULS-object) # ls_class = lcc.ls_table.ls_class # get 'assess_name'-column array # assess_name = ls_class.assess_name if assess_name == 'max_eta_nm_tot': assess_value = getattr(ls_class, 'eta_nm_tot') if assess_name == 'max_n_tex': assess_value = getattr(ls_class, 'n_tex') if assess_name == 'max_eta_tot': assess_value = getattr(ls_class, 'eta_tot') # n_tex = ls_class.n_tex_up # n_tex = ls_class.n_tex_lo assess_value_list.append(assess_value) # stack the list to an array in order to use ndmax-function # assess_value_arr = hstack(assess_value_list) print 'assess_value_arr.shape', assess_value_arr.shape #---------------------------------------------- # get the overall maximum values: #---------------------------------------------- assess_value_max = ndmax(assess_value_arr, axis = 1)[:, None] #---------------------------------------------- # plot #---------------------------------------------- # X = lcc_list[0].ls_table.X[:, 0] Y = lcc_list[0].ls_table.Y[:, 0] Z = lcc_list[0].ls_table.Z[:, 0] if self.reader_type == 'RFEM': Z *= -1.0 plot_col = assess_value_max[:, 0] # save assess values to file in order to superpose them later # if save_assess_values_to_file != None: print 'assess_values saved to file %s' %( save_assess_values_to_file ) assess_value_arr = plot_col np.savetxt( save_assess_values_to_file, assess_value_arr ) # add read in saved assess values to be superposed with currently read in assess values # if add_assess_values_from_file != None: print 'superpose assess_value_arr with values read in from file %s' %( add_assess_values_from_file ) assess_value_arr = np.loadtxt( add_assess_values_from_file ) plot_col += assess_value_arr # # if n_tex is negative plot 0 instead: # # # plot_col = where(plot_col < 0, 0, plot_col) mlab.figure(figure = title, bgcolor = (1.0, 1.0, 1.0), fgcolor = (0.0, 0.0, 0.0)) mlab.points3d(X, Y, Z, plot_col, colormap = "YlOrBr", mode = "cube", scale_mode = 'none', scale_factor = 0.10) mlab.scalarbar(title = assess_name + ' (all LCs)', orientation = 'vertical') mlab.show()
def plot_n_tex(self, title = None): '''plot number of textile reinforcement 'n_tex' for all loading case combinations ''' #---------------------------------------- # script to get the maximum number of reinforcement ('n_tex') # at all given coordinate points for all possible loading # case combinations: #---------------------------------------- # set option to "True" for surrounding # evaluation of necessary layers "n_tex" # needed for all loading cases # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- n_tex_list = [] for lcc in lcc_list: # get the ls_table object and retrieve its 'ls_class' # (= LSTable_ULS-object) # ls_class = lcc.ls_table.ls_class # get 'n_tex'-column array # n_tex = ls_class.n_tex # n_tex = ls_class.n_tex_up # n_tex = ls_class.n_tex_lo n_tex_list.append(n_tex) # stack the list to an array in order to use ndmax-function # n_tex_arr = hstack(n_tex_list) #---------------------------------------------- # get the overall maximum values: #---------------------------------------------- n_tex_max = ndmax(n_tex_arr, axis = 1)[:, None] #---------------------------------------------- # plot #---------------------------------------------- # X = lcc_list[0].ls_table.X[:, 0] Y = lcc_list[0].ls_table.Y[:, 0] Z = lcc_list[0].ls_table.Z[:, 0] plot_col = n_tex_max[:, 0] # if n_tex is negative plot 0 instead: # plot_col = where(plot_col < 0, 0, plot_col) mlab.figure(figure = title, bgcolor = (1.0, 1.0, 1.0), fgcolor = (0.0, 0.0, 0.0)) mlab.points3d(X, Y, (-1.0) * Z, plot_col, colormap = "YlOrBr", mode = "cube", scale_mode = 'none', scale_factor = 0.10) mlab.scalarbar(title = 'n_tex (all LCs)', orientation = 'vertical') mlab.show()
def plot_assess_value(self, title=None, add_assess_values_from_file=None, save_assess_values_to_file=None): '''plot the assess value for all loading case combinations ''' #---------------------------------------- # script to get the maximum values of 'assess_value' # at all given coordinate points for all possible loading # case combinations: #---------------------------------------- # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- assess_value_list = [] for lcc in lcc_list: # get the ls_table object and retrieve its 'ls_class' # (= LSTable_ULS-object) # ls_class = lcc.ls_table.ls_class # get 'assess_name'-column array # assess_name = ls_class.assess_name if assess_name == 'max_eta_nm_tot': assess_value = getattr(ls_class, 'eta_nm_tot') if assess_name == 'max_n_tex': assess_value = getattr(ls_class, 'n_tex') if assess_name == 'max_eta_tot': assess_value = getattr(ls_class, 'eta_tot') # n_tex = ls_class.n_tex_up # n_tex = ls_class.n_tex_lo assess_value_list.append(assess_value) # stack the list to an array in order to use ndmax-function # assess_value_arr = hstack(assess_value_list) print 'assess_value_arr.shape', assess_value_arr.shape #---------------------------------------------- # get the overall maximum values: #---------------------------------------------- assess_value_max = ndmax(assess_value_arr, axis=1)[:, None] #---------------------------------------------- # plot #---------------------------------------------- # X = lcc_list[0].ls_table.X[:, 0] Y = lcc_list[0].ls_table.Y[:, 0] Z = lcc_list[0].ls_table.Z[:, 0] if self.reader_type == 'RFEM': Z *= -1.0 plot_col = assess_value_max[:, 0] # save assess values to file in order to superpose them later # if save_assess_values_to_file != None: print 'assess_values saved to file %s' % ( save_assess_values_to_file) assess_value_arr = plot_col np.savetxt(save_assess_values_to_file, assess_value_arr) # add read in saved assess values to be superposed with currently read in assess values # if add_assess_values_from_file != None: print 'superpose assess_value_arr with values read in from file %s' % ( add_assess_values_from_file) assess_value_arr = np.loadtxt(add_assess_values_from_file) plot_col += assess_value_arr # # if n_tex is negative plot 0 instead: # # # plot_col = where(plot_col < 0, 0, plot_col) mlab.figure(figure=title, bgcolor=(1.0, 1.0, 1.0), fgcolor=(0.0, 0.0, 0.0)) mlab.points3d(X, Y, Z, plot_col, colormap="YlOrBr", mode="cube", scale_mode='none', scale_factor=0.10) mlab.scalarbar(title=assess_name + ' (all LCs)', orientation='vertical') mlab.show()
def _get_ls_values(self): '''get the outputs for ULS ''' #------------------------------------------------------------ # get angle of deflection of the textile reinforcement #------------------------------------------------------------ # angle 'beta' denotes the absolute deflection between the textile reinforcement and the # 1st or 2nd principle stress direction; no distiction of the rotation direction is necessary # for orthogonal textiles (standard case); # By default the 0-direction coincides with the x-axis # @todo: generalization of orientation of the 0-direction != x-axis # introduce the angle 'alpha_tex' to define the angle between the global x-axis and the # the 0-direction; then beta = abs(alpha_sig1 - alpha_tex); make sure that the deflection # angle still lies within -/+ pi/2 otherwise rotate by substracting n*pi with n = int(beta/pi) #------------------------------------------- # formulas are valid for the general case R_0 != R_90 #------------------------------------------- #---------------------------------------------------------- # upper side #---------------------------------------------------------- beta_up_deg = abs(self.alpha_sig1_up_deg) # [degree] beta_up = abs(self.alpha_sig1_up) # [rad] n_Rdt_up_1 = self.n_0_Rdt * cos(beta_up) * (1 - beta_up_deg / 90.) + \ self.n_90_Rdt * sin(beta_up) * (beta_up_deg / 90.) m_Rd_up_1 = self.m_0_Rd * cos(beta_up) * (1 - beta_up_deg / 90.) + \ self.m_90_Rd * sin(beta_up) * (beta_up_deg / 90.) k_alpha_up = cos(beta_up) * (1 - beta_up_deg / 90.) + \ sin(beta_up) * (beta_up_deg / 90.) n_Rdt_up_2 = self.n_90_Rdt * cos(beta_up) * (1 - beta_up_deg / 90.) + \ self.n_0_Rdt * sin(beta_up) * (beta_up_deg / 90.) m_Rd_up_2 = self.m_90_Rd * cos(beta_up) * (1 - beta_up_deg / 90.) + \ self.m_0_Rd * sin(beta_up) * (beta_up_deg / 90.) #---------------------------------------------------------- # lower side #---------------------------------------------------------- beta_lo_deg = abs(self.alpha_sig1_lo_deg) # [degree] beta_lo = abs(self.alpha_sig1_lo) # [rad] n_Rdt_lo_1 = self.n_0_Rdt * cos(beta_lo) * (1 - beta_lo_deg / 90.) + \ self.n_90_Rdt * sin(beta_lo) * (beta_lo_deg / 90.) m_Rd_lo_1 = self.m_0_Rd * cos(beta_lo) * (1 - beta_lo_deg / 90.) + \ self.m_90_Rd * sin(beta_lo) * (beta_lo_deg / 90.) k_alpha_lo = cos(beta_lo) * (1 - beta_lo_deg / 90.) + \ sin(beta_lo) * (beta_lo_deg / 90.) n_Rdt_lo_2 = self.n_90_Rdt * cos(beta_lo) * (1 - beta_lo_deg / 90.) + \ self.n_0_Rdt * sin(beta_lo) * (beta_lo_deg / 90.) m_Rd_lo_2 = self.m_90_Rd * cos(beta_lo) * (1 - beta_lo_deg / 90.) + \ self.m_0_Rd * sin(beta_lo) * (beta_lo_deg / 90.) #------------------------------------------------- # NOTE: the principle tensile stresses are used to evaluate the principle direction\ # 'eta_nm_tot' is evaluated based on linear nm-interaction (derived from test results) # 1st-principle stress direction = maximum (tensile) stresses # 2nd-principle stress direction = minimum (compressive) stresses #------------------------------------------------- # print "NOTE: the principle tensile stresses are used to evaluate the deflection angle 'beta', i.e. k_alpha(beta)" print " 'eta_nm_tot' is evaluated based on linear nm-interaction (derived from test results)" print " 'eta_nm_tot' is evaluated both for 1st and 2nd principle direction" if self.ls_table.k_alpha_min == True: print "minimum value 'k_alpha_min'=0.707 has been used to evaluate resistance values" # NOTE: conservative simplification: k_alpha_min = 0.707 used # n_Rdt_lo_1 = n_Rdt_up_1 = n_Rdt_lo_2 = n_Rdt_up_2 = min(self.n_0_Rdt, self.n_90_Rdt) * 0.707 * np.ones_like(self.elem_no) m_Rd_lo_1 = m_Rd_up_1 = m_Rd_lo_2 = m_Rd_up_2 = min(self.m_0_Rd, self.m_90_Rd) * 0.707 * np.ones_like(self.elem_no) #------------------------------------------------- # compressive strength (independent from principle and evaluation direction) #------------------------------------------------- n_Rdc = self.n_Rdc * np.ones_like(self.elem_no) #---------------------------------------- # caluclate eta_nm #---------------------------------------- # NOTE: destinction of the sign of the normal force necessary #--------------- # 1-direction: #--------------- # initialize arrays to be filled based on case distinction # eta_n_up = np.zeros_like(self.n_sig1_up) eta_n_lo = np.zeros_like(self.n_sig1_lo) # cases with a tensile normal force # cond_nsu_ge_0 = self.n_sig1_up >= 0. # tensile force in direction of principle stress at upper side cond_nsl_ge_0 = self.n_sig1_lo >= 0. # tensile force in direction of principle stress at lower side # compare imposed tensile normal force with 'n_Rd,t' as obtained from tensile test # bool_arr = cond_nsu_ge_0 eta_n_up[bool_arr] = self.n_sig1_up[bool_arr] / n_Rdt_up_1[bool_arr] bool_arr = cond_nsl_ge_0 eta_n_lo[bool_arr] = self.n_sig1_lo[bool_arr] / n_Rdt_lo_1[bool_arr] # cases with a compressive normal force # cond_nsu_lt_0 = self.n_sig1_up < 0. # compressive force in direction of principle stress at upper side cond_nsl_lt_0 = self.n_sig1_lo < 0. # compressive force in direction of principle stress at lower side # compare imposed compressive normal force with 'n_Rdc' as obtained from compression test # bool_arr = cond_nsu_lt_0 eta_n_up[bool_arr] = self.n_sig1_up[bool_arr] / n_Rdc[bool_arr] bool_arr = cond_nsl_lt_0 eta_n_lo[bool_arr] = self.n_sig1_lo[bool_arr] / n_Rdc[bool_arr] # get 'eta_m' based on imposed moment compared with moment resistence # NOTE: use a linear increase factor for resistance moment based on reference thickness (= minimum thickness) # min_thickness = np.min(self.thickness) eta_m_lo = self.m_sig1_lo / (m_Rd_lo_1 * self.thickness / min_thickness) eta_m_up = self.m_sig1_up / (m_Rd_up_1 * self.thickness / min_thickness) # get total 'eta_mn' based on imposed normal force and moment # NOTE: if eta_n is negative (caused by a compressive normal force) take the absolute value # NOTE: if eta_m is negative (caused by a negative moment) take the absolute value # eta_nm_lo = np.abs(eta_n_lo) + np.abs(eta_m_lo) eta_nm_up = np.abs(eta_n_up) + np.abs(eta_m_up) # get maximum 'eta_mn' of both principle directions of upper and lower side # eta_nm1_tot = ndmax(hstack([ eta_nm_up, eta_nm_lo]), axis=1)[:, None] #--------------- # 2-direction: #--------------- # initialize arrays to be filled based on case distinction # eta_n2_up = np.zeros_like(self.n_sig2_up) eta_n2_lo = np.zeros_like(self.n_sig2_lo) # cases with a tensile normal force # cond_ns2u_ge_0 = self.n_sig2_up >= 0. # tensile force in direction of principle stress at upper side cond_ns2l_ge_0 = self.n_sig2_lo >= 0. # tensile force in direction of principle stress at lower side # compare imposed tensile normal force with 'n_Rd,t' as obtained from tensile test # bool_arr = cond_ns2u_ge_0 eta_n2_up[bool_arr] = self.n_sig2_up[bool_arr] / n_Rdt_up_2[bool_arr] bool_arr = cond_ns2l_ge_0 eta_n2_lo[bool_arr] = self.n_sig2_lo[bool_arr] / n_Rdt_lo_2[bool_arr] # cases with a compressive normal force # cond_ns2u_lt_0 = self.n_sig2_up < 0. # compressive force in direction of principle stress at upper side cond_ns2l_lt_0 = self.n_sig2_lo < 0. # compressive force in direction of principle stress at lower side # compare imposed compressive normal force with 'n_Rdc' as obtained from compression test # bool_arr = cond_ns2u_lt_0 eta_n2_up[bool_arr] = self.n_sig2_up[bool_arr] / n_Rdc[bool_arr] bool_arr = cond_ns2l_lt_0 eta_n2_lo[bool_arr] = self.n_sig2_lo[bool_arr] / n_Rdc[bool_arr] # get 'eta_m' based on imposed moment compared with moment resistence # NOTE: use a linear increase factor for resistance moment based on reference thickness (= minimum thickness) # eta_m2_lo = self.m_sig2_lo / (m_Rd_lo_2 * self.thickness / min_thickness) eta_m2_up = self.m_sig2_up / (m_Rd_up_2 * self.thickness / min_thickness) # get total 'eta_mn' based on imposed normal force and moment # NOTE: if eta_n is negative (caused by a compressive normal force) take the absolute value # NOTE: if eta_m is negative (caused by a negative moment) take the absolute value # eta_nm2_lo = np.abs(eta_n2_lo) + np.abs(eta_m2_lo) eta_nm2_up = np.abs(eta_n2_up) + np.abs(eta_m2_up) # get maximum 'eta_mn' of both principle directions of upper and lower side # eta_nm2_tot = ndmax(hstack([ eta_nm2_up, eta_nm2_lo]), axis=1)[:, None] # overall maximum eta_nm for 1st and 2nd principle direction # eta_nm_tot = ndmax(hstack([ eta_nm1_tot, eta_nm2_tot]), axis=1)[:, None] # overall maximum eta_n and eta_m distinguishing normal forces and bending moment influence: # eta_n_tot = ndmax(hstack([ eta_n_lo, eta_n2_lo, eta_n_up, eta_n2_up]), axis=1)[:, None] eta_m_tot = ndmax(hstack([ eta_m_lo, eta_m2_lo, eta_m_up, eta_m2_up]), axis=1)[:, None] #------------------------------------------------------------ # construct a dictionary containing the return values #------------------------------------------------------------ return { 'beta_up_deg':beta_up_deg, 'beta_lo_deg':beta_lo_deg, 'n_Rdt_up_1':n_Rdt_up_1, 'n_Rdt_lo_1':n_Rdt_lo_1, 'm_Rd_up_1':m_Rd_up_1, 'm_Rd_lo_1':m_Rd_lo_1, 'n_Rdt_up_2':n_Rdt_up_2, 'n_Rdt_lo_2':n_Rdt_lo_2, 'm_Rd_up_2':m_Rd_up_2, 'm_Rd_lo_2':m_Rd_lo_2, 'eta_n_up':eta_n_up, 'eta_m_up':eta_m_up, 'eta_nm_up':eta_nm_up, 'eta_n_lo':eta_n_lo, 'eta_m_lo':eta_m_lo, 'eta_nm_lo':eta_nm_lo, 'eta_nm_tot':eta_nm_tot, 'eta_n_tot':eta_n_tot, 'eta_m_tot':eta_m_tot, 'eta_n2_up':eta_n2_up, 'eta_m2_up':eta_m2_up, 'eta_nm2_up':eta_nm2_up, 'eta_n2_lo':eta_n2_lo, 'eta_m2_lo':eta_m2_lo, 'eta_nm2_lo':eta_nm2_lo, 'k_alpha_lo' : k_alpha_lo, 'k_alpha_up' : k_alpha_up }
ls_list = lcc.ls_table.ls_list #---------------------------------------------- # run through all cases defined in 'ls_list' # of 'ls_table' (case 'Mx', 'My', 'Nx', 'Ny') #---------------------------------------------- # list of 'n_tex'-column arrays for all # investigated directions: # n_tex_list = [] for ls in ls_list: n_tex_list.append(ls.n_tex) n_tex_arr = hstack(n_tex_list) n_tex_max = ndmax(n_tex_arr, axis=1)[:, None] n_tex_max_list.append(n_tex_max) # stack the list to an array in order to use ndmax-function # n_tex_max_arr = hstack(n_tex_max_list) #---------------------------------------------- # get the overall maximum values: #---------------------------------------------- n_tex_max_max = ndmax(n_tex_max_arr, axis=1)[:, None] #---------------------------------------------- # plot
def export_hf_lc(self): """exports the hinge forces for each loading case separately """ from matplotlib import pyplot sr_columns = self.sr_columns dict = self.max_sr_grouped_dict length_xy_quarter = self.length_xy_quarter def save_bar_plot(x, y, filename='bla', xlabel='xlabel', ylabel='ylavel', ymin=-10, ymax=10, width=0.1, xmin=0, xmax=1000, figsize=[10, 5]): fig = pyplot.figure(facecolor="white", figsize=figsize) ax1 = fig.add_subplot(1, 1, 1) ax1.bar(x, y, width=width, align='center', color='blue') ax1.set_xlim(xmin, xmax) ax1.set_ylim(ymin, ymax) ax1.set_xlabel(xlabel, fontsize=22) ax1.set_ylabel(ylabel, fontsize=22) fig.savefig(filename, orientation='portrait', bbox_inches='tight') pyplot.clf() X = array(self.geo_data_dict['X_hf']) Y = array(self.geo_data_dict['Y_hf']) # symmetric axes # idx_sym = where(abs(Y[:, 0] - 2.0 * length_xy_quarter) <= 0.0001) X_sym = X[idx_sym].reshape(-1) idx_r0_r1 = where(abs(X[:, 0] - 2.0 * length_xy_quarter) <= 0.0001) X_r0_r1 = Y[idx_r0_r1].reshape(-1) F_int = self.lc_arr for i, lc_name in enumerate(self.lc_name_list): filename = self.lc_list[i].plt_export max_N_ip = max(int(ndmax(F_int[i, :, 0], axis=0)) + 1, 1) max_V_ip = max(int(ndmax(F_int[i, :, 1], axis=0)) + 1, 1) max_V_op = max(int(ndmax(F_int[i, :, 2], axis=0)) + 1, 1) F_int_lc = F_int[i, :, :] # first row N_ip, second V_ip third V_op F_sym = F_int_lc[idx_sym, :].reshape(-1, len(sr_columns)) F_r0_r1 = F_int_lc[idx_r0_r1, :].reshape(-1, len(sr_columns)) save_bar_plot( X_sym, F_sym[:, 0].reshape(-1), # xlabel = '$X$ [m]', ylabel = '$N^{ip}$ [kN]', xlabel='$X$ [m]', ylabel='$N^{*}$ [kN]', filename=filename + 'N_ip' + '_sym', xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_N_ip, ymax=max_N_ip, figsize=[10, 5]) save_bar_plot(X_sym, F_sym[:, 1].reshape(-1), xlabel='$X$ [m]', ylabel='$V_{ip}$ [kN]', filename=filename + 'V_ip' + '_sym', xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_V_ip, ymax=max_V_ip, figsize=[10, 5]) save_bar_plot( X_sym, F_sym[:, 2].reshape(-1), # xlabel = '$X$ [m]', ylabel = '$V_{op}$ [kN]', xlabel='$X$ [m]', ylabel='$V^{*}$ [kN]', filename=filename + 'V_op' + '_sym', xmin=0.0, xmax=3.5 * length_xy_quarter, ymin=-max_V_op, ymax=max_V_op, figsize=[10, 5]) # r0_r1 # save_bar_plot( X_r0_r1, F_r0_r1[:, 0].reshape(-1), # xlabel = '$Y$ [m]', ylabel = '$N_{ip}$ [kN]', xlabel='$Y$ [m]', ylabel='$N^{*}$ [kN]', filename=filename + 'N_ip' + '_r0_r1', xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_N_ip, ymax=max_N_ip, figsize=[5, 5]) save_bar_plot(X_r0_r1, F_r0_r1[:, 1].reshape(-1), xlabel='$Y$ [m]', ylabel='$V_{ip}$ [kN]', filename=filename + 'V_ip' + '_r0_r1', xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_V_ip, ymax=max_V_ip, figsize=[5, 5]) save_bar_plot( X_r0_r1, F_r0_r1[:, 2].reshape(-1), # xlabel = '$Y$ [m]', ylabel = '$V_{op}$ [kN]', xlabel='$Y$ [m]', ylabel='$V^{*}$ [kN]', filename=filename + 'V_op' + '_r0_r1', xmin=0.0, xmax=2.0 * length_xy_quarter, ymin=-max_V_op, ymax=max_V_op, figsize=[5, 5])
def _get_max_exy_tot_( self ): return ndmax( self.exy_tot_ )
def _get_max_n_tex(self): return ndmax(self.n_tex)
def plot_n_tex(self, title=None): '''plot number of textile reinforcement 'n_tex' for all loading case combinations ''' #---------------------------------------- # script to get the maximum number of reinforcement ('n_tex') # at all given coordinate points for all possible loading # case combinations: #---------------------------------------- # set option to "True" for surrounding # evaluation of necessary layers "n_tex" # needed for all loading cases # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- n_tex_list = [] for lcc in lcc_list: # get the ls_table object and retrieve its 'ls_class' # (= LSTable_ULS-object) # ls_class = lcc.ls_table.ls_class # get 'n_tex'-column array # n_tex = ls_class.n_tex # n_tex = ls_class.n_tex_up # n_tex = ls_class.n_tex_lo n_tex_list.append(n_tex) # stack the list to an array in order to use ndmax-function # n_tex_arr = hstack(n_tex_list) #---------------------------------------------- # get the overall maximum values: #---------------------------------------------- n_tex_max = ndmax(n_tex_arr, axis=1)[:, None] #---------------------------------------------- # plot #---------------------------------------------- # X = lcc_list[0].ls_table.X[:, 0] Y = lcc_list[0].ls_table.Y[:, 0] Z = lcc_list[0].ls_table.Z[:, 0] plot_col = n_tex_max[:, 0] # if n_tex is negative plot 0 instead: # plot_col = where(plot_col < 0, 0, plot_col) mlab.figure(figure=title, bgcolor=(1.0, 1.0, 1.0), fgcolor=(0.0, 0.0, 0.0)) mlab.points3d(X, Y, (-1.0) * Z, plot_col, colormap="YlOrBr", mode="cube", scale_mode='none', scale_factor=0.10) mlab.scalarbar(title='n_tex (all LCs)', orientation='vertical') mlab.show()