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
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()
bc=[left_x, right_x, left_y], record={ 'strain': Vis3DTensorField(var='eps_ab'), # 'damage': Vis3DStateField(var='omega_a'), # 'kinematic hardening': Vis3DStateField(var='z_a') }) s = m.sim s.tloop.k_max = 1000 s.tline.step = 0.1 s.tloop.verbose = True s.run() print('area', thickness) F_ti = s.hist.F_t print('left') print(np.sum(F_ti[-1, right_x.dofs])) print('right') print(np.sum(F_ti[-1, left_x.dofs])) mlab.options.backend = 'envisage' f_strain = mlab.figure() scene = mlab.get_engine().scenes[-1] scene.name = 'strain' strain_viz = Viz3DTensorField(vis3d=s.hist['strain']) strain_viz.setup() decorate_figure(f_strain, strain_viz, 200, [70, 20, 0]) mlab.show()
s = m.sim s.tloop.verbose = True s.tloop.k_max = 1000 s.tline.step = 0.1 s.tstep.fe_domain.serialized_subdomains xd12.hidden = True s.run() time.sleep(3) mlab.options.backend = 'envisage' f_strain = mlab.figure() scene = mlab.get_engine().scenes[-1] scene.name = 'strain' strain_viz = Viz3DTensorField(vis3d=s.hist['strain']) strain_viz.setup() strain_viz.warp_vector.filter.scale_factor = 100.0 strain_viz.plot(s.tstep.t_n) decorate_figure(f_strain, strain_viz) if False: f_damage = mlab.figure() scene = mlab.get_engine().scenes[-1] scene.name = 'damage' damage_viz = Viz3DScalarField(vis3d=s.hist['damage']) damage_viz.setup() damage_viz.warp_vector.filter.scale_factor = 100.0 damage_viz.plot(s.tstep.t_n) decorate_figure(f_damage, damage_viz)
# scene.name = 'stress' # stress_viz = Viz3DTensorField(vis3d=s.hist['stress']) # stress_viz.setup() # stress_viz.warp_vector.filter.scale_factor = 100.0 # stress_viz.plot(s.tstep.t_n) # lut_manager = mlab.colorbar(title='sig_ab', orientation='horizontal', nb_labels=5) # # fix the range #======================================================================= ======= mlab.options.backend = 'envisage' print(s.hist['stress']) f_stress = mlab.figure() scene = mlab.get_engine().scenes[-1] scene.name = 'stress' stress_viz = Viz3DTensorField(vis3d=s.hist['stress']) stress_viz.setup() stress_viz.warp_vector.filter.scale_factor = 100.0 stress_viz.plot(s.tstep.t_n) lut_manager = mlab.colorbar( title='sig_ab', orientation='horizontal', nb_labels=5) # fix the range >>>>>>> Stashed changes # print(s.record['stress']) # scalar_lut_manager.data_range = array([0., 1.]) # lut_manager.data_range = np.array([np.min(s.record['stress']), np.max(s.record['stress'])]) #====================================================================== # f_strain = mlab.figure() # scene = mlab.get_engine().scenes[-1] # scene.name = 'strain'
'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()