Beispiel #1
0
def run_pullout_dp(*args, **kw):
    po = PullOutModel(n_e_x=100, k_max=500, w_max=1.5)
    po.tline.step = 0.01
    po.geometry.L_x = 200.0
    po.loading_scenario.trait_set(loading_type='monotonic')
    po.cross_section.trait_set(A_f=16.67, P_b=1.0, A_m=1540.0)
    po.trait_set(mats_eval_type='damage-plasticity')
    po.mats_eval.trait_set(gamma=0.0, K=15.0, tau_bar=45.0)
    po.mats_eval.trait_set(omega_fn_type='li')
    po.mats_eval.omega_fn.trait_set(alpha_2=1.0, plot_max=10.0)

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('field', 'omega', plot_fn='omega')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.viz_sheet.viz2d_dict['u_C'].visible = False
    w.viz_sheet.viz2d_dict['load-time'].visible = False
    w.viz_sheet.viz2d_dict['load-displacement'].visible = False
    w.viz_sheet.viz2d_dict['dissipation rate'].visible = False
    w.viz_sheet.monitor_chunk_size = 10
    w.viz_sheet.reference_viz2d_name = 'load-displacement'

    w.run()
    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Beispiel #2
0
def run_pullout_multi(*args, **kw):
    po = PullOutModel(name='t33_pullout_multilinear',
                      n_e_x=100,
                      k_max=1000,
                      u_f0_max=2.0)
    po.tline.step = 0.02
    po.geometry.L_x = 200.0
    po.loading_scenario.set(loading_type='monotonic')
    po.cross_section.set(A_f=16.67 / 9.0, P_b=1.0, A_m=1540.0)
    po.mats_eval.set(s_data='0, 0.1, 0.4, 4.0', tau_data='0, 70.0, 0, 0')
    po.mats_eval.update_bs_law = True
    po.run()

    w = BMCSWindow(model=po)
    #     po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    #     po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    #     po.add_viz2d('dissipation rate', 'dissipation rate')

    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Beispiel #3
