/[escript]/trunk/dudley/test/python/fixme_run_generators.py
ViewVC logotype

Diff of /trunk/dudley/test/python/fixme_run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3773 by jfenwick, Thu Nov 17 00:53:38 2011 UTC revision 3774 by jfenwick, Wed Jan 18 06:29:34 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:
800          suite.addTest(unittest.makeSuite(Test_Generators))          suite.addTest(unittest.makeSuite(Test_Generators))
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:
805          suite.addTest(unittest.makeSuite(Test_GMSHReader))          suite.addTest(unittest.makeSuite(Test_GMSHReader))
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:
810          suite.addTest(unittest.makeSuite(Test_Reader))          suite.addTest(unittest.makeSuite(Test_Reader))
811     else:     else:
812          print "Test_Reader is dropped as number of processors >1"          print("Test_Reader is dropped as number of processors >1")
813    
814     suite.addTest(unittest.makeSuite(Test_Integration))     suite.addTest(unittest.makeSuite(Test_Integration))
815     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)

Legend:
Removed from v.3773  
changed lines
  Added in v.3774

  ViewVC Help
Powered by ViewVC 1.1.26