correction = True, avg_function = QuarticAF(Radius = 0.2) ) # Discretization # from ibvpy.mesh.mgrid_domain import MeshGridAdaptor mgrid_adaptor = MeshGridAdaptor( n_nodal_dofs = 2, n_e_nodes_geo = (1,1,0), n_e_nodes_dof = (2,2,0), node_map_geo = [0,1,3,2], node_map_dof = [0,2,8,6,1,5,7,3,4] ) domain = MGridDomain( lengths = (2., 1., 0.), shape = (10, 5, 0), # NOTE: the following properties must be defined and # must correspond to the used element formulation adaptor = mgrid_adaptor ) # for i, elem in enumerate( domain.elements ): # print 'elem.id_number', elem.id_number # print 'elem.nodes_geo', elem.nodes_geo # print 'elem.get_X_mtx()', elem.get_X_mtx() # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # domain.n_dofs
from ibvpy.mesh.mgrid_domain import MeshGridAdaptor # Define a mesh domain adaptor as a cached property to # be constracted on demand mgrid_adaptor = MeshGridAdaptor( n_nodal_dofs = 2, # NOTE: the following properties must be defined and # must correspond to the used element formulation n_e_nodes_geo = (1,1,0), n_e_nodes_dof = (1,1,0), node_map_geo = [0,1,3,2], node_map_dof = [0,1,3,2] ) # Discretization domain = MGridDomain( lengths = (1.,1.,0.), shape = (1,1,0), adaptor = mgrid_adaptor ) right_dof = 2 tstepper = TS( tse = tseval, sdomain = domain, # conversion to list (square brackets) is only necessary for slicing of # single dofs, e.g "get_left_dofs()[0,1]" bcond_list = [ BCDof(var='u', dof = i, value = 0.) for i in domain.get_left_dofs()[:,0] ] + [ BCDof(var='u', dof = i, value = 0.) for i in [domain.get_left_dofs()[0,1]] ] + [ BCDof(var='u', dof = i, value = 0.002 ) for i in domain.get_right_dofs()[:,0] ], rtrace_list = [ RTraceGraph(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'),
tl.eval() # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # sim = IS(tloop=tl) sim.configure_traits() else: # Tseval for a discretized line domain # tseval = DOTSEval(fets_eval=fets_eval) # Discretization # line_domain = MGridDomain(lengths=(3.0, 1.0, 0.0), shape=(8, 8, 0), n_nodal_dofs=2) # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # right_dof = 2 ts = TS( tse=tseval, sdomain=line_domain, bcond_list=[BCDof(var="u", dof=i, value=0.0) for i in line_domain.get_left_dofs()[:, 0]] + [BCDof(var="u", dof=i, value=0.0) for i in line_domain.get_left_dofs()[:, 1]] + [BCDof(var="u", dof=i, value=20) for i in line_domain.get_right_dofs()[:, 1]], rtrace_list=[ RTraceGraph( name="Fi,right over u_right (iteration)", var_y="F_int",
tseval = DOTSEval( fets_eval = fets_eval ) # Discretization # #line_domain = MGridDomain( lengths = (1.,1.,0.), shape = (1,1,0), n_nodal_dofs = 2 ) from ibvpy.mesh.mgrid_domain import MeshGridAdaptor mgrid_adaptor = MeshGridAdaptor( n_nodal_dofs = 2, n_e_nodes_geo = ( 1, 1, 0 ), n_e_nodes_dof = ( 2, 2, 0 ), node_map_geo = [0, 1, 3, 2], node_map_dof = [0, 2, 8, 6, 1, 5, 7, 3, 4] ) domain = MGridDomain( lengths = ( length, heigth, 0. ), shape = ( 8, 4, 0 ), adaptor = mgrid_adaptor ) # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # ts = TS( tse = tseval, sdomain = domain, bcond_list = [ BCDof( var = 'u', dof = i, value = 0. ) for i in [domain.get_bottom_left_dofs()[0, 0]] ] + [ BCDof( var = 'u', dof = i, value = 0. ) for i in [domain.get_bottom_left_dofs()[0, 1]] ] + [ BCDof( var = 'u', dof = i, value = 0. ) for i in [domain.get_bottom_right_dofs()[0, 1]] ] + [ BCDof( var = 'u', dof = i, value = -1.2e-4 ) for i in [domain.get_top_middle_dofs()[0, 1]] ], rtrace_list = [ RTraceGraph( name = 'Fi,right over u_right (iteration)' , var_y = 'F_int', idx_y = domain.get_bottom_left_dofs()[0, 0],
tl.eval() # Put the whole stuff into the simulation-framework to map the # individual pieces of definition into the user interface. # sim = IS(tloop=tl) sim.configure_traits() else: # Tseval for a discretized line domain # tseval = DOTSEval(fets_eval=fets_eval) # Discretization # line_domain = MGridDomain(lengths=(3., 1., 0.), shape=(8, 8, 0), n_nodal_dofs=2) # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # right_dof = 2 ts = TS( tse=tseval, sdomain=line_domain, bcond_list=[ BCDof(var='u', dof=i, value=0.) for i in line_domain.get_left_dofs()[:, 0] ] + [ BCDof(var='u', dof=i, value=0.) for i in line_domain.get_left_dofs()[:, 1]
tseval = DOTSEval( fets_eval = fets_eval) # Discretization # #line_domain = MGridDomain( lengths = (1.,1.,0.), shape = (1,1,0), n_nodal_dofs = 2 ) from ibvpy.mesh.mgrid_domain import MeshGridAdaptor mgrid_adaptor = MeshGridAdaptor( n_nodal_dofs = 2, n_e_nodes_geo = (1,1,0), n_e_nodes_dof = (2,2,0), node_map_geo = [0,1,3,2], node_map_dof = [0,2,8,6,1,5,7,3,4] ) domain = MGridDomain( lengths = (length, heigth, 0.), shape = (6,3,0), adaptor = mgrid_adaptor) # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # mf = MFnLineArray( ydata = [0.,0.0095,0.0105,0.011,0.012,0.02,0.03] ) ts = TS( tse = tseval, sdomain = domain, bcond_list = [ BCDof(var='u', dof = i, value = 0. ) for i in domain.get_left_dofs()[:,0] ]+ [ BCDof(var='u', dof = i, value = 0.) for i in [domain.get_bottom_left_dofs()[0,1]] ] + [ BCDof(var='u', dof = i, time_function = mf.get_value, value = 1. ) for i in domain.get_right_dofs()[:,0] ],
#tseval = DOTSEval( fets_eval = fets_eval) from ibvpy.mesh.mgrid_domain import MeshGridAdaptor mgrid_adaptor = MeshGridAdaptor( n_nodal_dofs = 2, n_e_nodes_geo = (1,1,0), n_e_nodes_dof = (2,2,0), node_map_geo = [0,1,3,2], node_map_dof = [0,2,8,6,1,5,7,3,4] ) # Discretization # #line_domain = MGridDomain( lengths = (1.,1.,0.), shape = (1,1,0), n_nodal_dofs = 2 ) domain = MGridDomain( lengths = (length, heigth, 0.), shape = (11,5,0), adaptor = mgrid_adaptor) # Put the tseval (time-stepper) into the spatial context of the # discretization and specify the response tracers to evaluate there. # ts = TS( tse = tseval, sdomain = domain, bcond_list = [ BCDof(var='u', dof = i, value = 0.) for i in [domain.get_bottom_left_dofs()[0,0]] ] + [ BCDof(var='u', dof = i, value = 0.) for i in [domain.get_bottom_left_dofs()[0,1]] ] + [ BCDof(var='u', dof = i, value = 0.) for i in [domain.get_bottom_right_dofs()[0,1]] ] + [ BCDof(var='u', dof = i, value = -8.e-4 ) for i in [domain.get_top_middle_dofs()[0,1]] ], rtrace_list = [ # RTraceGraph(name = 'Fi,right over u_right (iteration)' , # var_y = 'F_int', idx_y = right_dof,