コード例 #1
0
ファイル: 2d_bending.py プロジェクト: axelvonderheide/scratch
                                 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],
                      var_x = 'U_k', idx_x = domain.get_bottom_left_dofs()[0, 0],
                      record_on = 'update' ),
#                      RTraceDomainField(name = 'Flux field' ,
#                      var = 'eps', idx = 0,
#                      record_on = 'update'),
              RTraceDomainField( name = 'Deformation' ,
              var = 'u', idx = 1,
              record_on = 'update',
              warp = True ),
コード例 #2
0
#
domain.n_dofs    

angle = 2.
angle_r = angle/180. * pi
s_angle = sin(angle_r)
c_angle = cos(angle_r)
diag = sqrt(2.)

ts = 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]" which elsewise retuns an integer only
         bcond_list =  [ # constraint for all left dofs in x-direction: 
                     BCDof(var='u', dof = domain.get_bottom_left_dofs()[0,0], value = 0.)] +
                      # constraint for all left dofs in y-direction:
                    [BCDof(var='u', dof = domain.get_bottom_left_dofs()[0,1], value = 0.)] + 
                    [BCDof(var='u', dof = domain.get_bottom_right_dofs()[0,0], value = 2.*c_angle - 2.)]+
                    [BCDof(var='u', dof = domain.get_bottom_right_dofs()[0,1], value = 2.*s_angle)]+
                    [BCDof(var='u', dof = domain.get_top_left_dofs()[0,0], value = -1.*s_angle)]+ 
                    [BCDof(var='u', dof = domain.get_top_left_dofs()[0,1], value = c_angle - 1.)]+ 
                    [BCDof(var='u', dof = domain.get_top_right_dofs()[0,0], value = 2.*c_angle - s_angle - 2.)]+
                    [BCDof(var='u', dof = domain.get_top_right_dofs()[0,1], value = 2.*s_angle + c_angle - 1.)]
                    ,
         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'),
#                        RTraceDomainField(name = 'Deformation' ,
コード例 #3
0
ファイル: 2d_tension.py プロジェクト: axelvonderheide/scratch
                                 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] ],
     rtrace_list = [ 
                    RTraceGraph(name = 'Fi,right over u_right (iteration)' ,
                      var_y = 'F_int', idx_y = domain.get_bottom_right_dofs()[0,0],
                      var_x = 'U_k', idx_x = domain.get_bottom_right_dofs()[0,0]),
#                      RTraceDomainField(name = 'Flux field' ,
#                      var = 'eps', idx = 0),
              RTraceDomainField(name = 'Deformation' ,
              var = 'u', idx = 0,
              warp = True),
              RTraceDomainField(name = 'Damage' ,
              var = 'omega', idx = 0,
              position = 'int_pnts',