def _get_bc_col_hinge_list(self): constraint = [] column = self.fe_grid_column for i in range(0, self.n_elems_col): dof_const = [ BCSlice(var='u', dims=[0, 1, 2], slice=column[i, 0, 0, 0, 0, 0], link_slice=column[-1 - i, -1, 0, -1, -1, 0], link_coeffs=[-1.0], value=0.0) ] constraint = constraint + dof_const for i in range(0, self.n_elems_col): dof_const = [ BCSlice(var='u', dims=[0, 1, 2], slice=column[0, -1 - i, 0, 0, -1, 0], link_slice=column[-1, i, 0, -1, 0, 0], link_coeffs=[-1.0], value=0.0) ] constraint = constraint + dof_const return constraint
def _get_lc_g_list(self): # slices roof = self.fe_grid_roof column = self.fe_grid_column upper_surf = roof[:, :, -1, :, :, -1] bottom_edge_roof = roof[:, 0, -1, :, 0, -1] left_edge_roof = roof[0, :, -1, 0, :, -1] # loads in global z- direction material_density_roof = -22.4e-3 # [MN/m^3] material_density_column = -26e-3 # [MN/m^3] additional_surface_load = -0.20e-3 # [MN/m^2] additional_t_constr = -0.02 * 22.4e-3 edge_load = -0.35e-3 # [MN/m] return [ BCSlice(var='f', value=material_density_roof, dims=[2], integ_domain='global', slice=roof[:, :, :, :, :, :]), BCSlice(var='f', value=material_density_column, dims=[2], integ_domain='global', slice=column[:, :, :, :, :, :]), ]
def _get_tloop(self): self.fets.vtk_r *= 0.95 domain = self.fe_grid self.center_top_dof = domain[-1, -1, -1, -1].dofs # NOTE: additional line-loads at the edge of the roof need to be considered! # upper_surface = domain[:, :, -1, :, :, -1] # whole_domain = domain[:, :, :, :, :, :] bcond_list = [ BCSlice(var='u', dims=[0, 1], slice=domain[0, 0, 0, 0], value=0), BCSlice(var='u', dims=[0], slice=domain[0, -1, 0, -1], value=0), ] # w_z = domain[-1, -1, -1, -1].dofs[0] # self.f_w_diagram = RTraceGraph( name = 'load - corner deflection', # var_x = 'U_k', idx_x = w_z, # var_y = 'time', idx_y = 0, # record_on = 'update' ) # rtrace_list = self.rtrace_list#[ self.f_w_diagram ] + self.rtrace_list ts = TS(sdomain=[domain], dof_resultants=True, bcond_list=bcond_list, rtrace_list=self.rtrace_list) # Add the time-loop control tloop = TLoop(tstepper=ts, tolerance=1e-4, tline=self.tline) return tloop
def _get_link_bc_list(self): r00, r10, r01, r11 = self.fe_grid_roofs link_bc_list = [ BCSlice(var='u', dims=[0, 1, 2], slice=r00[-1, :, -1, -1, :-1, -1], link_slice=r10[0, :, -1, 0, :-1, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=r01[:, 0, -1, :-1, 0, -1], link_slice=r00[:, -1, -1, :-1, -1, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=r11[0, :, -1, 0, 1:, -1], link_slice=r01[-1, :, -1, -1, 1:, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=r10[:, -1, -1, 1:, -1, -1], link_slice=r11[:, 0, -1, 1:, 0, -1], link_coeffs=[1.0], value=0.), ] return link_bc_list
def _get_link_column_list(self): roof = self.fe_grid_roof column = self.fe_grid_column link_column_list = [] for i in range(0, self.n_elems_col): slice = [ BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter - self.n_elems_col + i, self.n_elems_xy_quarter + i, 0, 0, 0, 0], link_slice=column[0, i, -1, 0, 0, -1], link_coeffs=[1.0], value=0.) ] link_column_list = link_column_list + slice for i in range(0, self.n_elems_col): slice = [ BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter + i + 1, self.n_elems_xy_quarter - self.n_elems_col + i + 1, 0, 0, 0, 0], link_slice=column[-1, i, -1, -1, -1, -1], link_coeffs=[1.0], value=0.) ] link_column_list = link_column_list + slice for i in range(0, self.n_elems_col): slice = [ BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter + i, self.n_elems_xy_quarter + self.n_elems_col - i, 0, 0, 0, 0], link_slice=column[i, -1, -1, 0, -1, -1], link_coeffs=[1.0], value=0.) ] link_column_list = link_column_list + slice for i in range(0, self.n_elems_col): slice = [ BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter - self.n_elems_col + i + 1, self.n_elems_xy_quarter - i - 1, 0, 0, 0, 0], link_slice=column[i, 0, -1, -1, 0, -1], link_coeffs=[1.0], value=0.) ] link_column_list = link_column_list + slice return link_column_list
def demo3d(): # Geometry # length = 1.0 from ibvpy.fets.fets3D import FETS3D8H, FETS3D8H20U, FETS3D8H27U, FETS3D8H20U from ibvpy.mats.mats3D import MATS3DElastic # Material and FE Formulation # lin_x_temperature = TemperatureLinFn(length=length, n_dims=3, offset=0.5) fets_eval = FETS3D8H20U(mats_eval=MATS3DElastic( E=30e3, nu=0.2, initial_strain=lin_x_temperature)) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, length, length), shape=(6, 3, 3), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0, 1, 2], slice=domain[0, 0, 0, 0, 0, 0], value=0), BCSlice(var='u', dims=[0, 1], slice=domain[0, 0, -1, 0, 0, -1], value=0), BCSlice(var='u', dims=[0], slice=domain[0, -1, 0, 0, -1, 0], value=0), ] rtrace_list = [ sig_trace, eps_trace, eps0_trace, eps1t_trace, max_p_sig_trace, u_trace ] for rtrace in rtrace_list: rtrace.position = 'int_pnts' rtrace.warp = False corner_dof = domain[-1, -1, -1, -1, -1, -1].dofs[0, 0, 2] ts = TS(sdomain=domain, bcond_list=bcond_list, rtrace_list=rtrace_list) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=3, max=1.0)) tloop.eval() # Postprocessing # app = IBVPyApp(ibv_resource=tloop) app.main()
def __demo__(): from ibvpy.api import \ TStepper as TS, RTraceGraph, RTraceDomainListField, TLoop, \ TLine, BCSlice from ibvpy.mats.mats1D.mats1D_elastic.mats1D_elastic import MATS1DElastic fets_eval = FETS1D2L(mats_eval=MATS1DElastic(E=10.)) from ibvpy.mesh.fe_grid import FEGrid # Discretization domain = FEGrid(coord_max=(3., ), shape=(3, ), fets_eval=fets_eval) ts = TS(dof_resultants=True, sdomain=domain, bcond_list=[ BCSlice(var='u', dims=[0], value=0, slice=domain[0, 0]), BCSlice(var='f', dims=[0], value=1, slice=domain[-1, -1]) ], rtrace_list=[ RTraceGraph(name='Fi,right over u_right (iteration)', var_y='F_int', idx_y=0, var_x='U_k', idx_x=1), RTraceDomainListField(name='Stress', var='sig_app', idx=0), RTraceDomainListField(name='Displacement', var='u', idx=0, warp=True), RTraceDomainListField(name='N0', var='N_mtx', idx=0, record_on='update') ]) # Add the time-loop control tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=0.5, max=1.0)) print '---- result ----' print tloop.eval() print ts.F_int print ts.rtrace_list[0].trace.ydata # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp app = IBVPyApp(ibv_resource=tloop) app.main()
def _get_control_bc(self): return BCSlice( #slice=self.fe_grid[0, 0, :, 0, :, :], slice=self.fe_grid[-1, 0, 0, -1, 0, 0], var='u', dims=[0], value=self.w_max)
def _get_bc_link_dofs(self): return BCSlice(name='link_m', slice=self.fe_grid1[:, :], link_slice=self.fe_grid2[:, :], dims=[1], link_coeffs=[-1], value=0)
def _get_fixed_y(self): n_e_y = int(self.n_e_y / 2) + 1 print(self.n_e_y, n_e_y) return BCSlice(slice=self.fe_grid[0, n_e_y, 0, 0], var='u', dims=[1], value=0)
def _get_fixed_left_x(self): a_L = self.geometry.a / self.geometry.L n_a = int(a_L * self.n_e_y) print('n_a', n_a) return BCSlice(slice=self.fe_grid[0, :, :, 0, :, :], var='u', dims=[0], value=0)
def _get_bc_col_clamped_list(self): column = self.fe_grid_column constraint = [ BCSlice(var='u', dims=[0, 1, 2], slice=column[:, :, 0, :, :, 0], value=0.0) ] return constraint
def _get_link_right_cs(self): f_dof = self.fe_grid[-1, :, -1, -1, :, -1] b_dof = self.fe_grid[-1, :, 0, -1, :, 0] return BCSlice(name='link_cs', slice=f_dof, link_slice=b_dof, dims=[0], link_coeffs=[1], value=0)
def _get_bc_plate_column_link_list(self): ''' links all column nodes to plate nodes ''' column = self.fe_grid_column plate = self.fe_grid_plate slice_1 = [ BCSlice(var='u', dims=[0, 1, 2], slice=plate[:, :, 0, -1, -1, 0], link_slice=column[:, :, -1, -1, -1, -1], link_coeffs=[1.0], value=0.) ] slice_2 = [ BCSlice(var='u', dims=[0, 1, 2], slice=plate[:, :, 0, 0, 0, 0], link_slice=column[:, :, -1, 0, 0, -1], link_coeffs=[1.0], value=0.) ] slice_3 = [ BCSlice(var='u', dims=[0, 1, 2], slice=plate[:, :, 0, 0, -1, 0], link_slice=column[:, :, -1, 0, -1, -1], link_coeffs=[1.0], value=0.) ] slice_4 = [ BCSlice(var='u', dims=[0, 1, 2], slice=plate[:, :, 0, -1, 0, 0], link_slice=column[:, :, -1, -1, 0, -1], link_coeffs=[1.0], value=0.) ] return slice_1 + slice_2 + slice_3 + slice_4
def _get_displ_bc_list(self): displ_bc_list = [] for roof, column in zip(self.fe_grid_roofs, self.fe_grid_columns): bc_list = [ BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter - 1, self.n_elems_xy_quarter - 1, 0, 0, -1, 0], link_slice=column[0, 0, -1, 0, 0, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter - 1, self.n_elems_xy_quarter - 1, 0, -1, 0, 0], link_slice=column[-1, 0, -1, -1, 0, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter, self.n_elems_xy_quarter, 0, -1, 0, 0], link_slice=column[-1, -1, -1, -1, -1, -1], link_coeffs=[1.0], value=0.), BCSlice(var='u', dims=[0, 1, 2], slice=roof[self.n_elems_xy_quarter, self.n_elems_xy_quarter, 0, 0, -1, 0], link_slice=column[0, -1, -1, 0, -1, -1], link_coeffs=[1.0], value=0.), BCSlice( var='u', dims=[0, 1, 2], slice=column[:, :, 0, :, :, 0], # slice = column[ 0, 0, 0, -1, -1, 0 ], value=0.0) ] displ_bc_list += bc_list return displ_bc_list
def demo2d(): # Geometry # length = 1.0 from ibvpy.fets.fets2D import FETS2D4Q, FETS2D4Q8U, FETS2D4Q12U from ibvpy.mats.mats2D import MATS2DElastic # Material and FE Formulation # lin_x_temperature = TemperatureLinFn(length=length, n_dims=2) fets_eval = FETS2D4Q12U(mats_eval=MATS2DElastic( E=30e5, nu=0.2, initial_strain=lin_x_temperature)) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, length, 0.), shape=(10, 10), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0, 1], slice=domain[0, 0, 0, 0], value=0), BCSlice(var='u', dims=[1], slice=domain[0, -1, 0, -1], value=0), ] rtrace_list = [sig_trace, eps_trace, eps0_trace, eps1t_trace, u_trace] ts = TS( sdomain=domain, bcond_list=bcond_list, rtrace_list=rtrace_list, ) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) tloop.eval() # Postprocessing # app = IBVPyApp(ibv_resource=tloop) app.main()
def _get_link_edge_list(self): ''' links all edge nodes to one node, for this node boundary conditions are applied, the complete force within the edge hinge can therefore be evaluated at one node ''' roof = self.fe_grid_roof dof_constraint_0 = [ BCSlice(var='u', dims=[1], slice=roof[:, -1, -1, :, -1, -1], value=0.0) ] dof_constraint_1 = [ BCSlice(var='u', dims=[0], slice=roof[-1, :, -1, -1, :, -1], value=0.0) ] link_edge_list = dof_constraint_0 + dof_constraint_1 return link_edge_list
def _get_bc_outer_boundary(self): ''' links all plate corner nodes of each elements to the adjacent elements of the roof ''' roof = self.fe_grid_roof slice_1 = BCSlice(var = 'u', value = -0.01, dims = [2], integ_domain = 'global', slice = roof[0, ::2, 0, 0, -1, 0]) slice_2 = BCSlice(var = 'u', value = -0.01, dims = [2], integ_domain = 'global', slice = roof[0, ::2, -1, 0, -1, -1]) slice_3 = BCSlice(var = 'u', value = -0.01, dims = [2], integ_domain = 'global', slice = roof[0, 0, 0, 0, -1, 0]) slice_4 = BCSlice(var = 'u', value = -0.01, dims = [2], integ_domain = 'global', slice = roof[0, 0, -1, 0, -1, -1]) return [ slice_1, slice_2, slice_3, slice_4 ]
def _get_bc_roof_deadweight(self): ''' links all plate corner nodes of each elements to the adjacent elements of the roof ''' roof = self.fe_grid_roof slice_1 = BCSlice(var = 'f', value = self.material_density_roof, dims = [2], integ_domain = 'global', slice = roof[:, :, :, :, :, :]) return [ slice_1 ]
def _get_bc_plate_list(self): ''' links all plate corner nodes of each elements to the adjacent elements of the roof ''' plate = self.fe_grid_plate slice_1 = BCSlice(var = 'u' , dims = [0, 1, 2], slice = plate[ : , : , 0, :, :, 0], value = 0.) return [ slice_1 ]
def _get_control_bc(self): ls = self.loading_scenario return BCSlice( # slice=self.fe_grid[-1, :, :, -1, :, :], # var='u', dims=[0], value=self.w_max slice=self.fe_grid[-1, :, :, -1, :, :], var='u', dims=[0], value=self.w_max, time_function=ls)
def _get_bc_roof_list(self): ''' links all plate corner nodes of each elements to the adjacent elements of the roof ''' bc_roof_list = [] n_from_center = 3 roof, plate = self.fe_grid_roof, self.fe_grid_plate slice_1 = [BCSlice(var = 'u' , dims = [0, 1, 2], slice = roof[self.n_elems_xy_quarter - n_from_center , self.n_elems_xy_quarter, 0, 0, 0, 0 ], # link_slice = plate[ 0 , 0 , -1, 0, 0, -1], link_coeffs = [1.0], value = 0.)] slice_2 = [BCSlice(var = 'u' , dims = [0, 1, 2], slice = roof[self.n_elems_xy_quarter, self.n_elems_xy_quarter - n_from_center, 0, 0, 0, 0 ], # link_slice = plate[ -1, 0, -1, -1, 0, -1], link_coeffs = [1.0], value = 0.)] slice_3 = [BCSlice(var = 'u' , dims = [0, 1, 2], slice = roof[self.n_elems_xy_quarter + n_from_center, self.n_elems_xy_quarter, 0, 0, 0, 0 ], # link_slice = plate[ -1 , -1 , -1, -1, -1, -1], link_coeffs = [1.0], value = 0.)] slice_4 = [BCSlice(var = 'u' , dims = [0, 1, 2], slice = roof[self.n_elems_xy_quarter , self.n_elems_xy_quarter + n_from_center, 0, 0, 0, 0 ], # link_slice = plate[ 0 , -1 , -1, 0, -1, -1], link_coeffs = [1.0], value = 0.)] bc_roof_list = bc_roof_list + \ slice_1 + slice_2 + slice_3 + slice_4 return bc_roof_list
def _get_lc_s_list(self): # slices roof = self.fe_grid_roof upper_surf = roof[:, :, -1, :, :, -1] # loads in global z- direction snow_load = -0.85e-3 return [ BCSlice(var='f', value=snow_load, dims=[2], integ_domain='global', slice=upper_surf) ]
def demo1d(): # Geometry # length = 1.0 # Material and FE Formulation # from ibvpy.fets.fets1D import FETS1D2L, FETS1D2L3U from ibvpy.mats.mats1D import MATS1DElastic mats_eval = MATS1DElastic(E=100., initial_strain=TemperatureLinFn(length=length, n_dims=1, offset=0.5)) fets_eval = FETS1D2L3U(mats_eval=mats_eval) fets_eval.vtk_r *= 0.99 # Discretization # domain = FEGrid(coord_max=(length, 0., 0.), n_elems=(10, ), fets_eval=fets_eval) bcond_list = [ BCSlice(var='u', dims=[0], slice=domain[0, 0], value=0), #BCSlice( var = 'u', dims = [0], slice = domain[-1, -1], value = 0 ) ] ts = TS(sdomain=domain, bcond_list=bcond_list, rtrace_list=[sig_trace, eps_trace, eps0_trace, eps1t_trace]) # Time integration # tloop = TLoop(tstepper=ts, tline=TLine(min=0.0, step=1, max=1.0)) tloop.eval() # Postprocessing # legend = [] plot_sig(eps_trace, 'eps', legend) plot_sig(eps0_trace, 'eps0', legend) plot_sig(eps1t_trace, 'eps1t', legend) p.legend(legend) p.show()
def _get_bc_fix_dofs_in_the_hollow(self): idx_min, idx_max = self.idx_min, self.idx_max roof = self.fe_grid_roof link_slice = roof[ idx_min, idx_min, 0, 0, 0, 0 ] s_list = [ roof[ idx_min:idx_max - 1, idx_min:idx_max - 1, :, 1:, 1:, : ], roof[ idx_max - 1, idx_min:idx_max - 1, :, 1:-1, 1:, : ], roof[ idx_min:idx_max - 1, idx_max - 1, :, 1:, 1:-1, : ], roof[ idx_max - 1, idx_max - 1, :, 1:-1, 1:-1, : ] ] return [ BCSlice(var = 'u' , dims = [0, 1, 2], slice = s, link_slice = link_slice, link_coeffs = [0], value = 1.0) for s in s_list ]
def _get_force_bc_list(self): # NOTE: additional line-loads at the edge of the roof need to be considered! force_bc_list = [] for roof, column in zip(self.fe_grid_roofs, self.fe_grid_columns): upper_surface = roof[:, :, -1, :, :, -1] # whole_roof = roof[:, :, :, :, :, :] # whole_column = column[:, :, :, :, :, :] force_bc = [ # # LC0: dead load BCSlice(var='f', value=self.f_z, dims=[2], integ_domain='global', slice=upper_surface), # # LC1: dead load # BCSlice( var = 'f', value = self.material_density_roof, dims = [2], # integ_domain = 'global', # slice = whole_roof ), # BCSlice( var = 'f', value = self.material_density_column, dims = [2], # integ_domain = 'global', # slice = whole_column ), # LC2: additional dead load # BCSlice( var = 'f', value = self.surface_load_gA, dims = [2], # integ_domain = 'global', # slice = upper_surface ), # # LC3: snow load # BCSlice( var = 'f', value = self.surface_load_s, dims = [2], # integ_domain = 'global', # slice = upper_surface ) ] force_bc_list += force_bc return force_bc_list
def _get_bc_list(self): mid_zone_specimen = self.mid_zone_specmn_fe_grid load_zone_specimen = self.load_zone_specmn_fe_grid outer_zone_specimen = self.outer_zone_specmn_fe_grid if self.elstmr_flag: elastomer = self.elstmr_fe_grid #-------------------------------------------------------------- # boundary conditions for the symmetry #-------------------------------------------------------------- # symmetry in the xz-plane # (Note: the x-axis corresponds to the axis of symmetry along the longitudinal axis of the beam) # bc_outer_zone_symplane_xz = BCSlice(var='u', value=0., dims=[1], slice=outer_zone_specimen[:, 0, :, :, 0, :]) bc_load_zone_symplane_xz = BCSlice(var='u', value=0., dims=[1], slice=load_zone_specimen[:, 0, :, :, 0, :]) bc_mid_zone_symplane_xz = BCSlice(var='u', value=0., dims=[1], slice=mid_zone_specimen[:, 0, :, :, 0, :]) if self.elstmr_flag: bc_el_symplane_xz = BCSlice(var='u', value=0., dims=[1], slice=elastomer[:, 0, :, :, 0, :]) # symmetry in the yz-plane # bc_mid_zone_symplane_yz = BCSlice(var='u', value=0., dims=[0], slice=mid_zone_specimen[0, :, :, 0, :, :]) #-------------------------------------------------------------- # boundary conditions for the support #-------------------------------------------------------------- bc_support_0y0 = BCSlice(var='u', value=0., dims=[2], slice=outer_zone_specimen[-1, :, 0, -1, :, 0]) #-------------------------------------------------------------- # connect all grids #-------------------------------------------------------------- link_loadzn_outerzn = BCDofGroup( var='u', value=0., dims=[0, 1, 2], get_dof_method=load_zone_specimen.get_right_dofs, get_link_dof_method=outer_zone_specimen.get_left_dofs, link_coeffs=[1.]) link_midzn_loadzn = BCDofGroup( var='u', value=0., dims=[0, 1, 2], get_dof_method=mid_zone_specimen.get_right_dofs, get_link_dof_method=load_zone_specimen.get_left_dofs, link_coeffs=[1.]) if self.elstmr_flag: link_elstmr_loadzn_z = BCDofGroup( var='u', value=0., dims=[2], get_dof_method=elastomer.get_back_dofs, get_link_dof_method=load_zone_specimen.get_front_dofs, link_coeffs=[1.]) # hold elastomer in a single point in order to avoid kinematic movement yielding singular K_mtx # bc_elstmr_fix = BCSlice(var='u', value=0., dims=[0], slice=elastomer[0, 0, 0, 0, 0, 0]) #-------------------------------------------------------------- # loading #-------------------------------------------------------------- # w_max = center displacement: w_max = self.w_max if self.elstmr_flag: # apply displacement at all top nodes of the elastomer (surface load) # bc_w = BCSlice(var='u', value=w_max, dims=[2], slice=elastomer[:, :, -1, :, :, -1]) else: bc_w = BCSlice( var='u', value=w_max, dims=[2], # slice is only exactly in the center of the loading zone for 'load_zone_shape_x' = 2 # center line of the load zone slice=load_zone_specimen[0, :, -1, -1, :, -1]) # f_max = 0.010 / 4. / self.sym_width # bc_line_f = BCSlice(var = 'f', value = f_max, dims = [2], # # slice is only valid for 'load_zone_shape_x' = 2 # # center line of the load zone # slice = load_zone_specimen[0, :, -1, -1, :, -1]) bc_list = [ bc_outer_zone_symplane_xz, bc_load_zone_symplane_xz, bc_mid_zone_symplane_xz, bc_mid_zone_symplane_yz, # link_midzn_loadzn, link_loadzn_outerzn, bc_support_0y0, # bc_w, ] if self.elstmr_flag: bc_list += [bc_el_symplane_xz, link_elstmr_loadzn_z, bc_elstmr_fix] return bc_list
def _get_fixed_top_y(self): return BCSlice(slice=self.fe_grid[:, -1, :, -1], var='u', dims=[1], value=0)
def app(): avg_radius = 0.03 md = MATS2DScalarDamage(E=20.0e3, nu=0.2, epsilon_0=1.0e-4, epsilon_f=8.0e-4, #epsilon_f = 12.0e-4, #test doubling the e_f stress_state="plane_strain", stiffness="secant", #stiffness = "algorithmic", strain_norm=Rankine()) # me = MATS2DElastic( E = 20.0e3, # nu = 0.2, # stress_state = "plane_strain" ) fets_eval = FETS2D4Q(mats_eval=md)#, ngp_r = 3, ngp_s = 3) n_el_x = 60 # Discretization fe_grid = FEGrid(coord_max=(.6, .15, 0.), shape=(n_el_x, 15), fets_eval=fets_eval) mf = MFnLineArray(xdata=array([0, 1, 2, 7, 8 , 28]), ydata=array([0, 3., 3.2, 3.3, 3.32, 3.72 ])) #averaging function avg_processor = RTNonlocalAvg(avg_fn=QuarticAF(radius=avg_radius, correction=True)) ts = TS(sdomain=fe_grid, u_processor=avg_processor, bcond_list=[ # constraint for all left dofs in y-direction: BCSlice(var='u', slice=fe_grid[0, 0, 0, 0], dims=[0, 1], value=0.), BCSlice(var='u', slice=fe_grid[-1, 0, -1, 0], dims=[1], value=0.), BCSlice(var='u', slice=fe_grid[n_el_x / 2, -1, 0, -1], dims=[1], time_function=mf.get_value, value= -2.0e-5), ], rtrace_list=[ # RTDofGraph(name = 'Fi,right over u_right (iteration)' , # var_y = 'F_int', idx_y = right_dof, # var_x = 'U_k', idx_x = right_dof, # record_on = 'update'), RTraceDomainListField(name='Deformation' , var='eps_app', idx=0, record_on='update'), RTraceDomainListField(name='Displacement' , var='u', idx=1, record_on='update', warp=True), RTraceDomainListField(name='Damage' , var='omega', idx=0, record_on='update', warp=True), # RTraceDomainField(name = 'Stress' , # var = 'sig', idx = 0, # record_on = 'update'), # RTraceDomainField(name = 'N0' , # var = 'N_mtx', idx = 0, # record_on = 'update') ] ) # Add the time-loop control # tl = TLoop(tstepper=ts, tolerance=5.0e-4, KMAX=100, tline=TLine(min=0.0, step=.25, max=10.0)) tl.eval() # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # from ibvpy.plugins.ibvpy_app import IBVPyApp ibvpy_app = IBVPyApp(ibv_resource=ts) ibvpy_app.main()
def _get_control_bc(self): return BCSlice(slice=self.fe_grid[:, -1, :, :, -1, :], var='u', dims=[1], value=-self.w_max)