Пример #1
0
# Note: For the center element an odd numer is necessary for n_elem[0].
#       For the center loading at top an even numkber is necessary.
       

#-------------------------
# ts: 
#-------------------------

#right_dofs = domain[0, 0, 0, 0].dofs[0,0,0]
#print 'right_dofs', right_dofs


right_dofs, right_dofs_points = domain.get_right_dofs()
print 'right_dofs', right_dofs

right_bottom_dofs, right_bottom_dofs_points = domain.get_bottom_right_dofs()
print 'right_bottom_dofs', right_bottom_dofs

tstepper = TS( dof_resultants = True,
               sdomain = domain,
     bcond_list =  [ # loading at the right hand side: 
                     BCDofGroup( var='u', value = 1.0, dims = [0],
                              get_dof_method = domain.get_right_dofs ),

                     # supports at the left hand side:
                     BCDofGroup( var='u', value = 0., dims = [0],
                              get_dof_method = domain.get_left_dofs ),
                     BCDofGroup( var='u', value = 0., dims = [0,1],
                              get_dof_method = domain.get_bottom_left_dofs ) ],
     rtrace_list = [
                     RTraceGraph(name = 'Fi at right over u at right (iteration)' ,
Пример #2
0
def example_with_new_domain():    
    from ibvpy.api import \
        TStepper as TS, MGridDomain, RTraceGraph, RTraceDomainField, TLoop, \
        TLine, IBVPSolve as IS, DOTSEval
    from ibvpy.api import BCDofGroup
    from ibvpy.mats.mats1D5.mats1D5bond import MATS1D5Bond
    from ibvpy.mesh.mgrid_domain import MeshGridAdaptor
    from ibvpy.mesh.fe_grid import FEGrid
    from ibvpy.fets.fets1D5.fets1D52b4uLRH import FETS1D52B4ULRH
    from mathkit.mfn.mfn_line.mfn_line import MFnLineArray
    
    fets_eval = FETS1D52B4ULRH(mats_eval = MATS1D5Bond(Ef = 0., Af =0.,
                                                       Em = 0., Am = 0.,
                                                       bond_fn = MFnLineArray(xdata = [0.,1.],
                                                                              ydata = [0.,1.])))        

    # Tseval for a discretized line domain
    tseval  = DOTSEval( fets_eval = fets_eval )
 
    domain = FEGrid( coord_max = (1., 0.1, 0.0), #new domain
                           shape   = (2,1),
                           n_nodal_dofs = 1,
                           dof_r =  [[-1,-1],[1,-1],[1,1],[-1,1]],           
                           geo_r =  [[-1,-1],[1,-1],[1,1],[-1,1]])
    
                            
    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]"
         bcond_list =  [BCDofGroup(var='u', value = 0.,dims = [0],
                               get_dof_method = domain.get_top_dofs),
#                        BCDofGroup(var='u', value = 0.,dims = [0],
#                               get_dof_method = domain.get_bottom_left_dofs),
                      # imposed displacement for all right dofs in y-direction:
#                        BCDofGroup(var='f', value = -1., dims = [0],
#                                get_dof_method = domain.get_bottom_left_dofs),
                        BCDofGroup(var='f', value = 1./3., dims = [0],
                                get_dof_method = domain.get_bottom_dofs )],
         
                            
         rtrace_list =  [ RTraceGraph(name = 'Internal Force - Displacement' ,
                                var_y = 'F_int', idx_y = domain.get_bottom_right_dofs()[0][0,0],
                                var_x = 'U_k', idx_x = domain.get_bottom_right_dofs()[0][0,0]),
                        RTraceDomainField(name = 'Stress' ,
                                #position = 'int_pnts',
                                var = 'sig_app', idx = 0),
                        RTraceDomainField(name = 'Displacement' ,
                                var = 'u', idx = 0),
                        RTraceDomainField(name = 'Strain' ,
                                var = 'eps_app', idx = 0),
                        RTraceDomainField(name = 'Slip' ,
                                var = 'slip', idx = 0),
                        RTraceDomainField(name = 'Shear' ,
                                var = 'shear', idx = 0)       
                                
#                             RTraceDomainField(name = 'N0' ,
#                                          var = 'N_mtx', idx = 0,
#                                          record_on = 'update')
                      
                ]             
            )
    
    # Add the time-loop control
    tloop = TLoop( tstepper = ts,
             DT = 1.,
             tline  = TLine( min = 0.0,  max = 1.0 ))
    
    tloop.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
    app = IBVPyApp( ibv_resource = tloop )
    app.main()
Пример #3
0
fe_domain2 = FEGrid( coord_min = (0.,0.,0.),
                     geo_transform = gradual_mesh,  
                     coord_max = ( bond_length,height,width), 
                     shape   = ( fineness_bond, fineness_height, fineness_width ),
                     fets_eval = fets_eval2 )

#time_fn = MFnLineArray( #xdata = aranmf = MFnLineArray( #xdata = arange(10),
                       #ydata = array([1.]) )


bc2_y = BCSlice( var='u', value = 0., dims = [2], 
                 slice = fe_domain2[:,1:,0,:,:,0] )
bc2_z = BCSlice( var='u', value = 0., dims = [1], 
                 slice = fe_domain2[:,0,1:,:,0,:] )

loading_dof = fe_domain1.get_bottom_right_dofs()[0][0,0]

u_max = 6.53e-4

ts = TS( sdomain = [ fe_domain1, fe_domain2], 
         dof_resultants = True,
         bcond_list =  [    
                        BCDofGroup( var='u', value = 0., dims = [0],
                                    get_dof_method = fe_domain1.get_top_dofs,
                                    get_link_dof_method = fe_domain2.get_bottom_back_dofs,
                                    link_coeffs = [1.] ),
                        BCDofGroup( var='u', value = 0., dims = [0],
                                    get_dof_method = fe_domain2.get_left_dofs ),
                        bc2_y,
                        bc2_z,
#                        BCDofGroup( var='u', value = 0., dims = [1],