/[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 3090 - (hide annotations)
Wed Aug 11 00:51:28 2010 UTC (8 years, 8 months ago) by jfenwick
Original Path: branches/domexper/dudley/test/python/run_utilOnDudley.py
File MIME type: text/x-python
File size: 6490 byte(s)
Removed:
DUDLEY_CONTACT_ELEMENTS_1
DUDLEY_CONTACT_ELEMENTS_2
DUDLEY_REDUCED_CONTACT_ELEMENTS_1
DUDLEY_REDUCED_CONTACT_ELEMENTS_2

escript tests now query if the domain supports contact elements
before trying to use them.


1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 jfenwick 2881 # Copyright (c) 2003-2010 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 2881 __copyright__="""Copyright (c) 2003-2010 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 jfenwick 3090 from test_util import Test_Util_SpatialFunctions, 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 jfenwick 3085 from esys.dudley import Rectangle,Brick,JoinFaces,ReadMesh
29 jgs 153 import sys
30 gross 855 import os
31 jgs 153
32 gross 855 try:
33 jfenwick 3085 DUDLEY_TEST_DATA=os.environ['DUDLEY_TEST_DATA']
34 gross 855 except KeyError:
35 jfenwick 3085 DUDLEY_TEST_DATA='.'
36 gross 855
37 jfenwick 3085 DUDLEY_TEST_MESH_PATH=os.path.join(DUDLEY_TEST_DATA,"data_meshes")
38 gross 855
39    
40 gross 777 NE=4 # number elements, must be even
41    
42 jfenwick 3087 class Test_UtilOnDudley(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 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
51 gross 437 def setUp(self):
52     self.order=1
53 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_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 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
59 gross 855 def setUp(self):
60     self.order=2
61 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_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 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
67 gross 2722 def setUp(self):
68     self.order=1
69 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_TEST_MESH_PATH,"tet_2D_macro.fly"),optimize=False)
70 gross 2722 def tearDown(self):
71     del self.order
72     del self.domain
73    
74 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
75 gross 855 def setUp(self):
76     self.order=1
77 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_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 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
83 gross 855 def setUp(self):
84     self.order=2
85 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_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 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyTet3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
91 gross 2722 def setUp(self):
92     self.order=1
93 jfenwick 3085 self.domain = ReadMesh(os.path.join(DUDLEY_TEST_MESH_PATH,"tet_3D_macro.fly"),optimize=False)
94 gross 2722 def tearDown(self):
95     del self.order
96     del self.domain
97    
98 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
99 gross 855 def setUp(self):
100     self.order=1
101 gross 2748 self.domain = Rectangle(n0=NE,n1=NE,order=1)
102     def tearDown(self):
103     del self.order
104     del self.domain
105    
106 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
107 gross 2748 def setUp(self):
108     self.order=2
109     self.domain = Rectangle(n0=NE,n1=NE,order=2)
110     def tearDown(self):
111     del self.order
112     del self.domain
113    
114 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
115 gross 2748 def setUp(self):
116     self.order=1
117     self.domain = Rectangle(n0=NE,n1=NE,order=-1)
118     def tearDown(self):
119     del self.order
120     del self.domain
121    
122 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
123 gross 2748 def setUp(self):
124     self.order=1
125     self.domain = Brick(n0=NE,n1=NE,n2=NE,order=1)
126     def tearDown(self):
127     del self.order
128     del self.domain
129    
130 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
131 gross 2748 def setUp(self):
132     self.order=2
133     self.domain = Brick(n0=NE,n1=NE,n2=NE,order=2)
134     def tearDown(self):
135     del self.order
136     del self.domain
137    
138 jfenwick 3087 class Test_Util_SpatialFunctionsOnDudleyHex3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
139 gross 2748 def setUp(self):
140     self.order=1
141     self.domain = Brick(n0=NE,n1=NE,n2=NE,order=-1)
142     def tearDown(self):
143     del self.order
144     del self.domain
145    
146 gross 437
147    
148 jgs 153 if __name__ == '__main__':
149     suite = unittest.TestSuite()
150 gross 857 if True:
151 jfenwick 3087 suite.addTest(unittest.makeSuite(Test_UtilOnDudley))
152     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet2DOrder1))
153     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet2DOrder2))
154     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet2DMacro))
155     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet3DOrder1))
156     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet3DOrder2))
157     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyTet3DMacro))
158     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex2DOrder1))
159     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex2DOrder2))
160     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex2DMacro))
161     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex3DOrder1))
162     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex3DOrder2))
163     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnDudleyHex3DMacro))
164 gross 857 else:
165 gross 859 pass
166 jgs 153 s=unittest.TextTestRunner(verbosity=2).run(suite)
167 gross 1376 if not s.wasSuccessful(): sys.exit(1)
168    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/finley/test/python/run_utilOnFinley.py:2682-2741 /branches/restext/finley/test/python/run_utilOnFinley.py:2610-2624 /branches/stage3.0/finley/test/python/run_utilOnFinley.py:2569-2590 /release/3.0/finley/test/python/run_utilOnFinley.py:2591-2601

  ViewVC Help
Powered by ViewVC 1.1.26