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

Contents of /trunk/finley/test/python/run_utilOnFinley.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: 9924 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 # 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 __copyright__="""Copyright (c) 2003-2014 by University of Queensland
18 http://www.uq.edu.au
19 Primary Business: Queensland, Australia"""
20 __license__="""Licensed under the Open Software License version 3.0
21 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
23
24 import esys.escriptcore.utestselect as unittest
25 from esys.escriptcore.testing import *
26 from test_util import Test_util as Test_util
27 from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary, Test_Util_SpatialFunctions_noGradOnBoundary_noContact
28
29 from esys.escript import *
30 from esys.finley import Rectangle,Brick,JoinFaces,ReadMesh
31 import sys
32 import os
33
34 if HAVE_SYMBOLS:
35 from test_symfuncs import Test_symfuncs
36 else:
37 print("Skipping symbolic tests since sympy is not available")
38 class Test_symfuncs:
39 pass
40
41 try:
42 FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
43 except KeyError:
44 FINLEY_TEST_DATA='.'
45
46 FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
47
48
49 NE=4 # number elements, must be even
50
51 class Test_UtilOnFinley(Test_util,Test_symfuncs):
52 def setUp(self):
53 self.domain =Rectangle(NE,NE+1,2)
54 self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain
55 def tearDown(self):
56 del self.functionspace
57 del self.domain
58
59 class Test_Util_SpatialFunctionsOnFinleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
60 def setUp(self):
61 self.order=1
62 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_order1.fly"),optimize=False)
63 def tearDown(self):
64 del self.order
65 del self.domain
66
67 class Test_Util_SpatialFunctionsOnFinleyTet2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
68 def setUp(self):
69 self.order=2
70 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_order2.fly"),optimize=False)
71 def tearDown(self):
72 del self.order
73 del self.domain
74
75 class Test_Util_SpatialFunctionsOnFinleyTet2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
76 def setUp(self):
77 self.order=1
78 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_macro.fly"),optimize=False)
79 def tearDown(self):
80 del self.order
81 del self.domain
82
83 class Test_Util_SpatialFunctionsOnFinleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
84 def setUp(self):
85 self.order=1
86 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order1.fly"),optimize=False)
87 def tearDown(self):
88 del self.order
89 del self.domain
90
91 class Test_Util_SpatialFunctionsOnFinleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
92 def setUp(self):
93 self.order=2
94 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order2.fly"),optimize=False)
95 def tearDown(self):
96 del self.order
97 del self.domain
98
99 class Test_Util_SpatialFunctionsOnFinleyTet3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
100 def setUp(self):
101 self.order=1
102 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_macro.fly"),optimize=False)
103 def tearDown(self):
104 del self.order
105 del self.domain
106
107 @unittest.skip("Test never added to test list")
108 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
109 def setUp(self):
110 self.order=1
111 self.domain = Rectangle(n0=NE,n1=NE,order=1)
112 def tearDown(self):
113 del self.order
114 del self.domain
115
116 @unittest.skip("Test never added to test list")
117 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
118 def setUp(self):
119 self.order=2
120 self.domain = Rectangle(n0=NE,n1=NE,order=2)
121 def tearDown(self):
122 del self.order
123 del self.domain
124
125 @unittest.skip("Test never added to test list")
126 class Test_Util_SpatialFunctionsOnFinleyHex2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
127 def setUp(self):
128 self.order=1
129 self.domain = Rectangle(n0=NE,n1=NE,order=-1)
130 def tearDown(self):
131 del self.order
132 del self.domain
133
134 @unittest.skip("Test never added to test list")
135 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
136 def setUp(self):
137 self.order=1
138 self.domain = Brick(n0=NE,n1=NE,n2=NE,order=1)
139 def tearDown(self):
140 del self.order
141 del self.domain
142
143 @unittest.skip("Test never added to test list")
144 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
145 def setUp(self):
146 self.order=2
147 self.domain = Brick(n0=NE,n1=NE,n2=NE,order=2)
148 def tearDown(self):
149 del self.order
150 del self.domain
151
152 @unittest.skip("Test never added to test list")
153 class Test_Util_SpatialFunctionsOnFinleyHex3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
154 def setUp(self):
155 self.order=1
156 self.domain = Brick(n0=NE,n1=NE,n2=NE,order=-1)
157 def tearDown(self):
158 del self.order
159 del self.domain
160
161 @unittest.skip("Test never added to test list")
162 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
163 def setUp(self):
164 self.order=1
165 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
166 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1)
167 d2.setX(d2.getX()+[0.5,0.])
168 self.domain = JoinFaces([d1,d2],optimize=False)
169 def tearDown(self):
170 del self.order
171 del self.domain
172
173 @unittest.skip("Test never added to test list")
174 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
175 def setUp(self):
176 self.order=2
177 d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
178 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
179 d2.setX(d2.getX()+[0.5,0.])
180 self.domain = JoinFaces([d1,d2],optimize=False)
181 def tearDown(self):
182 del self.order
183 del self.domain
184
185 @unittest.skip("Test never added to test list")
186 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
187 def setUp(self):
188 self.order=1
189 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
190 d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1)
191 d2.setX(d2.getX()+[0.5,0.,0.])
192 self.domain = JoinFaces([d1,d2],optimize=False)
193 def tearDown(self):
194 del self.order
195 del self.domain
196
197 @unittest.skip("Test never added to test list")
198 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
199 def setUp(self):
200 self.order=2
201 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
202 d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2)
203 d2.setX(d2.getX()+[0.5,0.,0.])
204 self.domain = JoinFaces([d1,d2],optimize=False)
205 def tearDown(self):
206 del self.order
207 del self.domain
208
209 @unittest.skip("Test never added to test list")
210 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFacewithContact(Test_Util_SpatialFunctions):
211 def setUp(self):
212 self.order=1
213 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
214 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
215 d2.setX(d2.getX()+[0.5,0.])
216 self.domain = JoinFaces([d1,d2],optimize=False)
217 def tearDown(self):
218 del self.order
219 del self.domain
220
221 @unittest.skip("Test never added to test list")
222 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFacewithContact(Test_Util_SpatialFunctions):
223 def setUp(self):
224 self.order=2
225 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
226 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
227 d2.setX(d2.getX()+[0.5,0.])
228 self.domain = JoinFaces([d1,d2],optimize=False)
229 def tearDown(self):
230 del self.order
231 del self.domain
232
233 @unittest.skip("Test never added to test list")
234 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFacewithContact(Test_Util_SpatialFunctions):
235 def setUp(self):
236 self.order=1
237 d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
238 d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
239 d2.setX(d2.getX()+[0.5,0.,0.])
240 self.domain = JoinFaces([d1,d2],optimize=False)
241 def tearDown(self):
242 del self.order
243 del self.domain
244
245 @unittest.skip("Test never added to test list")
246 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFacewithContact(Test_Util_SpatialFunctions):
247 def setUp(self):
248 self.order=2
249 d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
250 d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
251 d2.setX(d2.getX()+[0.5,0.,0.])
252 self.domain = JoinFaces([d1,d2],optimize=False)
253 def tearDown(self):
254 del self.order
255 del self.domain
256
257 if __name__ == '__main__':
258 run_tests(__name__, exit_on_failure=True)
259

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26