예제 #1
0
    dist_l = lx_avg * scale_data_factor
    dist_t = ly_avg * scale_data_factor
    glyph_l_length = dist_l / range_l
    glyph_l_length *= overlap_factor
    glyph_t_length = dist_t / range_t
    glyph_t_length *= overlap_factor
    print 'range_l', range_l
    print 'range_t', range_t
    print 'dist_l', dist_l
    print 'dist_t', dist_t
    print 'glyph_l_length', glyph_l_length
    print 'glyph_t_length', glyph_t_length

    #-------------------------------------------
    # start aramis user interface
    #-------------------------------------------
    aui = AramisUI(
        aramis_info=e_run.aramis_info,
        aramis_data=e_run.aramis_field_data,
        aramis_cdt=e_run.aramis_cdt,
        glyph_x_length=glyph_l_length,
        glyph_y_length=glyph_t_length,
        glyph_z_length=0.0,
        glyph_x_length_cr=glyph_l_length *
        6.,  # extrude the plot_var in the out-of-plane direction
        glyph_y_length_cr=glyph_l_length,
        glyph_z_length_cr=glyph_t_length,
        warp_factor=1.0)

    aui.configure_traits()
    range_t = min(x.shape[0], x.shape[1])
    dist_l = lx_avg * scale_data_factor
    dist_t = ly_avg * scale_data_factor
    glyph_l_length = dist_l / range_l
    glyph_l_length *= overlap_factor
    glyph_t_length = dist_t / range_t
    glyph_t_length *= overlap_factor
    print 'range_l', range_l
    print 'range_t', range_t
    print 'dist_l', dist_l
    print 'dist_t', dist_t
    print 'glyph_l_length', glyph_l_length
    print 'glyph_t_length', glyph_t_length

    #-------------------------------------------
    # start aramis user interface
    #-------------------------------------------
    aui = AramisUI(aramis_info=e_run.aramis_info,
                   aramis_data=e_run.aramis_field_data,
                   aramis_cdt=e_run.aramis_cdt,
                   glyph_x_length=glyph_l_length,
                   glyph_y_length=glyph_t_length,
                   glyph_z_length=0.0,
                   glyph_x_length_cr=glyph_l_length * 6.,  # extrude the plot_var in the out-of-plane direction
                   glyph_y_length_cr=glyph_l_length,
                   glyph_z_length_cr=glyph_t_length,
                   warp_factor=1.0)

    aui.configure_traits()

예제 #3
0
def plot_all():

    fig = p.figure()
    fig.subplots_adjust(
        left=0.03, right=0.97, bottom=0.04, top=0.96, wspace=0.25, hspace=0.2)

    for idx, e_run in enumerate(e_list):
        e = e_run.ex_type
        e.aramis_resolution_key = res_key

        print
        # print 'crack filter', e.crack_filter_avg
        params = param_dict.get(os.path.basename(e.data_file))
        e.aramis_cdt.aramis_data.integ_radius = params[0]
        e.aramis_cdt.ddd_ux_avg_threshold = params[1]
        e.aramis_cdt.ddd_ux_threshold = params[1]
        e.aramis_cdt.d_ux_avg_threshold = params[2]
        # e.aramis_cdt.crack_detection_step = e.maxF_idx_aramis
        # e.number_of_cracks_aramis
        # e.process_aramis_cdt_data()

        dux_t_cr = e.dux_t_cr
        eps_t_cr = e.eps_t_cr

        # evaluate the derivative of strain field
        twin = 5
        deps_t_cr = eps_t_cr[twin:, :] - eps_t_cr[:-twin,:]
        argmax_deps_t_cr = np.argmax(deps_t_cr, axis=0)
        cr_enum = np.arange(len(argmax_deps_t_cr))

        max_deps_t_cr = deps_t_cr[argmax_deps_t_cr, cr_enum]
        max_eps_t_cr = eps_t_cr[argmax_deps_t_cr + twin, cr_enum]
        max_t_cr = e.t_aramis_asc[argmax_deps_t_cr]

        fd = e.aramis_field_data
        displacement = np.zeros_like(e.t_aramis_asc)
        for step, time in enumerate(e.t_aramis_asc):
            #             print 'time', time
            fd.current_step = step
            ux_avg = fd.ux_arr_avg
            displacement[step] = ux_avg[-1] - ux_avg[0]