0
def run_bending3pt_mic_odf(*args, **kw):

    bt = BendingTestSimulator(n_e_x=2,
                              n_e_y=10,
                              n_e_z=1,
                              k_max=500,
                              mats_eval_type='scalar damage'
                              #mats_eval_type='microplane damage (odf)'
                              )
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        epsilon_0=59e-6,
        epsilon_f=600e-6)

    bt.w_max = 0.02
    bt.tline.step = 0.05
    bt.cross_section.h = 100
    bt.cross_section.b = 50
    bt.geometry.L = 20
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis3d = Vis3DSDamage()
    bt.tloop.response_traces.append(vis3d)
    viz3d = Viz3DSDamage(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    #    w.run()
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
    def get_window(self):

        fw = Viz2DFW(name='Pw', vis2d=self.hist['Pw'])
        fw2 = Viz2DFW(name='Pw2', vis2d=self.hist['Pw2'])
        fslip = Viz2DField(name='slip', vis2d=self.hist['slip'])
        fshear = Viz2DField(name='shear', vis2d=self.hist['shear'])
        fomega = Viz2DField(name='omega', vis2d=self.hist['omega'])
        fs_pi = Viz2DField(name='s_pi', vis2d=self.hist['s_pi'])
        fs_el = Viz2DField(name='s_el', vis2d=self.hist['s_el'])
        falpha = Viz2DField(name='alpha', vis2d=self.hist['alpha'])
        fz = Viz2DField(name='z', vis2d=self.hist['z'])

        w = BMCSWindow(sim=self)
        w.viz_sheet.viz2d_list.append(fw)
        w.viz_sheet.viz2d_list.append(fw2)
        w.viz_sheet.viz2d_list.append(fslip)
        w.viz_sheet.viz2d_list.append(fs_el)
        w.viz_sheet.viz2d_list.append(fs_pi)
        w.viz_sheet.viz2d_list.append(fshear)
        w.viz_sheet.viz2d_list.append(fomega)
        w.viz_sheet.viz2d_list.append(falpha)
        w.viz_sheet.viz2d_list.append(fz)
        strain_viz = Viz3DTensorField(vis3d=self.hist['strain'])
        w.viz_sheet.add_viz3d(strain_viz)
        stress_viz = Viz3DTensorField(vis3d=self.hist['stress'])
        w.viz_sheet.add_viz3d(stress_viz)
        return w
Beispiel #5
0
def run_uniaxial_elastic():

    bt = UniaxialTestModel(
        n_e_x=2,
        n_e_y=1,
        k_max=300,
        #mats_eval_type='scalar damage'
        #mats_eval_type='microplane damage (eeq)'
        mats_eval_type='microplane CSD (eeq)'
        #mats_eval_type='microplane CSD (odf)'
    )
    L = 2.
    L_c = L / 10.0
    E = 20000.0
    #f_t = 2.4
    #G_f = 0.09
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        E=E,
        nu=0.2)
    #     f_t_Em = np.ones_like(bt.dots_grid.state_arrays['omega']) * 10.0
    #     l_f_t_Em = len(f_t_Em)
    #     f_t_Em[0, ...] = 1.0
    #     bt.mats_eval.omega_fn.trait_set(
    #         E=E,
    #         f_t=f_t,
    #         f_t_Em=f_t_Em,
    #         G_f=G_f,
    #         L_s=L_c
    #     )

    bt.w_max = 0.001
    bt.tline.step = 0.01
    bt.cross_section.b = 1
    bt.geometry.trait_set(L=L, H=1, L_c=L_c)
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    #bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis2d_energy = Vis2DEnergy(model=bt)
    viz2d_energy = Viz2DEnergy(name='dissipation', vis2d=vis2d_energy)
    viz2d_energy_rates = Viz2DEnergyRatesPlot(name='dissipation rate',
                                              vis2d=vis2d_energy)
    vis2d_crack_band = Vis2DCrackBand(model=bt)
    w.viz_sheet.viz2d_list.append(viz2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)

    vis3d = Vis3DStressField()
    bt.tloop.response_traces.append(vis3d)
    bt.tloop.response_traces.append(vis2d_energy)
    # bt.tloop.response_traces.append(vis2d_crack_band)
    viz3d = Viz3DStressField(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    w.run()
    w.offline = True
    #    w.finish_event = True
    w.configure_traits()
def test_reporter():
    from reporter import Reporter
    from view.window import BMCSWindow
    po = PullOutModel(n_e_x=100, k_max=500, w_max=1.0)
    po.tline.step = 0.01
    po.geometry.L_x = 500.0
    po.loading_scenario.set(loading_type='monotonic')
    po.cross_section.set(A_f=16.67, P_b=1.0, A_m=1540.0)
    po.run()

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'Load-time')
    po.add_viz2d('F-w', 'Load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('field', 'omega', plot_fn='omega')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    r = Reporter(report_items=[po, w.viz_sheet])
    r.write()
    r.show_tex()
    r.run_pdflatex()
    r.show_pdf()
Beispiel #7
0
 def get_window(self):
     self.record['Pw'] = PulloutRecord()
     fw = Viz2DPullOutFW(name='pullout-curve', vis2d=self.hist['Pw'])
     u_p = Viz2DPullOutField(name='displacement along the bond',
                             plot_fn='u_p',
                             vis2d=self)
     eps_p = Viz2DPullOutField(name='strain along the bond',
                               plot_fn='eps_p',
                               vis2d=self)
     sig_p = Viz2DPullOutField(name='stress along the bond',
                               plot_fn='sig_p',
                               vis2d=self)
     s = Viz2DPullOutField(name='slip along the bond',
                           plot_fn='s',
                           vis2d=self)
     sf = Viz2DPullOutField(name='shear flow along the bond',
                            plot_fn='sf',
                            vis2d=self)
     energy = Viz2DEnergyPlot(name='energy', vis2d=self.hist['Pw'])
     dissipation = Viz2DEnergyReleasePlot(name='energy release',
                                          vis2d=self.hist['Pw'])
     w = BMCSWindow(sim=self)
     w.viz_sheet.viz2d_list.append(fw)
     w.viz_sheet.viz2d_list.append(u_p)
     w.viz_sheet.viz2d_list.append(eps_p)
     w.viz_sheet.viz2d_list.append(sig_p)
     w.viz_sheet.viz2d_list.append(s)
     w.viz_sheet.viz2d_list.append(sf)
     w.viz_sheet.viz2d_list.append(energy)
     w.viz_sheet.viz2d_list.append(dissipation)
     w.viz_sheet.monitor_chunk_size = 10
     return w
Beispiel #8
0
def run_pullout_multilinear(*args, **kw):
    po = PullOutModel(name='t33_pullout_multilinear',
                      title='Multi-linear bond slip law',
                      n_e_x=20,
                      k_max=1000,
                      w_max=1.5)
    po.tline.step = 0.05
    po.geometry.L_x = 200.0
    po.loading_scenario.set(loading_type='monotonic')
    po.cross_section.set(A_f=16.67 / 9.0, P_b=1.0, A_m=1540.0)
    po.mats_eval.set(s_data='0, 0.1, 0.4, 1.7', tau_data='0, 70, 0, 0')
    po.mats_eval.update_bs_law = True

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.viz_sheet.viz2d_dict['u_C'].visible = False
    w.viz_sheet.viz2d_dict['load-time'].visible = False
    w.viz_sheet.viz2d_dict['dissipation rate'].visible = False
    w.viz_sheet.monitor_chunk_size = 10
    w.viz_sheet.reference_viz2d_name = 'load-displacement'

    w.run()
    w.offline = True
    w.configure_traits(*args, **kw)
Beispiel #9
0
 def get_window(self):
     Pw = self.hist.plt('plot_Pw', label='pullout curve')
     geo = self.plt('plot_geo', label='geometry')
     u_p = self.plt('plot_u_p', label='displacement along the bond')
     eps_p = self.plt('plot_eps_p', label='strain along the bond')
     sig_p = self.plt('plot_sig_p', label='stress along the bond')
     s = self.plt('plot_s', label='slip along the bond')
     sf = self.plt('plot_sf', label='shear flow along the bond')
     energy = self.hist.plt('plot_G_t', label='energy')
     dissipation = self.hist.plt('plot_dG_t', label='energy release')
     pp0 = PlotPerspective(
         name='geo',
         viz2d_list=[geo],
         positions=[111],
     )
     pp1 = PlotPerspective(
         name='history',
         viz2d_list=[Pw, geo, energy, dissipation],
         positions=[221, 222, 223, 224],
     )
     pp2 = PlotPerspective(
         name='fields',
         viz2d_list=[s, u_p, eps_p, sig_p],
         twinx=[(s, sf, False)],
         positions=[221, 222, 223, 224],
     )
     win = BMCSWindow(model=self)
     win.viz_sheet.pp_list = [pp0, pp1, pp2]
     win.viz_sheet.selected_pp = pp0
     win.viz_sheet.monitor_chunk_size = 10
     return win
Beispiel #10
0
 def get_window(self):
     self.record['Pw'] = LatticeRecord()
     self.record['eps'] = Vis3DLattice(var='eps')
     w = BMCSWindow(sim=self)
     fw = Viz2DLatticeFW(name='FW-curve', vis2d=self.hist['Pw'])
     w.viz_sheet.viz2d_list.append(fw)
     viz3d_u_Lb = Viz3DLattice(vis3d=self.hist['eps'])
     w.viz_sheet.add_viz3d(viz3d_u_Lb)
     w.viz_sheet.monitor_chunk_size = 10
     return w
def run_bending3pt_mic_odf(*args, **kw):

    bt = BendingTestModel(
        n_e_x=1,
        n_e_y=1,
        n_e_z=1,
        k_max=500,
        mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (odf)'
        # mats_eval_type='elastic'
    )
    E_c = 28000  # MPa
    f_ct = 3.0  # MPa
    epsilon_0 = f_ct / E_c  # [-]

    print(bt.mats_eval_type)
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        epsilon_0=epsilon_0,
        epsilon_f=epsilon_0 * 10)

    bt.w_max = 0.001
    bt.tline.step = 0.005
    bt.cross_section.h = 1
    bt.geometry.L = 1
    bt.loading_scenario.trait_set(loading_type='monotonic')

    bt.record = {
        #       'Pw': Vis2DFW(bc_right=right_x_s, bc_left=left_x_s),
        #       'slip': Vis2DField(var='slip'),
        'strain': Vis3DTensorField(var='eps_ab'),
        'stress': Vis3DTensorField(var='sig_ab'),
        'damage': Vis3DTensorField(var='phi_ab'),
    }

    w = BMCSWindow(sim=bt)
    #    bt.add_viz2d('load function', 'load-time')
    #    bt.add_viz2d('F-w', 'load-displacement')

    viz_stress = Viz3DTensorField(vis3d=bt.hist['strain'])
    viz_strain = Viz3DTensorField(vis3d=bt.hist['stress'])
    viz_damage = Viz3DTensorField(vis3d=bt.hist['damage'])

    w.viz_sheet.add_viz3d(viz_stress)
    w.viz_sheet.add_viz3d(viz_strain)
    w.viz_sheet.add_viz3d(viz_damage)
    w.viz_sheet.monitor_chunk_size = 1

    w.run()
    time.sleep(10)
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
Beispiel #12
0
def run_bending3pt_sdamage(*args, **kw):
    bt = BendingTestModel(
        n_e_x=10,
        n_e_y=30,
        mats_type='scalar damage'
        #mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane CSD (eeq)'
        #mats_eval_type='microplane CSD (odf)'
    )
    bt.tloop.k_max = 800
    L_c = 5.0
    E = 30000.0
    f_t = 2.5
    G_f = 0.09
    bt.mats_type = 'scalar damage'
    bt.mats.trait_set(algorithmic=False, E=E, nu=0.2)
    bt.mats.omega_fn.trait_set(f_t=f_t, G_f=G_f, L_s=L_c)
    # print 'Gf', h_b * bt.mats_eval.get_G_f()

    bt.w_max = 0.8
    bt.tline.step = 0.02
    bt.cross_section.b = 100.
    bt.geometry.trait_set(L=450, H=110, a=10, L_c=L_c)
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(sim=bt)
    #    bt.add_viz2d('F-w', 'load-displacement')

    bt.record['Pw'] = PulloutResponse()
    bt.record['energy'] = Vis2DEnergy()
    bt.record['crack band'] = Vis2DCrackBand()

    fw = Viz2DForceDeflection(name='Pw', vis2d=bt.hist['Pw'])
    viz2d_energy = Viz2DEnergy(name='dissipation', vis2d=bt.hist['energy'])
    viz2d_energy_rates = Viz2DEnergyReleasePlot(name='dissipated energy',
                                                vis2d=bt.hist['energy'])
    w.viz_sheet.viz2d_list.append(fw)
    w.viz_sheet.viz2d_list.append(viz2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)
    viz2d_cb_strain = Viz2DStrainInCrack(name='strain in crack',
                                         vis2d=bt.hist['crack band'])
    w.viz_sheet.viz2d_list.append(viz2d_cb_strain)
    viz2d_cb_a = Viz2DTA(name='crack length',
                         vis2d=bt.hist['crack band'],
                         visible=False)
    viz2d_cb_dGda = Viz2DdGdA(name='energy release per crack extension',
                              vis2d=bt.hist['energy'],
                              vis2d_cb=bt.hist['crack band'],
                              visible=False)
    w.viz_sheet.viz2d_list.append(viz2d_cb_a)
    w.viz_sheet.viz2d_list.append(viz2d_cb_dGda)
    w.viz_sheet.monitor_chunk_size = 1
    return w
