/[escript]/trunk/ripley/test/python/run_linearPDEsOnRipley1.py
ViewVC logotype

Diff of /trunk/ripley/test/python/run_linearPDEsOnRipley1.py

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

revision 3836 by caltinay, Wed Feb 1 06:16:25 2012 UTC revision 3837 by caltinay, Thu Feb 16 03:58:58 2012 UTC
# Line 34  Test suite for the linearPDE and pdetool Line 34  Test suite for the linearPDE and pdetool
34  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
35    
36  import os  import os
   
37  import unittest  import unittest
38  from test_linearPDEs import Test_Poisson,Test_LinearPDE, Test_LinearPDE_noLumping, Test_TransportPDE  from test_linearPDEs import Test_Poisson, Test_LinearPDE, Test_TransportPDE
39  from test_assemblage import Test_assemblage_2Do1, Test_assemblage_2Do2, Test_assemblage_3Do1, Test_assemblage_3Do2, \  from test_assemblage import Test_assemblage_2Do1, Test_assemblage_3Do1
                             Test_assemblage_2Do1_Contact,Test_assemblage_2Do2_Contact, Test_assemblage_3Do1_Contact, Test_assemblage_3Do2_Contact  
40  from test_pdetools import Test_pdetools, Test_pdetools_noLumping  from test_pdetools import Test_pdetools, Test_pdetools_noLumping
41  from esys.escript import *  from esys.escript import *
42  from esys.ripley import Rectangle,Brick, ReadMesh  from esys.ripley import Rectangle, Brick
 import sys  
43    
44    
45  try:  try:
# Line 53  except KeyError: Line 50  except KeyError:
50  NE=10 # number of element in each spatial direction (must be even)  NE=10 # number of element in each spatial direction (must be even)
51  mpiSize=getMPISizeWorld()  mpiSize=getMPISizeWorld()
52    
53  class Test_LinearPDEOnRipleyRect(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1, Test_TransportPDE):  class Test_LinearPDEOnRipleyRect(Test_LinearPDE, Test_pdetools, Test_assemblage_2Do1, Test_TransportPDE):
54     RES_TOL=1.e-7      RES_TOL=1.e-7
55     ABS_TOL=1.e-8      ABS_TOL=1.e-8
56     def setUp(self):      def setUp(self):
57          for x in [int(sqrt(mpiSize)),2,3,5,7,1]:          for x in [int(sqrt(mpiSize)),2,3,5,7,1]:
58              NX=x              NX=x
59              NY=mpiSize/x              NY=mpiSize/x
# Line 64  class Test_LinearPDEOnRipleyRect(Test_Li Line 61  class Test_LinearPDEOnRipleyRect(Test_Li
61                  break                  break
62          self.domain=Rectangle(n0=NE*NX-1, n1=NE*NY-1, l0=1., l1=1., d0=NX, d1=NY)          self.domain=Rectangle(n0=NE*NX-1, n1=NE*NY-1, l0=1., l1=1., d0=NX, d1=NY)
63          self.order = 1          self.order = 1
64     def tearDown(self):      def tearDown(self):
65          del self.domain          del self.domain
66    
67  class Test_LinearPDEOnRipleyBrick(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1, Test_TransportPDE):  class Test_LinearPDEOnRipleyBrick(Test_LinearPDE, Test_pdetools, Test_assemblage_3Do1, Test_TransportPDE):
68     RES_TOL=1.e-7      RES_TOL=1.e-7
69     ABS_TOL=1.e-8      ABS_TOL=1.e-8
70     def setUp(self):      def setUp(self):
71          for x in [(int(mpiSize**(1/3.)),int(mpiSize**(1/3.))),(2,3),(2,2),(1,2),(1,1)]:          for x in [(int(mpiSize**(1/3.)),int(mpiSize**(1/3.))),(2,3),(2,2),(1,2),(1,1)]:
72              NX=x[0]              NX=x[0]
73              NY=x[1]              NY=x[1]
# Line 80  class Test_LinearPDEOnRipleyBrick(Test_L Line 77  class Test_LinearPDEOnRipleyBrick(Test_L
77    
78          self.domain = Brick(n0=NE*NX-1, n1=NE*NY-1, n2=NE*NZ-1, l0=1., l1=1., l2=1., d0=NX, d1=NY, d2=NZ)          self.domain = Brick(n0=NE*NX-1, n1=NE*NY-1, n2=NE*NZ-1, l0=1., l1=1., l2=1., d0=NX, d1=NY, d2=NZ)
79          self.order = 1          self.order = 1
80     def tearDown(self):  
81        def tearDown(self):
82            del self.domain
83    
84    class Test_PoissonOnRipley(Test_Poisson):
85        RES_TOL=1.e-7
86        ABS_TOL=1.e-8
87        def setUp(self):
88            for x in [int(sqrt(mpiSize)),2,3,5,7,1]:
89                NX=x
90                NY=mpiSize/x
91                if NX*NY == mpiSize:
92                    break
93            self.domain=Rectangle(n0=NE*NX-1, n1=NE*NY-1, l0=1., l1=1., d0=NX, d1=NY)
94        def tearDown(self):
95          del self.domain          del self.domain
96    
97    
98  if __name__ == '__main__':  if __name__ == '__main__':
99     suite = unittest.TestSuite()      import sys
100     suite.addTest(unittest.makeSuite(Test_LinearPDEOnRipleyRect))      suite = unittest.TestSuite()
101     suite.addTest(unittest.makeSuite(Test_LinearPDEOnRipleyBrick))      suite.addTest(unittest.makeSuite(Test_LinearPDEOnRipleyRect))
102     s=unittest.TextTestRunner(verbosity=2).run(suite)      suite.addTest(unittest.makeSuite(Test_LinearPDEOnRipleyBrick))
103     if not s.wasSuccessful(): sys.exit(1)      suite.addTest(unittest.makeSuite(Test_PoissonOnRipley))
104        s=unittest.TextTestRunner(verbosity=2).run(suite)
105        if not s.wasSuccessful(): sys.exit(1)
106    

Legend:
Removed from v.3836  
changed lines
  Added in v.3837

  ViewVC Help
Powered by ViewVC 1.1.26