/[escript]/branches/trilinos_from_5897/ripley/test/python/run_trilinosSolversOnMultiRes.py
ViewVC logotype

Diff of /branches/trilinos_from_5897/ripley/test/python/run_trilinosSolversOnMultiRes.py

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

branches/trilinos_from_5897/ripley/test/python/run_trilinosSolversOnRipley.py revision 6040 by caltinay, Wed Mar 9 03:11:36 2016 UTC branches/trilinos_from_5897/ripley/test/python/run_trilinosSolversOnMultiRes.py revision 6100 by caltinay, Tue Mar 29 04:56:51 2016 UTC
# Line 24  http://www.opensource.org/licenses/osl-3 Line 24  http://www.opensource.org/licenses/osl-3
24  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
25    
26  """  """
27  Test suite for PDE solvers on ripley  Test suite for PDE solvers on ripley multiresolution domains
28  """  """
29    
30  from test_simplesolve import SimpleSolveTestCase  from test_simplesolve import SimpleSolveTestCase
# Line 32  import esys.escriptcore.utestselect as u Line 32  import esys.escriptcore.utestselect as u
32  from esys.escriptcore.testing import *  from esys.escriptcore.testing import *
33    
34  from esys.escript import getMPISizeWorld, sqrt  from esys.escript import getMPISizeWorld, sqrt
35  from esys.ripley import Rectangle, Brick  from esys.ripley import MultiResolutionDomain
36  from esys.escript.linearPDEs import SolverOptions  from esys.escript.linearPDEs import SolverOptions
37    
38  # number of elements in the spatial directions  # number of elements in the spatial directions
39  NE0=12  NE0=10
40  NE1=12  NE1=10
41  NE2=8  NE2=9
42  mpiSize=getMPISizeWorld()  mpiSize=getMPISizeWorld()
43  for x in [int(sqrt(mpiSize)),2,3,5,7,1]:  for x in [int(sqrt(mpiSize)),2,3,5,7,1]:
44      NX=x      NX=x
# Line 53  for x in [(int(mpiSize**(1/3.)),int(mpiS Line 53  for x in [(int(mpiSize**(1/3.)),int(mpiS
53      if NXb*NYb*NZb == mpiSize:      if NXb*NYb*NZb == mpiSize:
54          break          break
55    
56    def Rectangle(**kwargs):
57        m = MultiResolutionDomain(2, **kwargs)
58        return m.getLevel(1)
59    
60    def Brick(**kwargs):
61        m = MultiResolutionDomain(3, **kwargs)
62        return m.getLevel(1)
63    
64  class SimpleSolveSingleOnly(SimpleSolveTestCase):  class SimpleSolveSingleOnly(SimpleSolveTestCase):
65      @unittest.skip("PDE systems not supported with Trilinos yet")      @unittest.skip("PDE systems not supported with Trilinos yet")
66      def test_system(self):      def test_system(self):
67          pass          pass
68    
69  class Test_SimpleSolveRipley2D_Trilinos_GMRES_Jacobi(SimpleSolveSingleOnly):  ### BiCGStab + Jacobi
70    
71    class Test_SimpleSolveMultiRes2D_Trilinos_BICGSTAB_Jacobi(SimpleSolveSingleOnly):
72        def setUp(self):
73            self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
74            self.package = SolverOptions.TRILINOS
75            self.method = SolverOptions.BICGSTAB
76            self.preconditioner = SolverOptions.JACOBI
77    
78        def tearDown(self):
79            del self.domain
80    
81    @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
82    class Test_SimpleSolveMultiRes3D_Trilinos_BICGSTAB_Jacobi(SimpleSolveSingleOnly):
83        def setUp(self):
84            self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
85            self.package = SolverOptions.TRILINOS
86            self.method = SolverOptions.BICGSTAB
87            self.preconditioner = SolverOptions.JACOBI
88    
89        def tearDown(self):
90            del self.domain
91    
92    ### GMRES + Jacobi
93    
94    class Test_SimpleSolveMultiRes2D_Trilinos_GMRES_Jacobi(SimpleSolveSingleOnly):
95      def setUp(self):      def setUp(self):
96          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
97          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 68  class Test_SimpleSolveRipley2D_Trilinos_ Line 101  class Test_SimpleSolveRipley2D_Trilinos_
101      def tearDown(self):      def tearDown(self):
102          del self.domain          del self.domain
103    
104  class Test_SimpleSolveRipley3D_Trilinos_GMRES_Jacobi(SimpleSolveSingleOnly):  @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
105    class Test_SimpleSolveMultiRes3D_Trilinos_GMRES_Jacobi(SimpleSolveSingleOnly):
106      def setUp(self):      def setUp(self):
107          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
108          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 78  class Test_SimpleSolveRipley3D_Trilinos_ Line 112  class Test_SimpleSolveRipley3D_Trilinos_
112      def tearDown(self):      def tearDown(self):
113          del self.domain          del self.domain
114    
115  class Test_SimpleSolveRipley2D_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):  ### PCG + Jacobi
116    
117    class Test_SimpleSolveMultiRes2D_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):
118      def setUp(self):      def setUp(self):
119          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
120          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 88  class Test_SimpleSolveRipley2D_Trilinos_ Line 124  class Test_SimpleSolveRipley2D_Trilinos_
124      def tearDown(self):      def tearDown(self):
125          del self.domain          del self.domain
126    
127  class Test_SimpleSolveRipley3D_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):  @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
128    class Test_SimpleSolveMultiRes3D_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):
129      def setUp(self):      def setUp(self):
130          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
131          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 98  class Test_SimpleSolveRipley3D_Trilinos_ Line 135  class Test_SimpleSolveRipley3D_Trilinos_
135      def tearDown(self):      def tearDown(self):
136          del self.domain          del self.domain
137    
138  class Test_SimpleSolveRipley2D_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):  ### MINRES + Jacobi
139    
140    class Test_SimpleSolveMultiRes2D_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):
141      def setUp(self):      def setUp(self):
142          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
143          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 108  class Test_SimpleSolveRipley2D_Trilinos_ Line 147  class Test_SimpleSolveRipley2D_Trilinos_
147      def tearDown(self):      def tearDown(self):
148          del self.domain          del self.domain
149    
150  class Test_SimpleSolveRipley3D_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):  @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
151    class Test_SimpleSolveMultiRes3D_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):
152      def setUp(self):      def setUp(self):
153          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
154          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 118  class Test_SimpleSolveRipley3D_Trilinos_ Line 158  class Test_SimpleSolveRipley3D_Trilinos_
158      def tearDown(self):      def tearDown(self):
159          del self.domain          del self.domain
160    
161  class Test_SimpleSolveRipley2D_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):  ### TFQMR + RILU
162    
163    class Test_SimpleSolveMultiRes2D_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):
164      def setUp(self):      def setUp(self):
165          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
166          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 128  class Test_SimpleSolveRipley2D_Trilinos_ Line 170  class Test_SimpleSolveRipley2D_Trilinos_
170      def tearDown(self):      def tearDown(self):
171          del self.domain          del self.domain
172    
173  class Test_SimpleSolveRipley3D_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):  @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
174    class Test_SimpleSolveMultiRes3D_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):
175      def setUp(self):      def setUp(self):
176          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
177          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 138  class Test_SimpleSolveRipley3D_Trilinos_ Line 181  class Test_SimpleSolveRipley3D_Trilinos_
181      def tearDown(self):      def tearDown(self):
182          del self.domain          del self.domain
183    
184  class Test_SimpleSolveRipley2D_Trilinos_LSQR_AMG(SimpleSolveSingleOnly):  ### LSQR + AMG
185    
186    class Test_SimpleSolveMultiRes2D_Trilinos_LSQR_AMG(SimpleSolveSingleOnly):
187      def setUp(self):      def setUp(self):
188          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)          self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
189          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 148  class Test_SimpleSolveRipley2D_Trilinos_ Line 193  class Test_SimpleSolveRipley2D_Trilinos_
193      def tearDown(self):      def tearDown(self):
194          del self.domain          del self.domain
195    
196  class Test_SimpleSolveRipley3D_Trilinos_PCG_AMG(SimpleSolveSingleOnly):  ### PCG + AMG
197    
198    class Test_SimpleSolveMultiRes2D_Trilinos_PCG_AMG(SimpleSolveSingleOnly):
199        def setUp(self):
200            self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
201            self.package = SolverOptions.TRILINOS
202            self.method = SolverOptions.PCG
203            self.preconditioner = SolverOptions.AMG
204    
205        def tearDown(self):
206            del self.domain
207    
208    @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
209    class Test_SimpleSolveMultiRes3D_Trilinos_PCG_AMG(SimpleSolveSingleOnly):
210      def setUp(self):      def setUp(self):
211          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)          self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
212          self.package = SolverOptions.TRILINOS          self.package = SolverOptions.TRILINOS
# Line 157  class Test_SimpleSolveRipley3D_Trilinos_ Line 215  class Test_SimpleSolveRipley3D_Trilinos_
215    
216      def tearDown(self):      def tearDown(self):
217          del self.domain          del self.domain
218    
219    ### PCG + ILUT
220    
221    class Test_SimpleSolveMultiRes2D_Trilinos_PCG_ILUT(SimpleSolveSingleOnly):
222        def setUp(self):
223            self.domain = Rectangle(n0=NE0*NX-1, n1=NE1*NY-1, d0=NX, d1=NY)
224            self.package = SolverOptions.TRILINOS
225            self.method = SolverOptions.PCG
226            self.preconditioner = SolverOptions.ILUT
227    
228        def tearDown(self):
229            del self.domain
230    
231    @unittest.skipIf(mpiSize > 1, "3D Multiresolution domains require single process")
232    class Test_SimpleSolveMultiRes3D_Trilinos_PCG_ILUT(SimpleSolveSingleOnly):
233        def setUp(self):
234            self.domain = Brick(n0=NE0*NXb-1, n1=NE1*NYb-1, n2=NE2*NZb-1, d0=NXb, d1=NYb, d2=NZb)
235            self.package = SolverOptions.TRILINOS
236            self.method = SolverOptions.PCG
237            self.preconditioner = SolverOptions.ILUT
238    
239        def tearDown(self):
240            del self.domain
241    
242    
243  if __name__ == '__main__':  if __name__ == '__main__':

Legend:
Removed from v.6040  
changed lines
  Added in v.6100

  ViewVC Help
Powered by ViewVC 1.1.26