Beispiel #13
0
def run_po_paper2_4layers(*args, **kw):

    A_roving = 0.49
    h_section = 20.0
    b_section = 100.0
    n_roving = 11.0
    tt4_n_layers = 6
    A_f4 = n_roving * tt4_n_layers * A_roving
    A_c4 = h_section * b_section
    A_m4 = A_c4 - A_f4
    P_b4 = tt4_n_layers
    E_f = 180000.0
    E_m = 30000.0
    s_arr = np.array([
        0., 0.004, 0.0063, 0.0165, 0.0266, 0.0367, 0.0468, 0.057, 0.0671, 0.3,
        1.0
    ],
                     dtype=np.float_)
    tau_arr = 0.7 * np.array([
        0., 40, 62.763, 79.7754, 63.3328, 53.0229, 42.1918, 28.6376, 17, 3, 1
    ],
                             dtype=np.float)
    po = PullOutModel(name='t33_pullout_multilinear',
                      n_e_x=100,
                      k_max=1000,
                      w_max=2.0)
    po.fixed_boundary = 'clamped left'
    po.loading_scenario.set(loading_type='monotonic')
    po.mats_eval.trait_set(E_f=E_f, E_m=E_m)
    po.mats_eval.s_tau_table = [s_arr, tau_arr]
    po.cross_section.trait_set(A_f=A_f4, A_m=A_m4, P_b=P_b4)
    po.geometry.trait_set(L_x=500)
    po.trait_set(w_max=0.95, n_e_x=100)
    po.tline.trait_set(step=0.005)

    po.run()

    w = BMCSWindow(model=po)
    po.add_viz2d('load function', 'load-time')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    po.add_viz2d('dissipation', 'dissipation')
    po.add_viz2d('field', 'eps_C', plot_fn='eps_C')
    po.add_viz2d('field', 's', plot_fn='s')
    po.add_viz2d('field', 'sig_C', plot_fn='sig_C')
    po.add_viz2d('field', 'sf', plot_fn='sf')
    po.add_viz2d('dissipation rate', 'dissipation rate')

    w.offline = False
    w.finish_event = True
    w.configure_traits(*args, **kw)
