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

Diff of /trunk/finley/test/python/run_utilOnFinley.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1376 by gross, Wed Jan 9 01:38:18 2008 UTC revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC
# Line 1  Line 1 
1    
2    ########################################################
3  #  #
4  # $Id$  # Copyright (c) 2003-2009 by University of Queensland
5  #  # Earth Systems Science Computational Center (ESSCC)
6  #######################################################  # http://www.uq.edu.au/esscc
 #  
 #           Copyright 2003-2007 by ACceSS MNRF  
 #       Copyright 2007 by University of Queensland  
 #  
 #                http://esscc.uq.edu.au  
 #        Primary Business: Queensland, Australia  
 #  Licensed under the Open Software License version 3.0  
 #     http://www.opensource.org/licenses/osl-3.0.php  
7  #  #
8  #######################################################  # 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  #  #
12    ########################################################
13    
14  __copyright__="""  Copyright (c) 2006 by ACcESS MNRF  __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15                      http://www.access.edu.au  Earth Systems Science Computational Center (ESSCC)
16                  Primary Business: Queensland, Australia"""  http://www.uq.edu.au/esscc
17    Primary Business: Queensland, Australia"""
18  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
19               http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
20    __url__="https://launchpad.net/escript-finley"
21    
22  import unittest  import unittest
23  from test_util import Test_util as Test_util  from test_util import Test_util as Test_util
24  from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary, Test_Util_SpatialFunctions_noGradOnBoundary_noContact  from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary, Test_Util_SpatialFunctions_noGradOnBoundary_noContact
25  from test_symbols import Test_symbols  from test_symbols import Test_symbols
26    
27  from esys.escript import FunctionOnBoundary  from esys.escript import *
28  from esys.finley import Rectangle,Brick,JoinFaces,ReadMesh  from esys.finley import Rectangle,Brick,JoinFaces,ReadMesh
29  import sys  import sys
30  import os  import os
# Line 34  try: Line 34  try:
34  except KeyError:  except KeyError:
35       FINLEY_TEST_DATA='.'       FINLEY_TEST_DATA='.'
36    
37  FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"  FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
38    
39    
40  NE=4 # number elements, must be even  NE=4 # number elements, must be even
# Line 50  class Test_UtilOnFinley(Test_util,Test_s Line 50  class Test_UtilOnFinley(Test_util,Test_s
50  class Test_Util_SpatialFunctionsOnFinleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):  class Test_Util_SpatialFunctionsOnFinleyTet2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
51      def setUp(self):      def setUp(self):
52          self.order=1          self.order=1
53          self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order1.fly",optimize=False)          self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_order1.fly"),optimize=False)
54      def tearDown(self):      def tearDown(self):
55          del self.order          del self.order
56          del self.domain          del self.domain
# Line 58  class Test_Util_SpatialFunctionsOnFinley Line 58  class Test_Util_SpatialFunctionsOnFinley
58  class Test_Util_SpatialFunctionsOnFinleyTet2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):  class Test_Util_SpatialFunctionsOnFinleyTet2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
59      def setUp(self):      def setUp(self):
60          self.order=2          self.order=2
61          self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order2.fly",optimize=False)          self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_2D_order2.fly"),optimize=False)
62        def tearDown(self):
63            del self.order
64            del self.domain
65    
66    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):      def tearDown(self):
71          del self.order          del self.order
72          del self.domain          del self.domain
# Line 66  class Test_Util_SpatialFunctionsOnFinley Line 74  class Test_Util_SpatialFunctionsOnFinley
74  class Test_Util_SpatialFunctionsOnFinleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):  class Test_Util_SpatialFunctionsOnFinleyTet3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
75      def setUp(self):      def setUp(self):
76          self.order=1          self.order=1
77          self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order1.fly",optimize=False)          self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order1.fly"),optimize=False)
78      def tearDown(self):      def tearDown(self):
79          del self.order          del self.order
80          del self.domain          del self.domain
# Line 74  class Test_Util_SpatialFunctionsOnFinley Line 82  class Test_Util_SpatialFunctionsOnFinley
82  class Test_Util_SpatialFunctionsOnFinleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):  class Test_Util_SpatialFunctionsOnFinleyTet3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
83      def setUp(self):      def setUp(self):
84          self.order=2          self.order=2
85          self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order2.fly",optimize=False)          self.domain = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet_3D_order2.fly"),optimize=False)
86      def tearDown(self):      def tearDown(self):
87          del self.order          del self.order
88          del self.domain          del self.domain
89    
90  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):  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    class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
99        def setUp(self):
100            self.order=1
101            self.domain = Rectangle(n0=NE,n1=NE,order=1)
102        def tearDown(self):
103            del self.order
104            del self.domain
105    
106    class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
107        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    class Test_Util_SpatialFunctionsOnFinleyHex2DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
115        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    class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
123        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    class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
131        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    class Test_Util_SpatialFunctionsOnFinleyHex3DMacro(Test_Util_SpatialFunctions_noGradOnBoundary_noContact):
139        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    class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
147      def setUp(self):      def setUp(self):
148          self.order=1          self.order=1
149          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
# Line 90  class Test_Util_SpatialFunctionsOnFinley Line 154  class Test_Util_SpatialFunctionsOnFinley
154          del self.order          del self.order
155          del self.domain          del self.domain
156    
157  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
158      def setUp(self):      def setUp(self):
159          self.order=2          self.order=2
160          d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)          d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
# Line 101  class Test_Util_SpatialFunctionsOnFinley Line 165  class Test_Util_SpatialFunctionsOnFinley
165          del self.order          del self.order
166          del self.domain          del self.domain
167    
168  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
169      def setUp(self):      def setUp(self):
170          self.order=1          self.order=1
171          d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)          d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
# Line 112  class Test_Util_SpatialFunctionsOnFinley Line 176  class Test_Util_SpatialFunctionsOnFinley
176          del self.order          del self.order
177          del self.domain          del self.domain
178    
179  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2withContact(Test_Util_SpatialFunctions_noGradOnBoundary):
180      def setUp(self):      def setUp(self):
181          self.order=2          self.order=2
182          d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)          d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
# Line 123  class Test_Util_SpatialFunctionsOnFinley Line 187  class Test_Util_SpatialFunctionsOnFinley
187          del self.order          del self.order
188          del self.domain          del self.domain
189    
190  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFacewithContact(Test_Util_SpatialFunctions):
191      def setUp(self):      def setUp(self):
192          self.order=1          self.order=1
193          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
# Line 134  class Test_Util_SpatialFunctionsOnFinley Line 198  class Test_Util_SpatialFunctionsOnFinley
198          del self.order          del self.order
199          del self.domain          del self.domain
200    
201  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFacewithContact(Test_Util_SpatialFunctions):
202      def setUp(self):      def setUp(self):
203          self.order=2          self.order=2
204          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
# Line 145  class Test_Util_SpatialFunctionsOnFinley Line 209  class Test_Util_SpatialFunctionsOnFinley
209          del self.order          del self.order
210          del self.domain          del self.domain
211    
212  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFacewithContact(Test_Util_SpatialFunctions):
213      def setUp(self):      def setUp(self):
214          self.order=1          self.order=1
215          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
# Line 156  class Test_Util_SpatialFunctionsOnFinley Line 220  class Test_Util_SpatialFunctionsOnFinley
220          del self.order          del self.order
221          del self.domain          del self.domain
222    
223  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFacewithContact(Test_Util_SpatialFunctions):
224      def setUp(self):      def setUp(self):
225          self.order=2          self.order=2
226          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
# Line 171  if __name__ == '__main__': Line 235  if __name__ == '__main__':
235     suite = unittest.TestSuite()     suite = unittest.TestSuite()
236     if True:     if True:
237        suite.addTest(unittest.makeSuite(Test_UtilOnFinley))        suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1))  
       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2))  
       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1))  
       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2))  
238        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder1))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder1))
239        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder2))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DOrder2))
240          suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet2DMacro))
241        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder1))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder1))
242        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder2))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DOrder2))
243        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFace))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyTet3DMacro))
244        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFace))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1))
245        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFace))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2))
246        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFace))        suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DMacro))
247          suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1))
248          suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2))
249          suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DMacro))
250          # These tests use JoinFaces and are not MPI parallel
251          if getMPISizeWorld() == 1:
252            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1withContact))
253            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2withContact))
254            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1withContact))
255            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2withContact))
256            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder1useElementsOnFacewithContact))
257            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex2DOrder2useElementsOnFacewithContact))
258            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder1useElementsOnFacewithContact))
259            suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinleyHex3DOrder2useElementsOnFacewithContact))
260     else:     else:
261        pass        pass
262     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)

Legend:
Removed from v.1376  
changed lines
  Added in v.2748

  ViewVC Help
Powered by ViewVC 1.1.26