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

Annotation of /trunk/finley/test/python/run_linearPDEsOnFinleyMacro.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4938 - (hide annotations)
Wed May 14 01:13:23 2014 UTC (5 years, 4 months ago) by jfenwick
File MIME type: text/x-python
File size: 3718 byte(s)
Modify unit tests to read their classes from
esys.escriptcore.utestselect

Change the line in that file to switch between unittest and unittest2


1 gross 2748
2     ########################################################
3     #
4 jfenwick 4657 # Copyright (c) 2003-2014 by University of Queensland
5 gross 2748 # Earth Systems Science Computational Center (ESSCC)
6 jfenwick 3981 # http://www.uq.edu.au
7 gross 2748 #
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 jfenwick 4657 __copyright__="""Copyright (c) 2003-2014 by University of Queensland
15 gross 2748 Earth Systems Science Computational Center (ESSCC)
16 jfenwick 3981 http://www.uq.edu.au
17 gross 2748 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 test on finley
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    
38 jfenwick 4938 import esys.escriptcore.utestselect as unittest
39 gross 2748 from test_linearPDEs import Test_Poisson,Test_LinearPDE, Test_LinearPDE_noLumping, Test_TransportPDE
40     from test_assemblage import Test_assemblage_2Do1, Test_assemblage_2Do2, Test_assemblage_3Do1, Test_assemblage_3Do2, \
41     Test_assemblage_2Do1_Contact,Test_assemblage_2Do2_Contact, Test_assemblage_3Do1_Contact, Test_assemblage_3Do2_Contact
42     from test_pdetools import Test_pdetools, Test_pdetools_noLumping
43     from esys.escript import *
44     from esys.finley import Rectangle,Brick,JoinFaces, ReadMesh
45     import sys
46    
47    
48     try:
49     FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
50     except KeyError:
51     FINLEY_TEST_DATA='.'
52    
53     FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
54    
55     NE=3
56    
57     class Test_LinearPDEOnFinleyHex2DMacro(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1, Test_TransportPDE):
58     RES_TOL=1.e-7
59     ABS_TOL=1.e-8
60     def setUp(self):
61 jfenwick 3901 self.domain = Rectangle(NE,NE,-1,useElementsOnFace=0)
62 gross 2748 self.order = 1
63     def tearDown(self):
64     del self.domain
65    
66     class Test_LinearPDEOnFinleyHex3DMacro(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1, Test_TransportPDE):
67     RES_TOL=1.e-7
68     ABS_TOL=1.e-8
69     def setUp(self):
70 jfenwick 3901 self.domain = Brick(NE,NE,NE,-1,useElementsOnFace=0)
71 gross 2748 self.order = 1
72     def tearDown(self):
73     del self.domain
74    
75     class Test_LinearPDEOnFinleyTet2DMacro(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1, Test_TransportPDE):
76     RES_TOL=1.e-7
77     ABS_TOL=1.e-8
78     def setUp(self):
79     self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_macro.fly"),optimize=False)
80     # self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"../rec.fly"),optimize=False)
81     self.order = 1
82     def tearDown(self):
83     del self.domain
84    
85     class Test_LinearPDEOnFinleyTet3DMacro(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1, Test_TransportPDE):
86     RES_TOL=1.e-7
87     ABS_TOL=1.e-8
88     def setUp(self):
89     self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_macro.fly"),optimize=False)
90     self.order = 1
91     def tearDown(self):
92     del self.domain
93    
94     if __name__ == '__main__':
95     suite = unittest.TestSuite()
96     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex2DMacro))
97     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex3DMacro))
98     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet2DMacro))
99     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet3DMacro))
100    
101     s=unittest.TextTestRunner(verbosity=2).run(suite)
102     if not s.wasSuccessful(): sys.exit(1)
103    

  ViewVC Help
Powered by ViewVC 1.1.26