Beispiel #14
0
def run_uniaxial_test():

    ut = UniaxialTestModel(
        n_e_x=1,
        n_e_y=1,
        n_e_z=1,
        k_max=50,
        #mats_eval_type='microplane damage (eeq)'
        #mats_eval_type='microplane damage (odf)'
        mats_eval_type='microplane CSD (eeq)'
        #mats_eval_type='microplane CSD (odf)'
    )
    ut.mats_eval.set(
        # stiffness='algorithmic',
        # epsilon_0=0.001,
        # epsilon_f=0.005
    )

    ut.loading_scenario.set(loading_type='monotonic')
    ut.loading_scenario.set(number_of_cycles=1)
    ut.loading_scenario.set(maximum_loading=-0.0075)
    ut.loading_scenario.set(unloading_ratio=0.1)
    ut.loading_scenario.set(amplitude_type="constant")
    ut.loading_scenario.set(loading_range="non-symmetric")

    # ut.loading_scenario.set(loading_type='monotonic')
    # ut.loading_scenario.set(maximum_loading=-0.01)
    #ut.w_max = -0.00001
    ut.tline.step = 0.005
    ut.cross_section.h = 1
    ut.geometry.L = 1

    # ut.get_PW()

    # print(ut.get_PW())

    w = BMCSWindow(model=ut)
    ut.add_viz2d('load function', 'load-time')
    ut.add_viz2d('F-w', 'load-displacement')

    vis3d = Vis3DPoll()
    ut.tloop.response_traces.append(vis3d)
    viz3d = Viz3DPoll(vis3d=vis3d)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    #    w.run()
    w.offline = False
    #    w.finish_event = True
    w.configure_traits()
Beispiel #15
0
def run_debontrix_lin():
    from view.window import BMCSWindow

    po = PullOutModelLin(fets=FETS1D52L4ULRH(),
                         n_E=5,
                         L_x=1.0,
                         G=1.0)

    w = BMCSWindow(model=po)
    # po.add_viz2d('F-w')
    # po.add_viz2d('field')
    rt = po.ts.rtrace_mngr['Fi,right over w_right']
    rt.add_viz2d('time function')
    w.configure_traits()
Beispiel #16
0
def run_dcb_2d(*args, **kw):

    bt = DCBTestModel(n_e_x=2, n_e_y=30,
                      k_max=1200,
                      mats_eval_type='scalar damage'
                      #mats_eval_type='microplane damage (odf)'
                      )
    bt.mats_eval.trait_set(
        stiffness='algorithmic',
        E=30000.0,
        nu=0.2
    )
    bt.mats_eval.omega_fn.trait_set(
        f_t=3.0,
        G_f=0.004
    )

    bt.w_max = 0.1
    bt.tline.step = 0.1
    bt.cross_section.h = 200
    bt.cross_section.b = 50
    bt.geometry.L = 6000
    bt.geometry.a = 300
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis2d_energy = Vis2DEnergy(model=bt)
    viz2d_energy = Viz2DEnergy(name='dissipation', vis2d=vis2d_energy)
    viz2d_energy_rates = Viz2DEnergyReleasePlot(
        name='dissipation rate', vis2d=vis2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)

    vis3d = Vis3DStressField()
    bt.tloop.response_traces.append(vis3d)
    bt.tloop.response_traces.append(vis2d_energy)
    viz3d = Viz3DStressField(vis3d=vis3d, warp_factor=1000.0)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

