#NEWLINE# def getError( self ) : #NEWLINE# #INDENT# z = 5 #NEWLINE# call = ( lambda fun , xy : fun ( xy [ : , 0 ] , xy [ : , 1 ] ) ) #NEWLINE# ex = ( lambda x , y : ( ( x ** 2 ) + ( y * z ) ) ) #NEWLINE# ey = ( lambda x , y : ( ( ( z ** 2 ) * x ) + ( y * z ) ) ) #NEWLINE# sigma1 = ( lambda x , y : ( ( x * y ) + 1 ) ) #NEWLINE# sigma2 = ( lambda x , y : ( ( x * z ) + 2 ) ) #NEWLINE# sigma3 = ( lambda x , y : ( 3 + ( z * y ) ) ) #NEWLINE# Gc = self . M . gridCC #NEWLINE# if ( self . sigmaTest == 1 ) : #NEWLINE# #INDENT# sigma = np . c_ [ call ( sigma1 , Gc ) ] #NEWLINE# analytic = ( 144877.0 / 360 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . sigmaTest == 2 ) : #NEWLINE# #INDENT# sigma = np . c_ [ ( call ( sigma1 , Gc ) , call ( sigma2 , Gc ) ) ] #NEWLINE# analytic = ( 189959.0 / 120 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . sigmaTest == 3 ) : #NEWLINE# #INDENT# sigma = np . r_ [ ( call ( sigma1 , Gc ) , call ( sigma2 , Gc ) , call ( sigma3 , Gc ) ) ] #NEWLINE# analytic = ( 781427.0 / 360 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . location == 'edges' ) : #NEWLINE# #INDENT# cart = ( lambda g : np . c_ [ ( call ( ex , g ) , call ( ey , g ) ) ] ) #NEWLINE# Ec = np . vstack ( ( cart ( self . M . gridEx ) , cart ( self . M . gridEy ) ) ) #NEWLINE# E = self . M . projectEdgeVector ( Ec ) #NEWLINE# if self . invProp : #NEWLINE# #INDENT# A = self . M . getEdgeInnerProduct ( Utils . invPropertyTensor ( self . M , sigma ) , invProp = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# A = self . M . getEdgeInnerProduct ( sigma ) #NEWLINE# #UNINDENT# numeric = E . T . dot ( A . dot ( E ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( numeric . location == 'faces' ) : #NEWLINE# #INDENT# cart = ( lambda g : np . c_ [ ( call ( ex , g ) , call ( ey , g ) ) ] ) #NEWLINE# Fc = np . vstack ( ( cart ( self . M . gridFx ) , cart ( self . M . gridFy ) ) ) #NEWLINE# F = self . M . projectFaceVector ( Fc ) #NEWLINE# if self . invProp : #NEWLINE# #INDENT# A = self . M . getFaceInnerProduct ( Utils . invPropertyTensor ( self . M , sigma ) , invProp = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# A = self . M . getFaceInnerProduct ( sigma ) #NEWLINE# #UNINDENT# numeric = F . T . dot ( A . dot ( F ) ) #NEWLINE# #UNINDENT# #UNINDENT# err = np . abs ( ( numeric - analytic ) ) #NEWLINE# return err