#         print 'u shape', e.aramis_field_data.ux_arr_avg.shape

        axes = p.subplot(231)
        axes.plot(e.t_aramis_asc, dux_t_cr, color='darkblue', label='1')
#         p.ylim((-0.05, 0.30))
#         p.plot(np.average(eps_t_cr, axis=1), e.F_t_aramis_asc/2.)

        axes = p.subplot(232)
        axes.plot(e.t_aramis_asc, eps_t_cr, label='1')

        axes.plot(e.t_aramis_asc, e.min_eps_t_cr, color='red',
                  linewidth=3, label='1')

        axes.plot(max_t_cr, max_eps_t_cr, 'ro')

        p.ylim((-0.002, 0.02))

        axes = p.subplot(233)

        axes.plot(max_t_cr, max_deps_t_cr, 'ro')

        axes.plot(e.t_aramis_asc[:deps_t_cr.shape[0]], deps_t_cr,
                  linewidth=1, label='1')
        p.ylim((-0.0005, 0.005))

        axes = p.subplot(234)
        e._plot_sigc_eps_ironed(axes, color='darkblue', label='eps')
        p.plot(displacement / 120., e.F_t_aramis_asc / 2., label='segment')
        p.legend()

        axes = p.subplot(235)
        axes.plot(e.F_t_aramis_asc, eps_t_cr)
        p.ylim((-0.002, 0.02))

        axes = p.subplot(236)
        axes.plot(e.t_aramis_asc, e.F_t_aramis_asc)

        # print the crack positions
        m = e.aramis_cdt.crack_detect_mask_avg.copy()
        cr_idx = np.where(m)[0]
        x = e.aramis_field_data.x_arr_0[0, :]
        print 'position', [x[cr_idx]]

        # print the crack initiating force
        print 'force', [e.F_t_aramis_asc[argmax_deps_t_cr]]

        axes = p.subplot(235)
        axes.plot(e.F_t_aramis_asc, eps_t_cr)
        p.ylim((-0.002, 0.02))

        axes = p.subplot(236)
        axes.plot(e.t_aramis_asc, e.F_t_aramis_asc)

        # print the crack positions
        m = e.aramis_cdt.crack_detect_mask_avg.copy()
        cr_idx = np.where(m)[0]
        x = e.aramis_field_data.x_arr_0[0, :]
        print 'position', [x[cr_idx]]

        # print the crack initiating force
        print 'force', [e.F_t_aramis_asc[argmax_deps_t_cr]]
        print 'force', [np.sort(e.F_t_aramis_asc[argmax_deps_t_cr])]

        p.show()
        aui = AramisUI(aramis_info=e.aramis_info,
                       aramis_data=e.aramis_field_data,
                       aramis_cdt=e.aramis_cdt)
        aui.configure_traits()
