/[escript]/trunk/dudley/test/python/run_utilOnDudley.py
ViewVC logotype

Annotation of /trunk/dudley/test/python/run_utilOnDudley.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2722 - (hide annotations)
Fri Oct 16 06:45:01 2009 UTC (9 years, 6 months ago) by gross
Original Path: trunk/finley/test/python/run_utilOnFinley.py
File MIME type: text/x-python
File size: 8735 byte(s)
First steps towards macro elements. at the monent a  macro element is identical to its counterpart of 2nd order.




1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1809 # 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 jfenwick 2549 __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15 ksteube 1809 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 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
21 ksteube 1809
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 gross 2416 FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
38 gross 855
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 gross 2416 self.domain = ReadMesh(os.path.join(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 gross 2416 self.domain = ReadMesh(os.path.join(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 gross 2722 class Test_Util_SpatialFunctionsOnFinleyTet2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
67     def setUp(self):
68     self.order=1
69     self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_macro.fly"),optimize=False)
70     def tearDown(self):
71     del self.order
72     del self.domain
73    
74 gross 855 class Test_Util_SpatialFunctionsOnFinleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
75     def setUp(self):
76     self.order=1
77 gross 2416 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order1.fly"),optimize=False)
78 gross 855 def tearDown(self):
79     del self.order
80     del self.domain
81    
82     class Test_Util_SpatialFunctionsOnFinleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
83     def setUp(self):
84     self.order=2
85 gross 2416 self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order2.fly"),optimize=False)
86 gross 855 def tearDown(self):
87     del self.order
88     del self.domain
89    
90 gross 2722 class Test_Util_SpatialFunctionsOnFinleyTet3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
91     def setUp(self):
92     self.order=1
93     self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_macro.fly"),optimize=False)
94     def tearDown(self):
95     del self.order
96     del self.domain
97    
98 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
99     def setUp(self):
100     self.order=1
101 gross 777 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
102     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1)
103 gross 437 d2.setX(d2.getX()+[0.5,0.])
104 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
105 gross 798 def tearDown(self):
106     del self.order
107     del self.domain
108 gross 437
109 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
110 gross 437 def setUp(self):
111     self.order=2
112 gross 777 d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
113     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
114 gross 437 d2.setX(d2.getX()+[0.5,0.])
115 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
116 gross 798 def tearDown(self):
117     del self.order
118     del self.domain
119 gross 437
120 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
121 gross 437 def setUp(self):
122     self.order=1
123 gross 777 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
124     d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1)
125 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
126 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
127 gross 798 def tearDown(self):
128     del self.order
129     del self.domain
130 gross 437
131 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
132 gross 437 def setUp(self):
133     self.order=2
134 gross 777 d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
135     d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2)
136 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
137 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
138 gross 798 def tearDown(self):
139     del self.order
140     del self.domain
141 gross 437
142 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
143 gross 777 def setUp(self):
144     self.order=1
145     d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
146     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
147     d2.setX(d2.getX()+[0.5,0.])
148 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
149 gross 798 def tearDown(self):
150     del self.order
151     del self.domain
152 gross 777
153 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
154 gross 777 def setUp(self):
155     self.order=2
156     d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
157     d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
158     d2.setX(d2.getX()+[0.5,0.])
159 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
160 gross 798 def tearDown(self):
161     del self.order
162     del self.domain
163 gross 777
164 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
165 gross 777 def setUp(self):
166     self.order=1
167     d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
168     d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
169     d2.setX(d2.getX()+[0.5,0.,0.])
170 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
171 gross 798 def tearDown(self):
172     del self.order
173     del self.domain
174 gross 777
175 gross 855 class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
176 gross 777 def setUp(self):
177     self.order=2
178     d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
179     d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
180     d2.setX(d2.getX()+[0.5,0.,0.])
181 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
182 gross 798 def tearDown(self):
183     del self.order
184     del self.domain
185 gross 777
186 jgs 153 if __name__ == '__main__':
187     suite = unittest.TestSuite()
188 gross 857 if True:
189     suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
190     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder1))
191     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder2))
192 gross 2722 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DMacro))
193 gross 859 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder1))
194     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder2))
195 gross 2722 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DMacro))
196 ksteube 1830 # These tests use JoinFaces and are not MPI parallel
197     if getMPISizeWorld() == 1:
198     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1))
199     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2))
200     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1))
201     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2))
202     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace))
203     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace))
204     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace))
205     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace))
206 gross 857 else:
207 gross 859 pass
208 jgs 153 s=unittest.TextTestRunner(verbosity=2).run(suite)
209 gross 1376 if not s.wasSuccessful(): sys.exit(1)
210    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26