domain = FEGrid( coord_max = (length,height,0.), 
                 shape   = shape,
                 fets_eval = fets_eval )


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

# alternative way to get the top/bottom middle dof using slicing of FEGrid:
# i.e. get the element which is placed right for the center and then get the lower left node

#bottom_middle_dof = domain[shape[0]/2, 0, 0, 0].dofs[0,0,1]
#top_middle_dof    = domain[shape[0]/2,-1, 0,-1].dofs[0,0,1]

top_middle_dofs, top_middle_dof_points = domain.get_top_middle_dofs()
top_middle_dof = top_middle_dofs[0,1]
print 'top_middle_dof', top_middle_dof

bottom_middle_dofs, bottom_middle_dof_points = domain.get_bottom_middle_dofs()
bottom_middle_dof = bottom_middle_dofs[0,1]
print 'bottom_middle_dof', bottom_middle_dof

tstepper = TS( dof_resultants = True,
               sdomain = domain,
     bcond_list =  [ BCDof( var='u', value = u_max, dof = top_middle_dof ),
                     BCDofGroup( var='u', value = 0., dims = [0,1],
                              get_dof_method = domain.get_bottom_left_dofs ),
                     BCDofGroup( var='u', value = 0., dims = [1],
                              get_dof_method = domain.get_bottom_right_dofs ) ],
     rtrace_list =  [
Exemplo n.º 2
0
height = 1.

# 100 linear elements
shape = (4*20,1)

# Discretization
domain = FEGrid( coord_max = (length,height,0.), 
                 shape   = shape,
                 fets_eval = fets_eval,
                 geo_transform = arch_2d )
#
#right_dofs, right_dof_r = domain.get_right_dofs()
#right_dof = right_dofs[0,0]
#print 'right_dof',right_dof

top_middle_dofs, top_middle_dof_r = domain.get_top_middle_dofs()
# dof in global y-direction
top_middle_dof = top_middle_dofs[0,1]
print 'top_middle_dofs',top_middle_dofs
print 'top_middle_dof' ,top_middle_dof

top_dofs, top_dof_r = domain.get_top_dofs()
# dof in global y-direction
print 'fets_eval.n_e_dofs' , fets_eval.n_e_dofs

if fets_eval.n_e_dofs == 8:
    top_left_middle_dofs = top_dofs[shape[0]/4, :]
elif fets_eval.n_e_dofs == 18:
    top_left_middle_dofs = top_dofs[shape[0]/2, :]
print 'top_left_middle_dofs' , top_left_middle_dofs