예제 #4
0
def plot_all():

    fig = p.figure()
    fig.subplots_adjust(left=0.03,
                        right=0.97,
                        bottom=0.04,
                        top=0.96,
                        wspace=0.25,
                        hspace=0.2)

    for idx, e_run in enumerate(e_list):
        e = e_run.ex_type
        e.aramis_resolution_key = res_key

        print
        # print 'crack filter', e.crack_filter_avg
        params = param_dict.get(os.path.basename(e.data_file))
        e.aramis_cdt.aramis_data.integ_radius = params[0]
        e.aramis_cdt.ddd_ux_avg_threshold = params[1]
        e.aramis_cdt.ddd_ux_threshold = params[1]
        e.aramis_cdt.d_ux_avg_threshold = params[2]
        # e.aramis_cdt.crack_detection_step = e.maxF_idx_aramis
        # e.number_of_cracks_aramis
        # e.process_aramis_cdt_data()

        dux_t_cr = e.dux_t_cr
        eps_t_cr = e.eps_t_cr

        # evaluate the derivative of strain field
        twin = 5
        deps_t_cr = eps_t_cr[twin:, :] - eps_t_cr[:-twin, :]
        argmax_deps_t_cr = np.argmax(deps_t_cr, axis=0)
        cr_enum = np.arange(len(argmax_deps_t_cr))

        max_deps_t_cr = deps_t_cr[argmax_deps_t_cr, cr_enum]
        max_eps_t_cr = eps_t_cr[argmax_deps_t_cr + twin, cr_enum]
        max_t_cr = e.t_aramis_asc[argmax_deps_t_cr]

        fd = e.aramis_field_data
        displacement = np.zeros_like(e.t_aramis_asc)
        for step, time in enumerate(e.t_aramis_asc):
            #             print 'time', time
            fd.current_step = step
            ux_avg = fd.ux_arr_avg
            displacement[step] = ux_avg[-1] - ux_avg[0]


#         print 'u shape', e.aramis_field_data.ux_arr_avg.shape

        axes = p.subplot(231)
        axes.plot(e.t_aramis_asc, dux_t_cr, color='darkblue', label='1')
        #         p.ylim((-0.05, 0.30))
        #         p.plot(np.average(eps_t_cr, axis=1), e.F_t_aramis_asc/2.)

        axes = p.subplot(232)
        axes.plot(e.t_aramis_asc, eps_t_cr, label='1')

        axes.plot(e.t_aramis_asc,
                  e.min_eps_t_cr,
                  color='red',
                  linewidth=3,
                  label='1')

        axes.plot(max_t_cr, max_eps_t_cr, 'ro')

        p.ylim((-0.002, 0.02))

        axes = p.subplot(233)

        axes.plot(max_t_cr, max_deps_t_cr, 'ro')

        axes.plot(e.t_aramis_asc[:deps_t_cr.shape[0]],
                  deps_t_cr,
                  linewidth=1,
                  label='1')
        p.ylim((-0.0005, 0.005))

        axes = p.subplot(234)
        e._plot_sigc_eps_ironed(axes, color='darkblue', label='eps')
        p.plot(displacement / 120., e.F_t_aramis_asc / 2., label='segment')
        p.legend()

        axes = p.subplot(235)
        axes.plot(e.F_t_aramis_asc, eps_t_cr)
        p.ylim((-0.002, 0.02))

        axes = p.subplot(236)
        axes.plot(e.t_aramis_asc, e.F_t_aramis_asc)

        # print the crack positions
        m = e.aramis_cdt.crack_detect_mask_avg.copy()
        cr_idx = np.where(m)[0]
        x = e.aramis_field_data.x_arr_0[0, :]
        print 'position', [x[cr_idx]]

        # print the crack initiating force
        print 'force', [e.F_t_aramis_asc[argmax_deps_t_cr]]

        axes = p.subplot(235)
        axes.plot(e.F_t_aramis_asc, eps_t_cr)
        p.ylim((-0.002, 0.02))

        axes = p.subplot(236)
        axes.plot(e.t_aramis_asc, e.F_t_aramis_asc)

        # print the crack positions
        m = e.aramis_cdt.crack_detect_mask_avg.copy()
        cr_idx = np.where(m)[0]
        x = e.aramis_field_data.x_arr_0[0, :]
        print 'position', [x[cr_idx]]

        # print the crack initiating force
        print 'force', [e.F_t_aramis_asc[argmax_deps_t_cr]]
        print 'force', [np.sort(e.F_t_aramis_asc[argmax_deps_t_cr])]

        p.show()
        aui = AramisUI(aramis_info=e.aramis_info,
                       aramis_data=e.aramis_field_data,
                       aramis_cdt=e.aramis_cdt)
        aui.configure_traits()