/[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 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 9 months ago) by trankine
Original Path: temp/finley/test/python/run_utilOnFinley.py
File MIME type: text/x-python
File size: 7714 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1 ksteube 1312 #
2 jgs 153 # $Id$
3 ksteube 1312 #
4     #######################################################
5     #
6     # Copyright 2003-2007 by ACceSS MNRF
7     # Copyright 2007 by University of Queensland
8     #
9     # http://esscc.uq.edu.au
10     # Primary Business: Queensland, Australia
11     # Licensed under the Open Software License version 3.0
12     # http://www.opensource.org/licenses/osl-3.0.php
13     #
14     #######################################################
15     #
16 jgs 153
17 elspeth 617 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
18     http://www.access.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 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 1312 from esys.escript import FunctionOnBoundary
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_SpatialFunctionsOnFinleyHex2DOrder1))
175     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2))
176     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1))
177     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2))
178     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder1))
179     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder2))
180 gross 859 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder1))
181     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder2))
182 gross 857 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace))
183     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace))
184     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace))
185     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace))
186     else:
187 gross 859 pass
188 jgs 153 s=unittest.TextTestRunner(verbosity=2).run(suite)
189 gross 1376 if not s.wasSuccessful(): sys.exit(1)
190    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26