/[escript]/trunk/finley/test/python/run_trilinosSolversOnFinley.py
ViewVC logotype

Contents of /trunk/finley/test/python/run_trilinosSolversOnFinley.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (show annotations)
Wed Feb 7 02:12:08 2018 UTC (20 months, 1 week ago) by jfenwick
File MIME type: text/x-python
File size: 24552 byte(s)
Make everyone sad by touching all the files

Copyright dates update

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2018 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Apache License, version 2.0
9 # http://www.apache.org/licenses/LICENSE-2.0
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-2018 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 finley
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.escript import Data, Solution, Vector, hasFeature
35 from esys.finley import Rectangle, Brick
36 from esys.escript.linearPDEs import SolverOptions
37
38 HAVE_TRILINOS = hasFeature('trilinos')
39 skip_muelu_long = False #hasFeature("longindex")
40
41 # number of elements in the spatial directions
42 NE0=12
43 NE1=12
44 NE2=8
45 OPTIMIZE=True
46
47 @unittest.skipIf(not HAVE_TRILINOS, "Trilinos not available")
48 class SimpleSolveOnTrilinos(SimpleSolveTestCase):
49 pass
50
51 class SimpleSolveOrder2(SimpleSolveOnTrilinos):
52 SOLVER_TOL = 1.e-9
53 def _getGrad(self, system):
54 """returns exact gradient"""
55 dim = self.domain.getDim()
56 x = Solution(self.domain).getX()
57 if system:
58 g_ex = Data(0., (dim,dim), Solution(self.domain))
59 if dim == 2:
60 g_ex[0,0] = 2.+8.*x[0]+ 5.*x[1]
61 g_ex[0,1] = 3.+5.*x[0]+12.*x[1]
62 g_ex[1,0] = 4.+2.*x[0]+ 6.*x[1]
63 g_ex[1,1] = 2.+6.*x[0]+ 8.*x[1]
64 else:
65 g_ex[0,0] = 2.+6.*x[1]+8.*x[2]+18.*x[0]
66 g_ex[0,1] = 3.+6.*x[0]+7.*x[2]+20.*x[1]
67 g_ex[0,2] = 4.+7.*x[1]+8.*x[0]+22.*x[2]
68 g_ex[1,0] = 4.+3.*x[1]-8.*x[2]- 4.*x[0]
69 g_ex[1,1] = 1.+3.*x[0]+2.*x[2]+14.*x[1]
70 g_ex[1,2] = -6.+2.*x[1]-8.*x[0]+10.*x[2]
71 g_ex[2,0] = 7.-6.*x[1]+2.*x[2]+ 4.*x[0]
72 g_ex[2,1] = 9.-6.*x[0]+8.*x[2]+16.*x[1]
73 g_ex[2,2] = 2.+8.*x[1]+2.*x[0]+ 2.*x[2]
74 else:
75 g_ex = Data(0., (dim,), Solution(self.domain))
76 if dim == 2:
77 g_ex[0] = 2.+8.*x[0]+5.*x[1]
78 g_ex[1] = 3.+5.*x[0]+12.*x[1]
79 else:
80 g_ex[0] = 2.+6.*x[1]+8.*x[2]+18.*x[0]
81 g_ex[1] = 3.+6.*x[0]+7.*x[2]+20.*x[1]
82 g_ex[2] = 4.+7.*x[1]+8.*x[0]+22.*x[2]
83 return g_ex
84
85 def _getSolution(self, system):
86 """returns exact solution"""
87 dim = self.domain.getDim()
88 x = Solution(self.domain).getX()
89 if system:
90 u_ex = Vector(0., Solution(self.domain))
91 if dim == 2:
92 u_ex[0] = 1.+2.*x[0]+3.*x[1]+4.*x[0]**2+5.*x[1]*x[0]+6.*x[1]**2
93 u_ex[1] = -1.+4.*x[0]+2.*x[1]+1.*x[0]**2+6.*x[1]*x[0]+4.*x[1]**2
94 else:
95 u_ex[0] = 1.+2.*x[0]+3.*x[1]+4.*x[2]+\
96 6.*x[0]*x[1]+7.*x[1]*x[2]+8.*x[2]*x[0]+\
97 9.*x[0]**2+10.*x[1]**2+11.*x[2]**2
98 u_ex[1] = 2.+4.*x[0]+1.*x[1]-6.*x[2]+\
99 3.*x[0]*x[1]+2.*x[1]*x[2]-8.*x[2]*x[0]-\
100 2.*x[0]**2+7.*x[1]**2+5.*x[2]**2
101 u_ex[2] = -2.+7.*x[0]+9.*x[1]+2*x[2]-\
102 6.*x[0]*x[1]+8.*x[1]*x[2]+2.*x[2]*x[0]+\
103 2.*x[0]**2+8.*x[1]**2+1.*x[2]**2
104 else:
105 if dim == 2:
106 u_ex = 1.+2.*x[0]+3.*x[1]+4.*x[0]**2+5.*x[1]*x[0]+6.*x[1]**2
107 else:
108 u_ex = 1.+2.*x[0]+3.*x[1]+4.*x[2]+\
109 6.*x[0]*x[1]+7.*x[1]*x[2]+8.*x[2]*x[0]+\
110 9.*x[0]**2+10.*x[1]**2+11.*x[2]**2
111 return u_ex
112
113 def _setCoefficients(self, pde, system):
114 """sets PDE coefficients"""
115 super(SimpleSolveOrder2, self)._setCoefficients(pde, system)
116 dim = self.domain.getDim()
117 if system:
118 Y = pde.getCoefficient("Y")
119 if dim == 2:
120 Y[0] = Y[0]-20.
121 Y[1] = Y[1]-10.
122 else:
123 Y[0] = Y[0]-60.
124 Y[1] = Y[1]-20.
125 Y[2] = Y[2]-22.
126 pde.setValue(Y=Y)
127 else:
128 if dim == 2:
129 pde.setValue(Y=-20.)
130 else:
131 pde.setValue(Y=-60.)
132
133 ### BiCGStab + Jacobi
134
135 class Test_SimpleSolveFinleyRect_Order1_Trilinos_BICGSTAB_Jacobi(SimpleSolveOnTrilinos):
136 def setUp(self):
137 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
138 self.package = SolverOptions.TRILINOS
139 self.method = SolverOptions.BICGSTAB
140 self.preconditioner = SolverOptions.JACOBI
141
142 def tearDown(self):
143 del self.domain
144
145 class Test_SimpleSolveFinleyRect_Order2_Trilinos_BICGSTAB_Jacobi(SimpleSolveOrder2):
146 def setUp(self):
147 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
148 self.package = SolverOptions.TRILINOS
149 self.method = SolverOptions.BICGSTAB
150 self.preconditioner = SolverOptions.JACOBI
151
152 def tearDown(self):
153 del self.domain
154
155 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_BICGSTAB_Jacobi(SimpleSolveOnTrilinos):
156 def setUp(self):
157 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
158 self.package = SolverOptions.TRILINOS
159 self.method = SolverOptions.BICGSTAB
160 self.preconditioner = SolverOptions.JACOBI
161
162 def tearDown(self):
163 del self.domain
164
165 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_BICGSTAB_Jacobi(SimpleSolveOrder2):
166 def setUp(self):
167 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
168 self.package = SolverOptions.TRILINOS
169 self.method = SolverOptions.BICGSTAB
170 self.preconditioner = SolverOptions.JACOBI
171
172 def tearDown(self):
173 del self.domain
174
175 ### PCG + Jacobi
176
177 class Test_SimpleSolveFinleyRect_Order1_Trilinos_PCG_Jacobi(SimpleSolveOnTrilinos):
178 def setUp(self):
179 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
180 self.package = SolverOptions.TRILINOS
181 self.method = SolverOptions.PCG
182 self.preconditioner = SolverOptions.JACOBI
183
184 def tearDown(self):
185 del self.domain
186
187 class Test_SimpleSolveFinleyRect_Order2_Trilinos_PCG_Jacobi(SimpleSolveOrder2):
188 def setUp(self):
189 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
190 self.package = SolverOptions.TRILINOS
191 self.method = SolverOptions.PCG
192 self.preconditioner = SolverOptions.JACOBI
193
194 def tearDown(self):
195 del self.domain
196
197 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_PCG_Jacobi(SimpleSolveOnTrilinos):
198 def setUp(self):
199 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
200 self.package = SolverOptions.TRILINOS
201 self.method = SolverOptions.PCG
202 self.preconditioner = SolverOptions.JACOBI
203
204 def tearDown(self):
205 del self.domain
206
207 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_PCG_Jacobi(SimpleSolveOrder2):
208 def setUp(self):
209 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
210 self.package = SolverOptions.TRILINOS
211 self.method = SolverOptions.PCG
212 self.preconditioner = SolverOptions.JACOBI
213
214 def tearDown(self):
215 del self.domain
216
217 ### TFQMR + Jacobi
218
219 class Test_SimpleSolveFinleyRect_Order1_Trilinos_TFQMR_Jacobi(SimpleSolveOnTrilinos):
220 def setUp(self):
221 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
222 self.package = SolverOptions.TRILINOS
223 self.method = SolverOptions.TFQMR
224 self.preconditioner = SolverOptions.JACOBI
225
226 def tearDown(self):
227 del self.domain
228
229 class Test_SimpleSolveFinleyRect_Order2_Trilinos_TFQMR_Jacobi(SimpleSolveOrder2):
230 def setUp(self):
231 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
232 self.package = SolverOptions.TRILINOS
233 self.method = SolverOptions.TFQMR
234 self.preconditioner = SolverOptions.JACOBI
235
236 def tearDown(self):
237 del self.domain
238
239 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_TFQMR_Jacobi(SimpleSolveOnTrilinos):
240 def setUp(self):
241 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
242 self.package = SolverOptions.TRILINOS
243 self.method = SolverOptions.TFQMR
244 self.preconditioner = SolverOptions.JACOBI
245
246 def tearDown(self):
247 del self.domain
248
249 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_TFQMR_Jacobi(SimpleSolveOrder2):
250 def setUp(self):
251 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
252 self.package = SolverOptions.TRILINOS
253 self.method = SolverOptions.TFQMR
254 self.preconditioner = SolverOptions.JACOBI
255
256 def tearDown(self):
257 del self.domain
258
259 ### MINRES + Jacobi
260
261 class Test_SimpleSolveFinleyRect_Order1_Trilinos_MINRES_Jacobi(SimpleSolveOnTrilinos):
262 def setUp(self):
263 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
264 self.package = SolverOptions.TRILINOS
265 self.method = SolverOptions.MINRES
266 self.preconditioner = SolverOptions.JACOBI
267
268 def tearDown(self):
269 del self.domain
270
271 class Test_SimpleSolveFinleyRect_Order2_Trilinos_MINRES_Jacobi(SimpleSolveOrder2):
272 def setUp(self):
273 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
274 self.package = SolverOptions.TRILINOS
275 self.method = SolverOptions.MINRES
276 self.preconditioner = SolverOptions.JACOBI
277
278 def tearDown(self):
279 del self.domain
280
281 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_MINRES_Jacobi(SimpleSolveOnTrilinos):
282 def setUp(self):
283 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
284 self.package = SolverOptions.TRILINOS
285 self.method = SolverOptions.MINRES
286 self.preconditioner = SolverOptions.JACOBI
287
288 def tearDown(self):
289 del self.domain
290
291 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_MINRES_Jacobi(SimpleSolveOrder2):
292 def setUp(self):
293 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
294 self.package = SolverOptions.TRILINOS
295 self.method = SolverOptions.MINRES
296 self.preconditioner = SolverOptions.JACOBI
297
298 def tearDown(self):
299 del self.domain
300
301 ### BiCGStab + Gauss-Seidel
302
303 class Test_SimpleSolveFinleyRect_Order1_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveOnTrilinos):
304 def setUp(self):
305 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
306 self.package = SolverOptions.TRILINOS
307 self.method = SolverOptions.BICGSTAB
308 self.preconditioner = SolverOptions.GAUSS_SEIDEL
309
310 def tearDown(self):
311 del self.domain
312
313 class Test_SimpleSolveFinleyRect_Order2_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveOrder2):
314 def setUp(self):
315 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
316 self.package = SolverOptions.TRILINOS
317 self.method = SolverOptions.BICGSTAB
318 self.preconditioner = SolverOptions.GAUSS_SEIDEL
319
320 def tearDown(self):
321 del self.domain
322
323 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveOnTrilinos):
324 def setUp(self):
325 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
326 self.package = SolverOptions.TRILINOS
327 self.method = SolverOptions.BICGSTAB
328 self.preconditioner = SolverOptions.GAUSS_SEIDEL
329
330 def tearDown(self):
331 del self.domain
332
333 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_BICGSTAB_GaussSeidel(SimpleSolveOrder2):
334 def setUp(self):
335 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
336 self.package = SolverOptions.TRILINOS
337 self.method = SolverOptions.BICGSTAB
338 self.preconditioner = SolverOptions.GAUSS_SEIDEL
339
340 def tearDown(self):
341 del self.domain
342
343 ### PCG + AMG
344
345 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
346 class Test_SimpleSolveFinleyRect_Order1_Trilinos_PCG_AMG(SimpleSolveOnTrilinos):
347 def setUp(self):
348 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
349 self.package = SolverOptions.TRILINOS
350 self.method = SolverOptions.PCG
351 self.preconditioner = SolverOptions.AMG
352
353 def tearDown(self):
354 del self.domain
355
356 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
357 class Test_SimpleSolveFinleyRect_Order2_Trilinos_PCG_AMG(SimpleSolveOrder2):
358 def setUp(self):
359 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
360 self.package = SolverOptions.TRILINOS
361 self.method = SolverOptions.PCG
362 self.preconditioner = SolverOptions.AMG
363
364 def tearDown(self):
365 del self.domain
366
367 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
368 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_PCG_AMG(SimpleSolveOnTrilinos):
369 def setUp(self):
370 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
371 self.package = SolverOptions.TRILINOS
372 self.method = SolverOptions.PCG
373 self.preconditioner = SolverOptions.AMG
374
375 def tearDown(self):
376 del self.domain
377
378 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
379 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_PCG_AMG(SimpleSolveOrder2):
380 def setUp(self):
381 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
382 self.package = SolverOptions.TRILINOS
383 self.method = SolverOptions.PCG
384 self.preconditioner = SolverOptions.AMG
385
386 def tearDown(self):
387 del self.domain
388
389 ### TFQMR + Gauss-Seidel
390
391 class Test_SimpleSolveFinleyRect_Order1_Trilinos_TFQMR_GaussSeidel(SimpleSolveOnTrilinos):
392 def setUp(self):
393 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
394 self.package = SolverOptions.TRILINOS
395 self.method = SolverOptions.TFQMR
396 self.preconditioner = SolverOptions.GAUSS_SEIDEL
397
398 def tearDown(self):
399 del self.domain
400
401 class Test_SimpleSolveFinleyRect_Order2_Trilinos_TFQMR_GaussSeidel(SimpleSolveOrder2):
402 def setUp(self):
403 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
404 self.package = SolverOptions.TRILINOS
405 self.method = SolverOptions.TFQMR
406 self.preconditioner = SolverOptions.GAUSS_SEIDEL
407
408 def tearDown(self):
409 del self.domain
410
411 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_TFQMR_GaussSeidel(SimpleSolveOnTrilinos):
412 def setUp(self):
413 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
414 self.package = SolverOptions.TRILINOS
415 self.method = SolverOptions.TFQMR
416 self.preconditioner = SolverOptions.GAUSS_SEIDEL
417
418 def tearDown(self):
419 del self.domain
420
421 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_TFQMR_GaussSeidel(SimpleSolveOrder2):
422 def setUp(self):
423 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
424 self.package = SolverOptions.TRILINOS
425 self.method = SolverOptions.TFQMR
426 self.preconditioner = SolverOptions.GAUSS_SEIDEL
427
428 def tearDown(self):
429 del self.domain
430
431 ### MINRES + AMG
432
433 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
434 class Test_SimpleSolveFinleyRect_Order1_Trilinos_MINRES_AMG(SimpleSolveOnTrilinos):
435 def setUp(self):
436 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
437 self.package = SolverOptions.TRILINOS
438 self.method = SolverOptions.MINRES
439 self.preconditioner = SolverOptions.AMG
440
441 def tearDown(self):
442 del self.domain
443
444 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
445 class Test_SimpleSolveFinleyRect_Order2_Trilinos_MINRES_AMG(SimpleSolveOrder2):
446 def setUp(self):
447 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
448 self.package = SolverOptions.TRILINOS
449 self.method = SolverOptions.MINRES
450 self.preconditioner = SolverOptions.AMG
451
452 def tearDown(self):
453 del self.domain
454
455 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
456 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_MINRES_AMG(SimpleSolveOnTrilinos):
457 def setUp(self):
458 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
459 self.package = SolverOptions.TRILINOS
460 self.method = SolverOptions.MINRES
461 self.preconditioner = SolverOptions.AMG
462
463 def tearDown(self):
464 del self.domain
465
466 @unittest.skipIf(skip_muelu_long, "MueLu AMG incompatible with index type long")
467 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_MINRES_AMG(SimpleSolveOrder2):
468 def setUp(self):
469 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
470 self.package = SolverOptions.TRILINOS
471 self.method = SolverOptions.MINRES
472 self.preconditioner = SolverOptions.AMG
473
474 def tearDown(self):
475 del self.domain
476
477 ### BiCGStab + RILU
478
479 class Test_SimpleSolveFinleyRect_Order1_Trilinos_BICGSTAB_RILU(SimpleSolveOnTrilinos):
480 def setUp(self):
481 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
482 self.package = SolverOptions.TRILINOS
483 self.method = SolverOptions.BICGSTAB
484 self.preconditioner = SolverOptions.RILU
485
486 def tearDown(self):
487 del self.domain
488
489 class Test_SimpleSolveFinleyRect_Order2_Trilinos_BICGSTAB_RILU(SimpleSolveOrder2):
490 def setUp(self):
491 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
492 self.package = SolverOptions.TRILINOS
493 self.method = SolverOptions.BICGSTAB
494 self.preconditioner = SolverOptions.RILU
495
496 def tearDown(self):
497 del self.domain
498
499 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_BICGSTAB_RILU(SimpleSolveOnTrilinos):
500 def setUp(self):
501 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
502 self.package = SolverOptions.TRILINOS
503 self.method = SolverOptions.BICGSTAB
504 self.preconditioner = SolverOptions.RILU
505
506 def tearDown(self):
507 del self.domain
508
509 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_BICGSTAB_RILU(SimpleSolveOrder2):
510 def setUp(self):
511 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
512 self.package = SolverOptions.TRILINOS
513 self.method = SolverOptions.BICGSTAB
514 self.preconditioner = SolverOptions.RILU
515
516 def tearDown(self):
517 del self.domain
518
519 ### PCG + RILU
520
521 class Test_SimpleSolveFinleyRect_Order1_Trilinos_PCG_RILU(SimpleSolveOnTrilinos):
522 def setUp(self):
523 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
524 self.package = SolverOptions.TRILINOS
525 self.method = SolverOptions.PCG
526 self.preconditioner = SolverOptions.RILU
527
528 def tearDown(self):
529 del self.domain
530
531 class Test_SimpleSolveFinleyRect_Order2_Trilinos_PCG_RILU(SimpleSolveOrder2):
532 def setUp(self):
533 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
534 self.package = SolverOptions.TRILINOS
535 self.method = SolverOptions.PCG
536 self.preconditioner = SolverOptions.RILU
537
538 def tearDown(self):
539 del self.domain
540
541 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_PCG_RILU(SimpleSolveOnTrilinos):
542 def setUp(self):
543 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
544 self.package = SolverOptions.TRILINOS
545 self.method = SolverOptions.PCG
546 self.preconditioner = SolverOptions.RILU
547
548 def tearDown(self):
549 del self.domain
550
551 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_PCG_RILU(SimpleSolveOrder2):
552 def setUp(self):
553 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
554 self.package = SolverOptions.TRILINOS
555 self.method = SolverOptions.PCG
556 self.preconditioner = SolverOptions.RILU
557
558 def tearDown(self):
559 del self.domain
560
561 ### TFQMR + RILU
562
563 class Test_SimpleSolveFinleyRect_Order1_Trilinos_TFQMR_RILU(SimpleSolveOnTrilinos):
564 def setUp(self):
565 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
566 self.package = SolverOptions.TRILINOS
567 self.method = SolverOptions.TFQMR
568 self.preconditioner = SolverOptions.RILU
569
570 def tearDown(self):
571 del self.domain
572
573 class Test_SimpleSolveFinleyRect_Order2_Trilinos_TFQMR_RILU(SimpleSolveOrder2):
574 def setUp(self):
575 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
576 self.package = SolverOptions.TRILINOS
577 self.method = SolverOptions.TFQMR
578 self.preconditioner = SolverOptions.RILU
579
580 def tearDown(self):
581 del self.domain
582
583 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_TFQMR_RILU(SimpleSolveOnTrilinos):
584 def setUp(self):
585 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
586 self.package = SolverOptions.TRILINOS
587 self.method = SolverOptions.TFQMR
588 self.preconditioner = SolverOptions.RILU
589
590 def tearDown(self):
591 del self.domain
592
593 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_TFQMR_RILU(SimpleSolveOrder2):
594 def setUp(self):
595 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
596 self.package = SolverOptions.TRILINOS
597 self.method = SolverOptions.TFQMR
598 self.preconditioner = SolverOptions.RILU
599
600 def tearDown(self):
601 del self.domain
602
603 ### MINRES + RILU
604
605 class Test_SimpleSolveFinleyRect_Order1_Trilinos_MINRES_RILU(SimpleSolveOnTrilinos):
606 def setUp(self):
607 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
608 self.package = SolverOptions.TRILINOS
609 self.method = SolverOptions.MINRES
610 self.preconditioner = SolverOptions.RILU
611
612 def tearDown(self):
613 del self.domain
614
615 class Test_SimpleSolveFinleyRect_Order2_Trilinos_MINRES_RILU(SimpleSolveOrder2):
616 def setUp(self):
617 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
618 self.package = SolverOptions.TRILINOS
619 self.method = SolverOptions.MINRES
620 self.preconditioner = SolverOptions.RILU
621
622 def tearDown(self):
623 del self.domain
624
625 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_MINRES_RILU(SimpleSolveOnTrilinos):
626 def setUp(self):
627 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
628 self.package = SolverOptions.TRILINOS
629 self.method = SolverOptions.MINRES
630 self.preconditioner = SolverOptions.RILU
631
632 def tearDown(self):
633 del self.domain
634
635 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_MINRES_RILU(SimpleSolveOrder2):
636 def setUp(self):
637 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
638 self.package = SolverOptions.TRILINOS
639 self.method = SolverOptions.MINRES
640 self.preconditioner = SolverOptions.RILU
641
642 def tearDown(self):
643 del self.domain
644
645 ### PCG + ILUT
646
647 class Test_SimpleSolveFinleyRect_Order1_Trilinos_PCG_ILUT(SimpleSolveOnTrilinos):
648 def setUp(self):
649 self.domain = Rectangle(NE0, NE1, 1, optimize=OPTIMIZE)
650 self.package = SolverOptions.TRILINOS
651 self.method = SolverOptions.PCG
652 self.preconditioner = SolverOptions.ILUT
653
654 def tearDown(self):
655 del self.domain
656
657 class Test_SimpleSolveFinleyRect_Order2_Trilinos_PCG_ILUT(SimpleSolveOrder2):
658 def setUp(self):
659 self.domain = Rectangle(NE0, NE1, 2, optimize=OPTIMIZE)
660 self.package = SolverOptions.TRILINOS
661 self.method = SolverOptions.PCG
662 self.preconditioner = SolverOptions.ILUT
663
664 def tearDown(self):
665 del self.domain
666
667 class Test_SimpleSolveFinleyBrick_Order1_Trilinos_PCG_ILUT(SimpleSolveOnTrilinos):
668 def setUp(self):
669 self.domain = Brick(NE0, NE1, NE2, 1, optimize=OPTIMIZE)
670 self.package = SolverOptions.TRILINOS
671 self.method = SolverOptions.PCG
672 self.preconditioner = SolverOptions.ILUT
673
674 def tearDown(self):
675 del self.domain
676
677 class Test_SimpleSolveFinleyBrick_Order2_Trilinos_PCG_ILUT(SimpleSolveOrder2):
678 def setUp(self):
679 self.domain = Brick(NE0, NE1, NE2, 2, optimize=OPTIMIZE)
680 self.package = SolverOptions.TRILINOS
681 self.method = SolverOptions.PCG
682 self.preconditioner = SolverOptions.ILUT
683
684 def tearDown(self):
685 del self.domain
686
687
688 if __name__ == '__main__':
689 run_tests(__name__, exit_on_failure=True)
690

  ViewVC Help
Powered by ViewVC 1.1.26