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

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

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

revision 4983 by jfenwick, Wed May 14 01:13:23 2014 UTC revision 4984 by sshaw, Mon Jun 2 02:50:34 2014 UTC
# Line 36  Test suite for the linearPDE  and pdetoo Line 36  Test suite for the linearPDE  and pdetoo
36  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
37    
38  import esys.escriptcore.utestselect as unittest, sys  import esys.escriptcore.utestselect as unittest, sys
39    from esys.escriptcore.testing import *
40  from esys.escript import *  from esys.escript import *
41  from esys.dudley import Rectangle,Brick  from esys.dudley import Rectangle,Brick
42  from esys.escript.linearPDEs import LinearPDE, SolverOptions  from esys.escript.linearPDEs import LinearPDE, SolverOptions
# Line 98  class SimpleSolve_Rectangle_Order1_Singl Line 98  class SimpleSolve_Rectangle_Order1_Singl
98          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
99          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
100          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
101    
102  class SimpleSolve_Rectangle_Order1_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order1_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):
103       def test_solve(self):       def test_solve(self):
104          domain=Rectangle(NE0,NE1,1, optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,1, optimize=OPTIMIZE)
# Line 127  class SimpleSolve_Rectangle_Order1_Singl Line 128  class SimpleSolve_Rectangle_Order1_Singl
128          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
129          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
130          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
131    
132  class SimpleSolve_Rectangle_Order1_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order1_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):
133       def test_solve(self):       def test_solve(self):
134          domain=Rectangle(NE0,NE1,1,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,1,optimize=OPTIMIZE)
# Line 167  class SimpleSolve_Rectangle_Order1_Syste Line 169  class SimpleSolve_Rectangle_Order1_Syste
169          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
170          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
171          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
172    
173    @unittest.skip("Test should be checked")
174  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):
175       def test_solve(self):       def test_solve(self):
176          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)
# Line 194  class SimpleSolve_Rectangle_Order2_Singl Line 198  class SimpleSolve_Rectangle_Order2_Singl
198          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
199          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
200          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
201    
202    @unittest.skip("Test should be checked")
203  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):
204       def test_solve(self):       def test_solve(self):
205          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)
# Line 234  class SimpleSolve_Rectangle_Order2_Syste Line 240  class SimpleSolve_Rectangle_Order2_Syste
240          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
241          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
242          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
243    
244  class SimpleSolve_Brick_Order1_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order1_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):
245       def test_solve(self):       def test_solve(self):
246          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)
# Line 261  class SimpleSolve_Brick_Order1_SinglePDE Line 268  class SimpleSolve_Brick_Order1_SinglePDE
268          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
269          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
270          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
271    
272  class SimpleSolve_Brick_Order1_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order1_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):
273       def test_solve(self):       def test_solve(self):
274          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)
# Line 309  class SimpleSolve_Brick_Order1_SystemPDE Line 317  class SimpleSolve_Brick_Order1_SystemPDE
317          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
318          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
319          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
320    
321    @unittest.skip("Test should be checked")
322  class SimpleSolve_Brick_Order2_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SinglePDE_Paso_PCG_Jacobi(unittest.TestCase):
323       def test_solve(self):       def test_solve(self):
324          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 337  class SimpleSolve_Brick_Order2_SinglePDE Line 347  class SimpleSolve_Brick_Order2_SinglePDE
347          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
348          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
349          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
350    
351    @unittest.skip("Test should be checked")
352  class SimpleSolve_Brick_Order2_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SystemPDE_Paso_PCG_Jacobi(unittest.TestCase):
353       def test_solve(self):       def test_solve(self):
354          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 416  class SimpleSolve_Rectangle_Order1_Singl Line 428  class SimpleSolve_Rectangle_Order1_Singl
428          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
429          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
430    
431    @unittest.skip("Test should be checked")
432  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_TFQMR_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_TFQMR_Jacobi(unittest.TestCase):
433       def test_solve(self):       def test_solve(self):
434          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)
# Line 443  class SimpleSolve_Rectangle_Order2_Singl Line 456  class SimpleSolve_Rectangle_Order2_Singl
456          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
457          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
458          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
459            
460  class SimpleSolve_Rectangle_Order1_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order1_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):
461       def test_solve(self):       def test_solve(self):
462          domain=Rectangle(NE0,NE1,1,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,1,optimize=OPTIMIZE)
# Line 485  class SimpleSolve_Rectangle_Order1_Syste Line 498  class SimpleSolve_Rectangle_Order1_Syste
498          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
499          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
500    
501    @unittest.skip("Test should be checked")
502  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):
503       def test_solve(self):       def test_solve(self):
504          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)
# Line 602  class SimpleSolve_Brick_Order1_SystemPDE Line 616  class SimpleSolve_Brick_Order1_SystemPDE
616          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
617          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
618          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
619            
620    @unittest.skip("Test should be checked")
621  class SimpleSolve_Brick_Order2_SinglePDE_Paso_TFQMR_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SinglePDE_Paso_TFQMR_Jacobi(unittest.TestCase):
622       def test_solve(self):       def test_solve(self):
623          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 631  class SimpleSolve_Brick_Order2_SinglePDE Line 646  class SimpleSolve_Brick_Order2_SinglePDE
646          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
647          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
648          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
649            
650    @unittest.skip("Test should be checked")
651  class SimpleSolve_Brick_Order2_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SystemPDE_Paso_TFQMR_Jacobi(unittest.TestCase):
652       def test_solve(self):       def test_solve(self):
653          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 713  class SimpleSolve_Rectangle_Order1_Singl Line 729  class SimpleSolve_Rectangle_Order1_Singl
729          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
730          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
731    
732    @unittest.skip("Test should be checked")
733  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_MINRES_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SinglePDE_Paso_MINRES_Jacobi(unittest.TestCase):
734       def test_solve(self):       def test_solve(self):
735          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,l0=1.,l1=1,optimize=OPTIMIZE)
# Line 781  class SimpleSolve_Rectangle_Order1_Syste Line 798  class SimpleSolve_Rectangle_Order1_Syste
798          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
799          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
800          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
801            
802    @unittest.skip("Test should be checked")
803  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):  class SimpleSolve_Rectangle_Order2_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):
804       def test_solve(self):       def test_solve(self):
805          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)          domain=Rectangle(NE0,NE1,2,optimize=OPTIMIZE)
# Line 850  class SimpleSolve_Brick_Order1_SinglePDE Line 868  class SimpleSolve_Brick_Order1_SinglePDE
868          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
869          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
870          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
871            
872  class SimpleSolve_Brick_Order1_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order1_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):
873       def test_solve(self):       def test_solve(self):
874          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,1,optimize=OPTIMIZE)
# Line 899  class SimpleSolve_Brick_Order1_SystemPDE Line 917  class SimpleSolve_Brick_Order1_SystemPDE
917          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
918          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
919          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
920            
921    @unittest.skip("Test should be checked")
922  class SimpleSolve_Brick_Order2_SinglePDE_Paso_MINRES_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SinglePDE_Paso_MINRES_Jacobi(unittest.TestCase):
923       def test_solve(self):       def test_solve(self):
924          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 928  class SimpleSolve_Brick_Order2_SinglePDE Line 947  class SimpleSolve_Brick_Order2_SinglePDE
947          # -------- test the solution ---------------------------          # -------- test the solution ---------------------------
948          error=Lsup(u-u_ex)          error=Lsup(u-u_ex)
949          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
950            
951    @unittest.skip("Test should be checked")
952  class SimpleSolve_Brick_Order2_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):  class SimpleSolve_Brick_Order2_SystemPDE_Paso_MINRES_Jacobi(unittest.TestCase):
953       def test_solve(self):       def test_solve(self):
954          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)          domain=Brick(NE0,NE1,NE2,2,optimize=OPTIMIZE)
# Line 979  class SimpleSolve_Brick_Order2_SystemPDE Line 999  class SimpleSolve_Brick_Order2_SystemPDE
999          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)          self.assertTrue(error<REL_TOL*Lsup(u_ex), "solution error %s is too big."%error)
1000    
1001  if __name__ == '__main__':  if __name__ == '__main__':
1002     suite = unittest.TestSuite()      run_tests(__name__, exit_on_failure=True)
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SinglePDE_Paso_BICGSTAB_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SinglePDE_Paso_PCG_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SystemPDE_Paso_PCG_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SinglePDE_Paso_PCG_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SystemPDE_Paso_PCG_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SinglePDE_Paso_TFQMR_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SystemPDE_Paso_TFQMR_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SinglePDE_Paso_TFQMR_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SystemPDE_Paso_TFQMR_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SinglePDE_Paso_MINRES_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Rectangle_Order1_SinglePDE_Paso_MINRES_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SinglePDE_Paso_MINRES_Jacobi))  
    suite.addTest(unittest.makeSuite(SimpleSolve_Brick_Order1_SystemPDE_Paso_MINRES_Jacobi))  
   
    s=unittest.TextTestRunner(verbosity=2).run(suite)  
    if not s.wasSuccessful(): sys.exit(1)  

Legend:
Removed from v.4983  
changed lines
  Added in v.4984

  ViewVC Help
Powered by ViewVC 1.1.26