/[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

trunk/finley/test/python/test_utilOnFinley.py revision 589 by gross, Fri Mar 10 06:28:35 2006 UTC trunk/finley/test/python/run_utilOnFinley.py revision 798 by gross, Fri Aug 4 01:05:36 2006 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3    __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  import unittest  import unittest
9  # from esys.escript.test_util import Test_util_no_tagged_data as Test_util  from test_util import Test_util as Test_util
10  from esys.escript.test_util import Test_util_with_tagged_data as Test_util  from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary
11  #from esys.escript.test_util import Test_util as Test_util  from test_symbols import Test_symbols
 from esys.escript.test_util import Test_Util_SpatialFunctions  
 from esys.escript.test_symbols import Test_symbols  
12    
13  from esys.escript import FunctionOnBoundary  from esys.escript import FunctionOnBoundary
14  from esys.finley import Rectangle,Brick,JoinFaces  from esys.finley import Rectangle,Brick,JoinFaces
15  import sys  import sys
16    
17    NE=4 # number elements, must be even
18    
19  class Test_UtilOnFinley(Test_util,Test_symbols):  class Test_UtilOnFinley(Test_util,Test_symbols):
20     def setUp(self):     def setUp(self):
21         self.domain =Rectangle(10,10,2)         self.domain =Rectangle(NE,NE+1,2)
22         self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain         self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain
23       def tearDown(self):
24           del self.functionspace
25           del self.domain
26    
27    class Test_Util_SpatialFunctionsOnFinley2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
28        def setUp(self):
29            self.order=1
30            d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
31            d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1)
32            d2.setX(d2.getX()+[0.5,0.])
33            self.domain = JoinFaces([d1,d2])
34        def tearDown(self):
35            del self.order
36            del self.domain
37    
38    class Test_Util_SpatialFunctionsOnFinley2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
39        def setUp(self):
40            self.order=2
41            d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
42            d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
43            d2.setX(d2.getX()+[0.5,0.])
44            self.domain = JoinFaces([d1,d2])
45        def tearDown(self):
46            del self.order
47            del self.domain
48    
49    class Test_Util_SpatialFunctionsOnFinley3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
50        def setUp(self):
51            self.order=1
52            d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
53            d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1)
54            d2.setX(d2.getX()+[0.5,0.,0.])
55            self.domain = JoinFaces([d1,d2])
56        def tearDown(self):
57            del self.order
58            del self.domain
59    
60    class Test_Util_SpatialFunctionsOnFinley3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
61        def setUp(self):
62            self.order=2
63            d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
64            d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2)
65            d2.setX(d2.getX()+[0.5,0.,0.])
66            self.domain = JoinFaces([d1,d2])
67        def tearDown(self):
68            del self.order
69            del self.domain
70    
71  class Test_Util_SpatialFunctionsOnFinley2DOrder1(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
72      def setUp(self):      def setUp(self):
73          self.order=1          self.order=1
74          d1 = Rectangle(n0=6,n1=12,l0=0.5,order=1,useElementsOnFace=True)          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
75          d2 = Rectangle(n0=6,n1=12,l0=0.5,order=1,useElementsOnFace=True)          d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
76          d2.setX(d2.getX()+[0.5,0.])          d2.setX(d2.getX()+[0.5,0.])
77          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
78        def tearDown(self):
79            del self.order
80            del self.domain
81    
82  class Test_Util_SpatialFunctionsOnFinley2DOrder2(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
83      def setUp(self):      def setUp(self):
84          self.order=2          self.order=2
85          d1 = Rectangle(n0=3,n1=6,l0=0.5,order=2,useElementsOnFace=True)          d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
86          d2 = Rectangle(n0=3,n1=6,l0=0.5,order=2,useElementsOnFace=True)          d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
87          d2.setX(d2.getX()+[0.5,0.])          d2.setX(d2.getX()+[0.5,0.])
88          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
89        def tearDown(self):
90            del self.order
91            del self.domain
92    
93  class Test_Util_SpatialFunctionsOnFinley3DOrder1(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
94      def setUp(self):      def setUp(self):
95          self.order=1          self.order=1
96          d1 = Brick(n0=6,n1=12,n2=12,l0=0.5,order=1,useElementsOnFace=True)          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
97          d2 = Brick(n0=6,n1=12,n2=12,l0=0.5,order=1,useElementsOnFace=True)          d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
98          d2.setX(d2.getX()+[0.5,0.,0.])          d2.setX(d2.getX()+[0.5,0.,0.])
99          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
100        def tearDown(self):
101            del self.order
102            del self.domain
103    
104  class Test_Util_SpatialFunctionsOnFinley3DOrder2(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
105      def setUp(self):      def setUp(self):
106          self.order=2          self.order=2
107          d1 = Brick(n0=3,n1=6,n2=6,l0=0.5,order=2,useElementsOnFace=True)          d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
108          d2 = Brick(n0=3,n1=6,n2=6,l0=0.5,order=2,useElementsOnFace=True)          d2 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
109          d2.setX(d2.getX()+[0.5,0.,0.])          d2.setX(d2.getX()+[0.5,0.,0.])
110          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
111        def tearDown(self):
112            del self.order
113            del self.domain
114    
115  if __name__ == '__main__':  if __name__ == '__main__':
116     suite = unittest.TestSuite()     suite = unittest.TestSuite()
117     suite.addTest(unittest.makeSuite(Test_UtilOnFinley))     suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
118     # suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1))
119     # suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))
120     # suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))
121     # suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))
122       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1useElementsOnFace))
123       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace))
124       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace))
125       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace))
126     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
127     if s.wasSuccessful():     if s.wasSuccessful():
128       sys.exit(0)       sys.exit(0)

Legend:
Removed from v.589  
changed lines
  Added in v.798

  ViewVC Help
Powered by ViewVC 1.1.26