# Diff of /branches/symbolic_from_3470/dudley/test/python/fixme_run_generators.py

revision 3788 by caltinay, Wed Sep 21 04:48:06 2011 UTC revision 3789 by caltinay, Tue Jan 31 04:55:05 2012 UTC
# Line 257  class Test_Integration(unittest.TestCase Line 257  class Test_Integration(unittest.TestCase
257     def __test_2DQ(self,dom,order):     def __test_2DQ(self,dom,order):
258         x=Function(dom).getX()         x=Function(dom).getX()
259         x_bound=FunctionOnBoundary(dom).getX()         x_bound=FunctionOnBoundary(dom).getX()
260         for i in xrange(order+1):         for i in range(order+1):
261           for j in xrange(order+1):           for j in range(order+1):
262               res=integrate(x[0]**i*x[1]**j)               res=integrate(x[0]**i*x[1]**j)
263               ref=1./((i+1)*(j+1))               ref=1./((i+1)*(j+1))
264               error=abs(res-ref)/abs(ref)               error=abs(res-ref)/abs(ref)
# Line 280  class Test_Integration(unittest.TestCase Line 280  class Test_Integration(unittest.TestCase
280     def __test_2DT(self,dom,order,raise_tol=1.):     def __test_2DT(self,dom,order,raise_tol=1.):
281         x=Function(dom).getX()         x=Function(dom).getX()
282         x_bound=FunctionOnBoundary(dom).getX()         x_bound=FunctionOnBoundary(dom).getX()
283         for i in xrange(order+1):         for i in range(order+1):
284           for j in xrange(order+1):           for j in range(order+1):
285             if i+j<=order:             if i+j<=order:
286               res=integrate(x[0]**i*x[1]**j)               res=integrate(x[0]**i*x[1]**j)
287               ref=1./((i+1)*(j+1))               ref=1./((i+1)*(j+1))
# Line 306  class Test_Integration(unittest.TestCase Line 306  class Test_Integration(unittest.TestCase
306     def __test_3DQ(self,dom,order):     def __test_3DQ(self,dom,order):
307         x=Function(dom).getX()         x=Function(dom).getX()
308         x_bound=FunctionOnBoundary(dom).getX()         x_bound=FunctionOnBoundary(dom).getX()
309         for i in xrange(order+1):         for i in range(order+1):
310           for j in xrange(order+1):           for j in range(order+1):
311             for k in xrange(order+1):             for k in range(order+1):
312               res=integrate(x[0]**i*x[1]**j*x[2]**k)               res=integrate(x[0]**i*x[1]**j*x[2]**k)
313               ref=1./((i+1)*(j+1)*(k+1))               ref=1./((i+1)*(j+1)*(k+1))
314               error=abs(res-ref)/abs(ref)               error=abs(res-ref)/abs(ref)
# Line 334  class Test_Integration(unittest.TestCase Line 334  class Test_Integration(unittest.TestCase
334     def __test_3DT(self,dom,order,raise_tol=1.):     def __test_3DT(self,dom,order,raise_tol=1.):
335         x=Function(dom).getX()         x=Function(dom).getX()
336         x_bound=FunctionOnBoundary(dom).getX()         x_bound=FunctionOnBoundary(dom).getX()
337         for i in xrange(order+1):         for i in range(order+1):
338           for j in xrange(order+1):           for j in range(order+1):
339             for k in xrange(order+1):             for k in range(order+1):
340               if i+j+k<=order:               if i+j+k<=order:
341                  res=integrate(x[0]**i*x[1]**j*x[2]**k)                  res=integrate(x[0]**i*x[1]**j*x[2]**k)
342                  ref=1./((i+1)*(j+1)*(k+1))                  ref=1./((i+1)*(j+1)*(k+1))
# Line 799  if __name__ == '__main__': Line 799  if __name__ == '__main__':
799     if getMPISizeWorld() == 1:     if getMPISizeWorld() == 1:
801     else:     else:
802          print "Test_Generators is dropped as number of processors >1"          print("Test_Generators is dropped as number of processors >1")
803
804     if getMPISizeWorld() == 1:     if getMPISizeWorld() == 1:
806     else:     else:
807          print "Test_GMSHReader is dropped as number of processors >1"          print("Test_GMSHReader is dropped as number of processors >1")
808
809     if getMPISizeWorld() == 1:     if getMPISizeWorld() == 1: