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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4984 - (show annotations)
Mon Jun 2 02:50:34 2014 UTC (5 years, 2 months ago) by sshaw
File MIME type: text/x-python
File size: 3381 byte(s)
revamping testrunners, now uses automated discovery and allows running specific tests without modifying files (see escriptcore/py_src/testing.py for more info/examples)

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2014 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2014 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="https://launchpad.net/escript-finley"
21
22 """
23 Test suite for the linearPDE and pdetools on ripley
24
25 :remark:
26
27 :var __author__: name of author
28 :var __licence__: licence agreement
29 :var __url__: url entry point on documentation
30 :var __version__: version
31 :var __date__: date of the version
32 """
33
34 __author__="Lutz Gross, l.gross@uq.edu.au"
35
36 import os
37 import esys.escriptcore.utestselect as unittest
38 from esys.escriptcore.testing import *
39 from test_linearPDEs import Test_Poisson, Test_LinearPDE, Test_TransportPDE, Test_LameEquation, Test_Helmholtz, Test_LinearPDE_noLumping
40 from test_assemblage import Test_assemblage_2Do1, Test_assemblage_3Do1
41 from test_pdetools import Test_pdetools, Test_pdetools_noLumping
42 from esys.escript import *
43 from esys.ripley import Rectangle, Brick
44
45
46 try:
47 RIPLEY_TEST_DATA=os.environ['RIPLEY_TEST_DATA']
48 except KeyError:
49 RIPLEY_TEST_DATA='.'
50
51 NE=10 # number of element in each spatial direction (must be even)
52 mpiSize=getMPISizeWorld()
53
54 class Test_LinearPDEOnRipleyRect(Test_LinearPDE, Test_LameEquation, Test_Helmholtz, Test_LinearPDE_noLumping, Test_pdetools, Test_assemblage_2Do1, Test_TransportPDE):
55 RES_TOL=1.e-7
56 ABS_TOL=1.e-8
57 def setUp(self):
58 for x in [int(sqrt(mpiSize)),2,3,5,7,1]:
59 NX=x
60 NY=mpiSize//x
61 if NX*NY == mpiSize:
62 break
63 self.domain=Rectangle(n0=NE*NX-1, n1=NE*NY-1, l0=1., l1=1., d0=NX, d1=NY)
64 self.order = 1
65 def tearDown(self):
66 del self.domain
67
68 class Test_LinearPDEOnRipleyBrick(Test_LinearPDE, Test_LameEquation, Test_Helmholtz, Test_LinearPDE_noLumping, Test_pdetools, Test_assemblage_3Do1, Test_TransportPDE):
69 RES_TOL=1.e-7
70 ABS_TOL=1.e-8
71 def setUp(self):
72 for x in [(int(mpiSize**(1/3.)),int(mpiSize**(1/3.))),(2,3),(2,2),(1,2),(1,1)]:
73 NX=x[0]
74 NY=x[1]
75 NZ=mpiSize//(x[0]*x[1])
76 if NX*NY*NZ == mpiSize:
77 break
78
79 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)
80 self.order = 1
81
82 def tearDown(self):
83 del self.domain
84
85 class Test_PoissonOnRipley(Test_Poisson):
86 RES_TOL=1.e-7
87 ABS_TOL=1.e-8
88 def setUp(self):
89 for x in [int(sqrt(mpiSize)),2,3,5,7,1]:
90 NX=x
91 NY=mpiSize//x
92 if NX*NY == mpiSize:
93 break
94 self.domain=Rectangle(n0=NE*NX-1, n1=NE*NY-1, l0=1., l1=1., d0=NX, d1=NY)
95 def tearDown(self):
96 del self.domain
97
98
99 if __name__ == '__main__':
100 run_tests(__name__, exit_on_failure=True)
101

  ViewVC Help
Powered by ViewVC 1.1.26