/[escript]/branches/trilinos_from_5897/dudley/test/python/run_trilinosSolversOnDudley.py
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/test/python/run_trilinosSolversOnDudley.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6079 - (show annotations)
Mon Mar 21 12:22:38 2016 UTC (2 years, 11 months ago) by caltinay
File MIME type: text/x-python
File size: 10921 byte(s)
Big commit - making dudley much more like finley to make it more
managable. Fixed quite a few issues that had been fixed in finley.
Disposed of all ReducedNode/ReducedDOF entities that dudley never supported.
Compiles and passes tests.

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2016 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from __future__ import print_function, division
18
19 __copyright__="""Copyright (c) 2003-2016 by The University of Queensland
20 http://www.uq.edu.au
21 Primary Business: Queensland, Australia"""
22 __license__="""Licensed under the Open Software License version 3.0
23 http://www.opensource.org/licenses/osl-3.0.php"""
24 __url__="https://launchpad.net/escript-finley"
25
26 """
27 Test suite for PDE solvers on dudley
28 """
29
30 from test_simplesolve import SimpleSolveTestCase
31 import esys.escriptcore.utestselect as unittest
32 from esys.escriptcore.testing import *
33
34 from esys.dudley import Rectangle, Brick
35 from esys.escript.linearPDEs import SolverOptions
36
37 # number of elements in the spatial directions
38 NE0=12
39 NE1=12
40 NE2=8
41 OPTIMIZE=True
42
43 class SimpleSolveSingleOnly(SimpleSolveTestCase):
44 @unittest.skip("PDE systems not supported with Trilinos yet")
45 def test_system(self):
46 pass
47
48 ### BiCGStab + Jacobi
49
50 class Test_SimpleSolveDudleyRect_Trilinos_BICGSTAB_Jacobi(SimpleSolveSingleOnly):
51 def setUp(self):
52 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
53 self.package = SolverOptions.TRILINOS
54 self.method = SolverOptions.BICGSTAB
55 self.preconditioner = SolverOptions.JACOBI
56
57 def tearDown(self):
58 del self.domain
59
60 class Test_SimpleSolveDudleyBrick_Trilinos_BICGSTAB_Jacobi(SimpleSolveSingleOnly):
61 def setUp(self):
62 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
63 self.package = SolverOptions.TRILINOS
64 self.method = SolverOptions.BICGSTAB
65 self.preconditioner = SolverOptions.JACOBI
66
67 def tearDown(self):
68 del self.domain
69
70 ### PCG + Jacobi
71
72 class Test_SimpleSolveDudleyRect_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):
73 def setUp(self):
74 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
75 self.package = SolverOptions.TRILINOS
76 self.method = SolverOptions.PCG
77 self.preconditioner = SolverOptions.JACOBI
78
79 def tearDown(self):
80 del self.domain
81
82 class Test_SimpleSolveDudleyBrick_Trilinos_PCG_Jacobi(SimpleSolveSingleOnly):
83 def setUp(self):
84 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
85 self.package = SolverOptions.TRILINOS
86 self.method = SolverOptions.PCG
87 self.preconditioner = SolverOptions.JACOBI
88
89 def tearDown(self):
90 del self.domain
91
92 ### TFQMR + Jacobi
93
94 class Test_SimpleSolveDudleyRect_Trilinos_TFQMR_Jacobi(SimpleSolveSingleOnly):
95 def setUp(self):
96 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
97 self.package = SolverOptions.TRILINOS
98 self.method = SolverOptions.TFQMR
99 self.preconditioner = SolverOptions.JACOBI
100
101 def tearDown(self):
102 del self.domain
103
104 class Test_SimpleSolveDudleyBrick_Trilinos_TFQMR_Jacobi(SimpleSolveSingleOnly):
105 def setUp(self):
106 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
107 self.package = SolverOptions.TRILINOS
108 self.method = SolverOptions.TFQMR
109 self.preconditioner = SolverOptions.JACOBI
110
111 def tearDown(self):
112 del self.domain
113
114 ### MINRES + Jacobi
115
116 class Test_SimpleSolveDudleyRect_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):
117 def setUp(self):
118 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
119 self.package = SolverOptions.TRILINOS
120 self.method = SolverOptions.MINRES
121 self.preconditioner = SolverOptions.JACOBI
122
123 def tearDown(self):
124 del self.domain
125
126 class Test_SimpleSolveDudleyBrick_Trilinos_MINRES_Jacobi(SimpleSolveSingleOnly):
127 def setUp(self):
128 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
129 self.package = SolverOptions.TRILINOS
130 self.method = SolverOptions.MINRES
131 self.preconditioner = SolverOptions.JACOBI
132
133 def tearDown(self):
134 del self.domain
135
136 ### BiCGStab + Gauss-Seidel
137
138 class Test_SimpleSolveDudleyRect_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveSingleOnly):
139 def setUp(self):
140 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
141 self.package = SolverOptions.TRILINOS
142 self.method = SolverOptions.BICGSTAB
143 self.preconditioner = SolverOptions.GAUSS_SEIDEL
144
145 def tearDown(self):
146 del self.domain
147
148 class Test_SimpleSolveDudleyBrick_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveSingleOnly):
149 def setUp(self):
150 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
151 self.package = SolverOptions.TRILINOS
152 self.method = SolverOptions.BICGSTAB
153 self.preconditioner = SolverOptions.GAUSS_SEIDEL
154
155 def tearDown(self):
156 del self.domain
157
158 ### PCG + AMG
159
160 class Test_SimpleSolveDudleyRect_Trilinos_PCG_AMG(SimpleSolveSingleOnly):
161 def setUp(self):
162 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
163 self.package = SolverOptions.TRILINOS
164 self.method = SolverOptions.PCG
165 self.preconditioner = SolverOptions.AMG
166
167 def tearDown(self):
168 del self.domain
169
170 class Test_SimpleSolveDudleyBrick_Trilinos_PCG_AMG(SimpleSolveSingleOnly):
171 def setUp(self):
172 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
173 self.package = SolverOptions.TRILINOS
174 self.method = SolverOptions.PCG
175 self.preconditioner = SolverOptions.AMG
176
177 def tearDown(self):
178 del self.domain
179
180 ### TFQMR + Gauss-Seidel
181
182 class Test_SimpleSolveDudleyRect_Trilinos_TFQMR_GaussSeidel(SimpleSolveSingleOnly):
183 def setUp(self):
184 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
185 self.package = SolverOptions.TRILINOS
186 self.method = SolverOptions.TFQMR
187 self.preconditioner = SolverOptions.GAUSS_SEIDEL
188
189 def tearDown(self):
190 del self.domain
191
192 class Test_SimpleSolveDudleyBrick_Trilinos_TFQMR_GaussSeidel(SimpleSolveSingleOnly):
193 def setUp(self):
194 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
195 self.package = SolverOptions.TRILINOS
196 self.method = SolverOptions.TFQMR
197 self.preconditioner = SolverOptions.GAUSS_SEIDEL
198
199 def tearDown(self):
200 del self.domain
201
202 ### MINRES + AMG
203
204 class Test_SimpleSolveDudleyRect_Trilinos_MINRES_AMG(SimpleSolveSingleOnly):
205 def setUp(self):
206 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
207 self.package = SolverOptions.TRILINOS
208 self.method = SolverOptions.MINRES
209 self.preconditioner = SolverOptions.AMG
210
211 def tearDown(self):
212 del self.domain
213
214 class Test_SimpleSolveDudleyBrick_Trilinos_MINRES_AMG(SimpleSolveSingleOnly):
215 def setUp(self):
216 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
217 self.package = SolverOptions.TRILINOS
218 self.method = SolverOptions.MINRES
219 self.preconditioner = SolverOptions.AMG
220
221 def tearDown(self):
222 del self.domain
223
224 ### BiCGStab + RILU
225
226 class Test_SimpleSolveDudleyRect_Trilinos_BICGSTAB_RILU(SimpleSolveSingleOnly):
227 def setUp(self):
228 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
229 self.package = SolverOptions.TRILINOS
230 self.method = SolverOptions.BICGSTAB
231 self.preconditioner = SolverOptions.RILU
232
233 def tearDown(self):
234 del self.domain
235
236 class Test_SimpleSolveDudleyBrick_Trilinos_BICGSTAB_RILU(SimpleSolveSingleOnly):
237 def setUp(self):
238 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
239 self.package = SolverOptions.TRILINOS
240 self.method = SolverOptions.BICGSTAB
241 self.preconditioner = SolverOptions.RILU
242
243 def tearDown(self):
244 del self.domain
245
246 ### PCG + RILU
247
248 class Test_SimpleSolveDudleyRect_Trilinos_PCG_RILU(SimpleSolveSingleOnly):
249 def setUp(self):
250 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
251 self.package = SolverOptions.TRILINOS
252 self.method = SolverOptions.PCG
253 self.preconditioner = SolverOptions.RILU
254
255 def tearDown(self):
256 del self.domain
257
258 class Test_SimpleSolveDudleyBrick_Trilinos_PCG_RILU(SimpleSolveSingleOnly):
259 def setUp(self):
260 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
261 self.package = SolverOptions.TRILINOS
262 self.method = SolverOptions.PCG
263 self.preconditioner = SolverOptions.RILU
264
265 def tearDown(self):
266 del self.domain
267
268 ### TFQMR + RILU
269
270 class Test_SimpleSolveDudleyRect_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):
271 def setUp(self):
272 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
273 self.package = SolverOptions.TRILINOS
274 self.method = SolverOptions.TFQMR
275 self.preconditioner = SolverOptions.RILU
276
277 def tearDown(self):
278 del self.domain
279
280 class Test_SimpleSolveDudleyBrick_Trilinos_TFQMR_RILU(SimpleSolveSingleOnly):
281 def setUp(self):
282 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
283 self.package = SolverOptions.TRILINOS
284 self.method = SolverOptions.TFQMR
285 self.preconditioner = SolverOptions.RILU
286
287 def tearDown(self):
288 del self.domain
289
290 ### MINRES + RILU
291
292 class Test_SimpleSolveDudleyRect_Trilinos_MINRES_RILU(SimpleSolveSingleOnly):
293 def setUp(self):
294 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
295 self.package = SolverOptions.TRILINOS
296 self.method = SolverOptions.MINRES
297 self.preconditioner = SolverOptions.RILU
298
299 def tearDown(self):
300 del self.domain
301
302 class Test_SimpleSolveDudleyBrick_Trilinos_MINRES_RILU(SimpleSolveSingleOnly):
303 def setUp(self):
304 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
305 self.package = SolverOptions.TRILINOS
306 self.method = SolverOptions.MINRES
307 self.preconditioner = SolverOptions.RILU
308
309 def tearDown(self):
310 del self.domain
311
312 ### PCG + ILUT
313
314 class Test_SimpleSolveDudleyRect_Trilinos_PCG_ILUT(SimpleSolveSingleOnly):
315 def setUp(self):
316 self.domain = Rectangle(NE0, NE1, optimize=OPTIMIZE)
317 self.package = SolverOptions.TRILINOS
318 self.method = SolverOptions.PCG
319 self.preconditioner = SolverOptions.ILUT
320
321 def tearDown(self):
322 del self.domain
323
324 class Test_SimpleSolveDudleyBrick_Trilinos_PCG_ILUT(SimpleSolveSingleOnly):
325 def setUp(self):
326 self.domain = Brick(NE0, NE1, NE2, optimize=OPTIMIZE)
327 self.package = SolverOptions.TRILINOS
328 self.method = SolverOptions.PCG
329 self.preconditioner = SolverOptions.ILUT
330
331 def tearDown(self):
332 del self.domain
333
334
335 if __name__ == '__main__':
336 run_tests(__name__, exit_on_failure=True)
337

  ViewVC Help
Powered by ViewVC 1.1.26