#     w.run()
#     w.offline = True
#     w.finish_event = True
    w.configure_traits()
Beispiel #17
0
def run_bending3pt_mic_odf(*args, **kw):

    bt = DCBTestModel(n_e_x=2,
                      n_e_y=2,
                      n_e_z=1,
                      k_max=500,
                      mats_eval_type='scalar damage'
                      #mats_eval_type='microplane damage (odf)'
                      )
    bt.mats_eval.trait_set(
        # stiffness='algorithmic',
        epsilon_0=59e-3,
        epsilon_f=400e-3)

    bt.w_max = 10.0
    bt.tline.step = 0.2
    bt.cross_section.h = 100
    bt.cross_section.b = 50
    bt.geometry.L = 1000
    bt.geometry.a = 200
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    vis2d_energy = Vis2DEnergy(model=bt)
    viz2d_energy = Viz2DEnergy(name='dissipation', vis2d=vis2d_energy)
    viz2d_energy_rates = Viz2DEnergyReleasePlot(name='dissipation rate',
                                                vis2d=vis2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)

    vis3d = Vis3DSDamage()
    bt.tloop.response_traces.append(vis3d)
    bt.tloop.response_traces.append(vis2d_energy)
    viz3d = Viz3DSDamage(vis3d=vis3d, warp_factor=10.0)
    w.viz_sheet.add_viz3d(viz3d)
    w.viz_sheet.monitor_chunk_size = 1

    #     w.run()
    #     w.offline = True
    #     w.finish_event = True
    w.configure_traits()
