Example #1
0
    def glob2Elem(self, a, coords):

        a_bar = empty(a.shape)

        R = eye(9)
        crd = zeros(shape=(2, 2))

        crd[0, :] = coords[0, :]
        crd[1, :] = coords[2, :]

        R[:2, :2] = getRotationMatrix(crd)
        R[6:8, 6:8] = R[:2, :2]

        a_bar = dot(R, a)

        return a_bar
Example #2
0
  def glob2Elem( self , a , coords ):

    a_bar = empty( a.shape )

    R     = eye( 9)
    crd   = zeros( shape=(2,2) )
        
    crd[0,:] = coords[0,:]
    crd[1,:] = coords[2,:]

    R[:2,:2]   = getRotationMatrix( crd )
    R[6:8,6:8] = R[:2,:2]

    a_bar      = dot( R , a )

    return a_bar
Example #3
0
    def elem2Glob(self, a_bar, coords):

        a = empty(a_bar.shape)
        R = eye(9)
        crd = zeros(shape=(2, 2))

        crd[0, :] = coords[0, :]
        crd[1, :] = coords[2, :]

        R[:2, :2] = getRotationMatrix(crd)
        R[6:8, 6:8] = R[:2, :2]

        if len(a_bar.shape) == 1:
            a = dot(R.transpose(), a_bar)
        elif len(a_bar.shape) == 2:
            a = dot(R.transpose(), dot(a_bar, R))
        return a
Example #4
0
  def elem2Glob( self , a_bar , coords ):

    a = empty( a_bar.shape )
    R     = eye( 9)
    crd   = zeros( shape=(2,2) )
    
    crd[0,:] = coords[0,:]
    crd[1,:] = coords[2,:]
    
    R[:2,:2]   = getRotationMatrix( crd )
    R[6:8,6:8] = R[:2,:2]
    
    if len(a_bar.shape) == 1:
      a        = dot( R.transpose() , a_bar )
    elif len(a_bar.shape) == 2:
      a        = dot( R.transpose(), dot ( a_bar , R ) )
    return a
Example #5
0
  def toElementCoordinates( self , a , coords ):

    a_bar = empty( a.shape )

    R     = eye( 9)
    crd   = zeros( shape=(2,2) )
    
    #crd[:,0] = coords[:,0]
    #crd[:,1] = coords[:,2]
    
    crd[0,:] = coords[0,:]
    crd[1,:] = coords[2,:]

    R[:2,:2]   = getRotationMatrix( crd )
    R[3:5,3:5] = R[:2,:2]
    R[6:8,6:8] = R[:2,:2]

    a_bar      = dot( R , a )

    return a_bar
Example #6
0
  def toGlobalCoordinates( self , a_bar , coords ):

    a = empty( a_bar.shape )
    R     = eye( 9)
    crd   = zeros( shape=(2,2) )
    
    #crd[:,0] = coords[:,0]
    #crd[:,1] = coords[:,2]
    crd[0,:] = coords[0,:]
    crd[1,:] = coords[2,:]
    
    R[:2,:2]   = getRotationMatrix( crd )
    R[3:5,3:5] = R[:2,:2]
    R[6:8,6:8] = R[:2,:2]
    
    if len(a_bar.shape) == 1:
      a        = dot( R.transpose() , a_bar )
    elif len(a_bar.shape) == 2:
      #a        = dot( dot( R.transpose(), a_bar ) , R )
      a        = dot( R.transpose(), dot ( a_bar , R ) )
    return a