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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1830 - (hide annotations)
Thu Oct 2 06:51:48 2008 UTC (10 years, 8 months ago) by ksteube
File MIME type: text/x-python
File size: 7854 byte(s)
Tests using JoinFaces() and domain.write() will not work under MPI and must be disabled for num procs > 1

1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 ksteube 1809 # Copyright (c) 2003-2008 by University of Queensland
5     # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1312 #
8 ksteube 1809 # 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 ksteube 1312 #
12 ksteube 1809 ########################################################
13 jgs 153
14 ksteube 1809 __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15     Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
17     Primary Business: Queensland, Australia"""
18 elspeth 617 __license__="""Licensed under the Open Software License version 3.0
19 ksteube 1809 http://www.opensource.org/licenses/osl-3.0.php"""
20     __url__="http://www.uq.edu.au/esscc/escript-finley"
21    
22 jgs 153 import unittest
23 gross 707 from test_util import Test_util as Test_util
24 gross 855 from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary, Test_Util_SpatialFunctions_noGradOnBoundary_noContact
25 gross 707 from test_symbols import Test_symbols
26 gross 526
27 ksteube 1830 from esys.escript import *
28 gross 855 from esys.finley import Rectangle,Brick,JoinFaces,ReadMesh
29 jgs 153 import sys
30 gross 855 import os
31 jgs 153
32 gross 855 try:
33     FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
34     except KeyError:
35     FINLEY_TEST_DATA='.'
36    
37     FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"
38    
39    
40 gross 777 NE=4 # number elements, must be even
41    
42 gross 526 class Test_UtilOnFinley(Test_util,Test_symbols):
43 jgs 153 def setUp(self):
44 gross 777 self.domain =Rectangle(NE,NE+1,2)
45 gross 442 self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain
46 gross 798 def tearDown(self):
47     del self.functionspace
48     del self.domain
49 jgs 153
50 gross 855 class Test_Util_SpatialFunctionsOnFinleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
51 gross 437 def setUp(self):
52     self.order=1
53 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order1.fly",optimize=False)
54 gross 855 def tearDown(self):
55     del self.order
56     del self.domain
57    
58     class Test_Util_SpatialFunctionsOnFinleyTet2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
59     def setUp(self):
60     self.order=2
61 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order2.fly",optimize=False)
62 gross 855 def tearDown(self):
63     del self.order
64     del self.domain
65    
66     class Test_Util_SpatialFunctionsOnFinleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
67     def setUp(self):
68     self.order=1
69 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order1.fly",optimize=False)
70 gross 855 def tearDown(self):
71     del self.order
72     del self.domain
73    
74     class Test_Util_SpatialFunctionsOnFinleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
75     def setUp(self):
76     self.order=2
77 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order2.fly",optimize=False)
78 gross 855 def tearDown(self):
79     del self.order
80     del self.domain
81    
82     class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
83     def setUp(self):
84     self.order=1
85 gross 777 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
86     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1)
87 gross 437 d2.setX(d2.getX()+[0.5,0.])
88 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
89 gross 798 def tearDown(self):
90     del self.order
91     del self.domain
92 gross 437
93 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
94 gross 437 def setUp(self):
95     self.order=2
96 gross 777 d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
97     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
98 gross 437 d2.setX(d2.getX()+[0.5,0.])
99 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
100 gross 798 def tearDown(self):
101     del self.order
102     del self.domain
103 gross 437
104 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
105 gross 437 def setUp(self):
106     self.order=1
107 gross 777 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
108     d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1)
109 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
110 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
111 gross 798 def tearDown(self):
112     del self.order
113     del self.domain
114 gross 437
115 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
116 gross 437 def setUp(self):
117     self.order=2
118 gross 777 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
119     d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2)
120 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
121 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
122 gross 798 def tearDown(self):
123     del self.order
124     del self.domain
125 gross 437
126 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
127 gross 777 def setUp(self):
128     self.order=1
129     d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
130     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
131     d2.setX(d2.getX()+[0.5,0.])
132 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
133 gross 798 def tearDown(self):
134     del self.order
135     del self.domain
136 gross 777
137 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
138 gross 777 def setUp(self):
139     self.order=2
140     d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
141     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
142     d2.setX(d2.getX()+[0.5,0.])
143 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
144 gross 798 def tearDown(self):
145     del self.order
146     del self.domain
147 gross 777
148 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
149 gross 777 def setUp(self):
150     self.order=1
151     d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
152     d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
153     d2.setX(d2.getX()+[0.5,0.,0.])
154 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
155 gross 798 def tearDown(self):
156     del self.order
157     del self.domain
158 gross 777
159 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
160 gross 777 def setUp(self):
161     self.order=2
162     d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
163     d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
164     d2.setX(d2.getX()+[0.5,0.,0.])
165 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
166 gross 798 def tearDown(self):
167     del self.order
168     del self.domain
169 gross 777
170 jgs 153 if __name__ == '__main__':
171     suite = unittest.TestSuite()
172 gross 857 if True:
173     suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
174     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder1))
175     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder2))
176 gross 859 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder1))
177     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder2))
178 ksteube 1830 # These tests use JoinFaces and are not MPI parallel
179     if getMPISizeWorld() == 1:
180     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1))
181     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2))
182     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1))
183     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2))
184     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace))
185     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace))
186     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace))
187     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace))
188 gross 857 else:
189 gross 859 pass
190 jgs 153 s=unittest.TextTestRunner(verbosity=2).run(suite)
191 gross 1376 if not s.wasSuccessful(): sys.exit(1)
192    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26