Beispiel #18
0
def run_pullout_const_shear(*args, **kw):
    po = PullOutModel(name='t32_analytical_pullout')
    po.geometry.trait_set(L_x=800)
    #     po.cross_section.trait_set(A_f=4.5, P_b=1.0)
    #     po.material.trait_set(E_f=9 * 180000.0, tau_pi_bar=2.77 * 9)
    po.tline.step = 0.01

    w = BMCSWindow(sim=po)
    # po.add_viz2d('load function')
    po.add_viz2d('F-w', 'load-displacement')
    po.add_viz2d('field', 'shear flow', plot_fn='sf')
    po.add_viz2d('field', 'displacement', plot_fn='u')
    po.add_viz2d('field', 'strain', plot_fn='eps')
    #    po.add_viz2d('field', 'sig', plot_fn='sig')
    w.viz_sheet.monitor_chunk_size = 2

    w.run()
    w.offline = False
    w.configure_traits(*args, **kw)
Beispiel #19
0
def run_pullout_multilinear():
    po = PullOutModel(n_e_x=8, k_max=500)
    po.w_max = 20.0
    A_f = 16.44
    po.cross_section.A_f = A_f
    r = np.sqrt(A_f / np.pi)
    po.cross_section.P_b = 2 * r * np.pi
    po.mats_eval_type = 'multilinear'
    po.tline.step = 0.01
    po.geometry.L_x = 1.0
    po.loading_scenario.set(loading_type='monotonic')

    # todo
    po.material.set(s_data='0, 1.0, 5.0, 10.0, 20.0',
                    tau_data='0, 14.0, 16.5, 15.0, 7.0')
    po.material.update_bs_law = True
    Pu = po.rt_Pu
    w = BMCSWindow(model=po)
    Pu.add_viz2d('diagram')
    po.add_viz2d('field', 'u_C', plot_fn='u_C')
    w.offline = False
    w.finish_event = True
    w.configure_traits()
Beispiel #20
0
    )

    loading_scenario_node = TreeNode(
        node_for=[LoadingScenario],
        auto_open=True,
        children='tree_node_list',
        label='node_name',
        view='tree_view',
    )

    bond_slip_model_node = TreeNode(
        node_for=[AllicheConcreteFatigueModel],
        auto_open=True,
        children='tree_node_list',
        label='node_name',
        view='tree_view',
        #menu=Menu(plot_self, NewAction),
    )

    # =========================================================================
    # List of all custom nodes
    # =========================================================================

    custom_node_list = [
        material_node, loading_scenario_node, bond_slip_model_node
    ]

    model = AllicheConcreteFatigueModel(mats_eval=MATSEvalAllicheFatigue())
    w = BMCSWindow(root=model)
    w.configure_traits()
Beispiel #21
0
    @cached_property
    def _get_tloop(self):
        return TimeLoop(tline=self.tline)

    def eval(self):
        self.tloop.eval()

    rt = Instance(ResponseTracer, ())

    bc_dof = Instance(BCDof)

    def _bc_dof_default(self):
        return BCDof(time_function=TFunPWLInteractive())

    tree_view = View(
        VGroup(
            Include('actions'),
            UItem('bc_dof@', height=500)
        )
    )


if __name__ == '__main__':
    model = DemoModel()
    model.run()

    tv = BMCSWindow(model=model)
    model.rt.add_viz2d('time_profile', 'response tracer #1')
    tv.finish_event = True
    tv.configure_traits()
Beispiel #22
0
        return epsilon_c_arr, sigma_arr

    traits_view = View(VGroup(
        Item('E_f'),
        Item('E_m'),
        Item('tau'),
        Item('r'),
        Item('rho'),
        Item('m'),
        Item('sigma_mu'),
        Item('sigma_fu'),
        label='Material parameters',
        id='scm.params',
    ),
                       id='scm',
                       dock='horizontal',
                       resizable=True,
                       height=0.8,
                       width=0.8)

    tree_view = traits_view
    viz2d_classes = {'sig-eps': Viz2DSCMSigEps}


if __name__ == '__main__':
    from view.window import BMCSWindow
    scm = SCM()
    w = BMCSWindow(model=scm)
    scm.add_viz2d('sig-eps', 's-e')
    w.configure_traits()
