def plot_RxRz_interaction(self, save_fig_to_file=None, show_tension_only=False, add_max_min_RxRz_from_file=None, save_max_min_RxRz_to_file=None): '''plot the normal/shear-reaction forces as interaction diagram for all loading case combinations ''' # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- Rx_Ed_list = [ ] # normal reaction force (tangential to the shell geometry) Rz_Ed_list = [] # shear reaction force (radial to the shell geometry) 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 Rx_Ed and Rz_Ed # Rx_Ed = np.copy(getattr(ls_class, 'Rx')) Rz_Ed = np.copy(getattr(ls_class, 'Rz')) # add read in saved values to be superposed with currently read in values # if add_max_min_RxRz_from_file != None: max_min_RxRz_arr = np.loadtxt(add_max_min_RxRz_from_file) max_Rx_Ed_arr = max_min_RxRz_arr[:, 0][:, None] min_Rx_Ed_arr = max_min_RxRz_arr[:, 1][:, None] max_Rz_Ed_arr = max_min_RxRz_arr[:, 2][:, None] min_Rz_Ed_arr = max_min_RxRz_arr[:, 3][:, None] # Rx_Ed # cond_Rx_Ed_ge_0 = Rx_Ed >= 0. # positive Rx value = shear force for the build-in srew bool_arr = cond_Rx_Ed_ge_0 Rx_Ed[bool_arr] += max_Rx_Ed_arr[bool_arr] cond_Rx_Ed_lt_0 = Rx_Ed < 0. # negative Rx value = compressive force in tangential direction at support (normal force) bool_arr = cond_Rx_Ed_lt_0 Rx_Ed[bool_arr] += min_Rx_Ed_arr[bool_arr] # Rz_Ed # cond_Rz_Ed_ge_0 = Rz_Ed >= 0. # positive Rz value = compressive force in radial direction at the support bool_arr = cond_Rz_Ed_ge_0 Rz_Ed[bool_arr] += max_Rz_Ed_arr[bool_arr] cond_Rz_Ed_lt_0 = Rz_Ed < 0. # negative Rz value = pull-out force for the build-in srew bool_arr = cond_Rz_Ed_lt_0 Rz_Ed[bool_arr] += min_Rz_Ed_arr[bool_arr] Rx_Ed_list.append(Rx_Ed) Rz_Ed_list.append(Rz_Ed) # stack the list to an array in order to use plot-function # Rx_Ed_arr = hstack(Rx_Ed_list) Rz_Ed_arr = hstack(Rz_Ed_list) print 'Rz_Ed_arr.shape', Rz_Ed_arr.shape # get Rx_Rd, Rz_Rd # Rx_Rd = getattr(ls_class, 'Rx_Rd') # shear resistance Rz_Rd = getattr(ls_class, 'Rz_Rd') # pull-out resistance # save min- and max-values to file in order to superpose them later # if save_max_min_RxRz_to_file != None: # get maximum or minimum values for superposition depending on # weather Rx or Rz are positive or negative values # positive value for Rx # max_Rx_Ed_arr = np.max(Rx_Ed_arr, axis=1) # negative value for Rx # min_Rx_Ed_arr = np.min(Rx_Ed_arr, axis=1) # positive value for Rz # max_Rz_Ed_arr = np.max(Rz_Ed_arr, axis=1) # negative value for Rz # min_Rz_Ed_arr = np.min(Rz_Ed_arr, axis=1) # stack as four column array # max_min_RxRz_arr = np.hstack([ max_Rx_Ed_arr[:, None], min_Rx_Ed_arr[:, None], max_Rz_Ed_arr[:, None], min_Rz_Ed_arr[:, None] ]) # save max and min values to file # np.savetxt(save_max_min_RxRz_to_file, max_min_RxRz_arr) print 'max_min_RxRz_arr saved to file %s' % ( save_max_min_RxRz_to_file) #---------------------------------------------- # plot #---------------------------------------------- # # p.figure(facecolor='white') # white background p.figure(facecolor='white', figsize=(8, 5)) p.plot(Rx_Ed_arr, Rz_Ed_arr, 'wo', markersize=5, markerfacecolor='gray') # blue dots print 'Rx_Ed_arr', Rx_Ed_arr print 'Rz_Ed_arr', Rz_Ed_arr x = np.array([0, Rx_Rd]) y1 = np.array([-Rz_Rd, 0.]) # p.title('$RxRz$-Interaktionsdiagramm') ax = p.gca() if show_tension_only == False: p.axis([-10., 6, -6, 4.]) # set plotting range for axis ax.set_xticks([-10., 6]) ax.set_yticks([-6., 4.]) print 'show_tension_only == False' if show_tension_only == True: # ax.set_xticks([0., 0.2, 0.4, 0.6, 0.8, 1., 1.2]) # ax.set_yticks([140., 120, 100, 80., 60., 40., 20., 0.]) p.axis([0., 1.05 * Rx_Rd, -1.2 * Rz_Rd, 0.]) # set plotting range for axis print 'show_tension_only == True' ax.spines['left'].set_position(('data', 0)) ax.spines['right'].set_color('none') ax.spines['bottom'].set_position(('data', 0)) ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') # p.plot(x, y1, 'k--', linewidth=2.0) # black dashed line p.grid(True) # p.xlabel('$R_{x,Ed}$ [kN] ', fontsize=14, verticalalignment='top', horizontalalignment='right') # p.ylabel('$R_{z,Ed}$ [kN] ', fontsize=14) format_plot(p) # save figure as png-file # if save_fig_to_file != None: print 'figure saved to file %s' % (save_fig_to_file) p.savefig(save_fig_to_file, format='png') p.show()
# ex_run.ex_type._plot_force_deflection_thirdpoints( p ) # continuous fabrication with pause # # path = join(simdb.exdata_dir, 'bending_tests', 'four_point', '2012-04-03_BT-4PT-12c-6cm-0-TU', 'BT-4PT-12c-6cm-SH4FF') # tests = [ 'BT-4PT-12c-6cm-SH4FF-V1.DAT', 'BT-4PT-12c-6cm-SH4FF-V2.DAT' ] # for t in tests: # ex_path = join(path, t) # ex_run = ExRun(ex_path) # ex_run.ex_type._plot_force_deflection_center(p) #---------------------------------------------------------------------- # plot sim curve as time new roman within the predefined limits #---------------------------------------------------------------------- # format_plot(p, xlim=55, ylim=14, xlabel='displacement [mm]', ylabel='force [kN]') png_file_path = join(png_path, param_key + '.png') p.title(param_key, fontsize=8) p.savefig(png_file_path, dpi=300.) print 'png-file saved to file: %s' % png_file_path p.show() app.main() #------------------------------ # show last results #------------------------------ if do == 'show_last_results': from matresdev.db.exdb.ex_run import ExRun
# continuous fabrication with pause # # path = join(simdb.exdata_dir, 'bending_tests', 'four_point', '2012-04-03_BT-4PT-12c-6cm-0-TU', 'BT-4PT-12c-6cm-SH4FF') # tests = [ 'BT-4PT-12c-6cm-SH4FF-V1.DAT', 'BT-4PT-12c-6cm-SH4FF-V2.DAT' ] # for t in tests: # ex_path = join(path, t) # ex_run = ExRun(ex_path) # ex_run.ex_type._plot_force_deflection_center(p) #---------------------------------------------------------------------- # plot sim curve as time new roman within the predefined limits #---------------------------------------------------------------------- # format_plot(p, xlim=55, ylim=14, xlabel='displacement [mm]', ylabel='force [kN]') png_file_path = join(png_path, param_key + '.png') p.title(param_key, fontsize=8) p.savefig(png_file_path, dpi=300.) print 'png-file saved to file: %s' % png_file_path p.show() app.main() #------------------------------ # show last results #------------------------------ if do == 'show_last_results':
print 'Y_r01.shape', Y_r01.shape # do = 'N_ip' # do = 'V_op' fontsize = 20 color = 'grey' if do == 'N_ip': ax1 = p.subplot(gs[1]) ax1.set_title('Symmetrieachse') ind = np.arange(N) ax1.plot(ind * step + step / 2. - width / 2., np.zeros_like(X_sym), linestyle='--', color=color) ax1.bar(ind * step + step / 2. - width / 2., N_ip_sym, width, color='grey', edgecolor='none', linewidth=0) format_plot(p, fontsize=fontsize, xlabel='$X\,\mathrm{[m]}$', ylabel='$N_\mathrm{ip}\,\mathrm{[kN]}$') # ax2 = p.subplot(gs[0], sharey=ax1) ax2.set_title('Schnitt A-A') ind = np.arange(N / 2) ax2.plot(ind * step + step / 2. - width / 2., np.zeros_like(Y_r01), linestyle='--', color=color) ax2.bar(ind * step + step / 2. - width / 2., N_ip_r01, width, color='grey', edgecolor='none', linewidth=0) format_plot(p, fontsize=fontsize, xlabel='$Y\,\mathrm{[m]}$', ylabel='$N_\mathrm{ip}\,\mathrm{[kN]}$') if do == 'V_op': ax2 = p.subplot(gs[0]) ax2.set_title('Schnitt A-A') ind = np.arange(N / 2) ax2.plot(ind * step + step / 2. - width / 2., np.zeros_like(Y_r01), linestyle='--', color=color) ax2.bar(ind * step + step / 2. - width / 2., V_op_r01, width, color='grey', edgecolor='none', linewidth=0) format_plot(p, fontsize=fontsize, yformat="%.1f", xlabel='$Y\,\mathrm{[m]}$', ylabel='$V_\mathrm{op}\,\mathrm{[kN]}$')
fw_arr = np.hstack([f_asc[:, None], w_asc[:, None]]) print 'fw_arr.shape', fw_arr.shape np.savetxt(param_key + '.csv', fw_arr, delimiter=';') #-------------------- # experiments #-------------------- if test_series == 'ST-12c': # ST-12c-6cm-TU # ex_path = os.path.join(simdb.exdata_dir, 'slab_tests', '2011-12-15_ST-12c-6cm-u-TU', 'ST-12c-6cm-u-TU.DAT') ex_run = ExRun(ex_path) ex_run.ex_type._plot_force_center_deflection_interpolated(p) format_plot( p, xlim=35, ylim=100, xlabel='$w_\mathrm{Mitte}$ [mm]', ylabel='$F$ [kN]') if test_series == 'ST-10g': # ST-10a # ex_path_TRC10 = os.path.join( simdb.exdata_dir, 'slab_tests', '2010-03-08_ST-10g-3cm-a-FR_TRC10', 'ST-10g-3cm-a-FR-TRC10.DAT') ex_path_TRC11 = os.path.join( simdb.exdata_dir, 'slab_tests', '2010-03-09_ST-10g-3cm-a-FR_TRC11', 'ST-10g-3cm-a-FR-TRC11.DAT') ex_path_TRC12 = os.path.join( simdb.exdata_dir, 'slab_tests', '2010-03-10_ST-10g-3cm-a-FR_TRC12', 'ST-10g-3cm-a-FR-TRC12.DAT') tests = [ex_path_TRC10, ex_path_TRC11, ex_path_TRC12] for ex_path in tests: ex_run = ExRun(ex_path) ex_run.ex_type._plot_force_center_deflection_interpolated( p)
#-------------------- # experiments #-------------------- if test_series == 'ST-12c': # ST-12c-6cm-TU # ex_path = os.path.join(simdb.exdata_dir, 'slab_tests', '2011-12-15_ST-12c-6cm-u-TU', 'ST-12c-6cm-u-TU.DAT') ex_run = ExRun(ex_path) ex_run.ex_type._plot_force_center_deflection_interpolated(p) format_plot(p, xlim=35, ylim=100, xlabel='$w_\mathrm{Mitte}$ [mm]', ylabel='$F$ [kN]') if test_series == 'ST-10g': # ST-10a # ex_path_TRC10 = os.path.join( simdb.exdata_dir, 'slab_tests', '2010-03-08_ST-10g-3cm-a-FR_TRC10', 'ST-10g-3cm-a-FR-TRC10.DAT') ex_path_TRC11 = os.path.join( simdb.exdata_dir, 'slab_tests', '2010-03-09_ST-10g-3cm-a-FR_TRC11', 'ST-10g-3cm-a-FR-TRC11.DAT') ex_path_TRC12 = os.path.join(
def plot_RxRz_interaction(self, save_fig_to_file=None, show_tension_only=False, add_max_min_RxRz_from_file=None, save_max_min_RxRz_to_file=None): '''plot the normal/shear-reaction forces as interaction diagram for all loading case combinations ''' # get the list of all loading case combinations: # lcc_list = self.lcc_list #---------------------------------------------- # run trough all loading case combinations: #---------------------------------------------- Rx_Ed_list = [] # normal reaction force (tangential to the shell geometry) Rz_Ed_list = [] # shear reaction force (radial to the shell geometry) 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 Rx_Ed and Rz_Ed # Rx_Ed = np.copy(getattr(ls_class, 'Rx')) Rz_Ed = np.copy(getattr(ls_class, 'Rz')) # add read in saved values to be superposed with currently read in values # if add_max_min_RxRz_from_file != None: max_min_RxRz_arr = np.loadtxt(add_max_min_RxRz_from_file) max_Rx_Ed_arr = max_min_RxRz_arr[:, 0][:, None] min_Rx_Ed_arr = max_min_RxRz_arr[:, 1][:, None] max_Rz_Ed_arr = max_min_RxRz_arr[:, 2][:, None] min_Rz_Ed_arr = max_min_RxRz_arr[:, 3][:, None] # Rx_Ed # cond_Rx_Ed_ge_0 = Rx_Ed >= 0. # positive Rx value = shear force for the build-in srew bool_arr = cond_Rx_Ed_ge_0 Rx_Ed[bool_arr] += max_Rx_Ed_arr[bool_arr] cond_Rx_Ed_lt_0 = Rx_Ed < 0. # negative Rx value = compressive force in tangential direction at support (normal force) bool_arr = cond_Rx_Ed_lt_0 Rx_Ed[bool_arr] += min_Rx_Ed_arr[bool_arr] # Rz_Ed # cond_Rz_Ed_ge_0 = Rz_Ed >= 0. # positive Rz value = compressive force in radial direction at the support bool_arr = cond_Rz_Ed_ge_0 Rz_Ed[bool_arr] += max_Rz_Ed_arr[bool_arr] cond_Rz_Ed_lt_0 = Rz_Ed < 0. # negative Rz value = pull-out force for the build-in srew bool_arr = cond_Rz_Ed_lt_0 Rz_Ed[bool_arr] += min_Rz_Ed_arr[bool_arr] Rx_Ed_list.append(Rx_Ed) Rz_Ed_list.append(Rz_Ed) # stack the list to an array in order to use plot-function # Rx_Ed_arr = hstack(Rx_Ed_list) Rz_Ed_arr = hstack(Rz_Ed_list) print 'Rz_Ed_arr.shape', Rz_Ed_arr.shape # get Rx_Rd, Rz_Rd # Rx_Rd = getattr(ls_class, 'Rx_Rd') # shear resistance Rz_Rd = getattr(ls_class, 'Rz_Rd') # pull-out resistance # save min- and max-values to file in order to superpose them later # if save_max_min_RxRz_to_file != None: # get maximum or minimum values for superposition depending on # weather Rx or Rz are positive or negative values # positive value for Rx # max_Rx_Ed_arr = np.max(Rx_Ed_arr, axis=1) # negative value for Rx # min_Rx_Ed_arr = np.min(Rx_Ed_arr, axis=1) # positive value for Rz # max_Rz_Ed_arr = np.max(Rz_Ed_arr, axis=1) # negative value for Rz # min_Rz_Ed_arr = np.min(Rz_Ed_arr, axis=1) # stack as four column array # max_min_RxRz_arr = np.hstack([max_Rx_Ed_arr[:, None], min_Rx_Ed_arr[:, None], max_Rz_Ed_arr[:, None], min_Rz_Ed_arr[:, None]]) # save max and min values to file # np.savetxt(save_max_min_RxRz_to_file, max_min_RxRz_arr) print 'max_min_RxRz_arr saved to file %s' % (save_max_min_RxRz_to_file) #---------------------------------------------- # plot #---------------------------------------------- # # p.figure(facecolor='white') # white background p.figure(facecolor='white', figsize=(8, 5)) p.plot(Rx_Ed_arr, Rz_Ed_arr, 'wo', markersize=5, markerfacecolor='gray') # blue dots print 'Rx_Ed_arr', Rx_Ed_arr print 'Rz_Ed_arr', Rz_Ed_arr x = np.array([0, Rx_Rd]) y1 = np.array([ -Rz_Rd, 0. ]) # p.title('$RxRz$-Interaktionsdiagramm') ax = p.gca() if show_tension_only == False: p.axis([-10., 6, -6, 4.]) # set plotting range for axis ax.set_xticks([-10., 6]) ax.set_yticks([-6., 4.]) print 'show_tension_only == False' if show_tension_only == True: # ax.set_xticks([0., 0.2, 0.4, 0.6, 0.8, 1., 1.2]) # ax.set_yticks([140., 120, 100, 80., 60., 40., 20., 0.]) p.axis([0., 1.05 * Rx_Rd, -1.2 * Rz_Rd, 0.]) # set plotting range for axis print 'show_tension_only == True' ax.spines['left'].set_position(('data', 0)) ax.spines['right'].set_color('none') ax.spines['bottom'].set_position(('data', 0)) ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') # p.plot(x, y1, 'k--', linewidth=2.0) # black dashed line p.grid(True) # p.xlabel('$R_{x,Ed}$ [kN] ', fontsize=14, verticalalignment='top', horizontalalignment='right') # p.ylabel('$R_{z,Ed}$ [kN] ', fontsize=14) format_plot(p) # save figure as png-file # if save_fig_to_file != None: print 'figure saved to file %s' % (save_fig_to_file) p.savefig(save_fig_to_file, format='png') p.show()