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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26