Beispiel #23
0
    )
    L_c = 2.0
    E = 20000.0
    eps_0 = 120.e-6
    #eps_f = 7.0e-3
    f_t = 2.5
    G_f = 0.1
    bt.mats_eval.trait_set(stiffness='secant', E=E, nu=0.2)
    bt.mats_eval.omega_fn.trait_set(f_t=f_t, G_f=G_f, L_s=L_c)

    bt.w_max = 2.5
    bt.tline.step = 0.02
    bt.cross_section.b = 100
    bt.geometry.trait_set(L=900, H=110, a=10, L_c=L_c)
    bt.loading_scenario.trait_set(loading_type='monotonic')
    w = BMCSWindow(model=bt)
    #    bt.add_viz2d('load function', 'load-time')
    bt.add_viz2d('F-w', 'load-displacement')

    viz2d_Fw = w.viz_sheet.viz2d_dict['load-displacement']
    vis2d_energy = bt.response_traces['energy']
    viz2d_energy_rates = Viz2DEnergyReleasePlot(name='dissipated energy',
                                                vis2d=vis2d_energy)
    w.viz_sheet.viz2d_list.append(viz2d_energy_rates)
    w.viz_sheet.monitor_chunk_size = 1

    L_c_list = [0.1]
    G_f_list = [0.1, 0.2]
    n_e_x_li = [15, 20, 25]
    colors = ['blue', 'green', 'orange', 'yellow', 'black']
    bt.mats_eval.omega_fn.trait_set(L_s=L_c_list[0])
Beispiel #24
0
        'slip': Vis2DField(var='slip'),
        'strain': Vis3DTensorField(var='eps_ab'),
        'stress': Vis3DTensorField(var='sig_ab'),
        'damage': Vis3DTensorField(var='phi_ab'),
        #        'kinematic hardening': Vis3DStateField(var='z_a')
    }
)

xd12.hidden = True

s.tloop.k_max = 1000
s.tline.step = 0.005
s.tstep.fe_domain.serialized_subdomains
fw = Viz2DFW(name='Pw', vis2d=s.hist['Pw'])
fslip = Viz2DField(name='slip', vis2d=s.hist['slip'])

w = BMCSWindow(sim=s)
w.viz_sheet.viz2d_list.append(fw)
w.viz_sheet.viz2d_list.append(fslip)
strain_viz = Viz3DTensorField(vis3d=s.hist['strain'])
w.viz_sheet.add_viz3d(strain_viz)
stress_viz = Viz3DTensorField(vis3d=s.hist['stress'])
w.viz_sheet.add_viz3d(stress_viz)
viz_damage = Viz3DTensorField(vis3d=s.hist['damage'])
w.viz_sheet.add_viz3d(viz_damage)
w.viz_sheet.monitor_chunk_size = 1

w.run()
time.sleep(10)
w.configure_traits()
Beispiel #25
0
        return XDomainSinglePoint()

    traits_view = View(
        resizable=True,
        width=1.0,
        height=1.0,
        scrollable=True,
    )

    tree_view = traits_view


if __name__ == '__main__':
    from ibvpy.mats.mats3D import MATS3DMplCSDEEQ
    from ibvpy.mats.mats3D.mats3D_plastic.vmats3D_desmorat import \
        MATS3DDesmorat
    from ibvpy.rtrace.record_vars import RecordVars
    import time
    e = MATSExplore(record={'vars': RecordVars()})
    e.tline.step = 0.01
    viz2d_sig_eps = Viz2DSigEps(name='stress-strain', vis2d=e.hist['vars'])

    w = BMCSWindow(model=e)
    w.viz_sheet.viz2d_list.append(viz2d_sig_eps)
    w.viz_sheet.n_cols = 1
    w.viz_sheet.monitor_chunk_size = 10
    w.offline = False
    #     w.run()
    #     time.sleep(2)
    w.configure_traits()