/[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 526 by gross, Tue Feb 14 06:56:33 2006 UTC trunk/finley/test/python/run_utilOnFinley.py revision 777 by gross, Wed Jul 12 08:54:45 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_SpatialFunctions  from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary
11  from esys.escript.test_symbols import Test_symbols  from 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    
24  class Test_Util_SpatialFunctionsOnFinley2DOrder1(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
25        def setUp(self):
26            self.order=1
27            d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1)
28            d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1)
29            d2.setX(d2.getX()+[0.5,0.])
30            self.domain = JoinFaces([d1,d2])
31    
32    class Test_Util_SpatialFunctionsOnFinley2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
33        def setUp(self):
34            self.order=2
35            d1 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
36            d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2)
37            d2.setX(d2.getX()+[0.5,0.])
38            self.domain = JoinFaces([d1,d2])
39    
40    class Test_Util_SpatialFunctionsOnFinley3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
41        def setUp(self):
42            self.order=1
43            d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=1)
44            d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1)
45            d2.setX(d2.getX()+[0.5,0.,0.])
46            self.domain = JoinFaces([d1,d2])
47    
48    class Test_Util_SpatialFunctionsOnFinley3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
49        def setUp(self):
50            self.order=2
51            d1 = Brick(n0=NE/2+1,n1=NE,n2=NE,l0=0.5,order=2)
52            d2 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2)
53            d2.setX(d2.getX()+[0.5,0.,0.])
54            self.domain = JoinFaces([d1,d2])
55    
56    class Test_Util_SpatialFunctionsOnFinley2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
57      def setUp(self):      def setUp(self):
58          self.order=1          self.order=1
59          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)
60          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)
61          d2.setX(d2.getX()+[0.5,0.])          d2.setX(d2.getX()+[0.5,0.])
62          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
63    
64  class Test_Util_SpatialFunctionsOnFinley2DOrder2(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
65      def setUp(self):      def setUp(self):
66          self.order=2          self.order=2
67          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)
68          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)
69          d2.setX(d2.getX()+[0.5,0.])          d2.setX(d2.getX()+[0.5,0.])
70          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
71    
72  class Test_Util_SpatialFunctionsOnFinley3DOrder1(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
73      def setUp(self):      def setUp(self):
74          self.order=1          self.order=1
75          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)
76          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)
77          d2.setX(d2.getX()+[0.5,0.,0.])          d2.setX(d2.getX()+[0.5,0.,0.])
78          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
79    
80  class Test_Util_SpatialFunctionsOnFinley3DOrder2(Test_Util_SpatialFunctions):  class Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
81      def setUp(self):      def setUp(self):
82          self.order=2          self.order=2
83          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)
84          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)
85          d2.setX(d2.getX()+[0.5,0.,0.])          d2.setX(d2.getX()+[0.5,0.,0.])
86          self.domain = JoinFaces([d1,d2])          self.domain = JoinFaces([d1,d2])
87    
# Line 53  if __name__ == '__main__': Line 92  if __name__ == '__main__':
92     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))
93     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))
94     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))
95       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1useElementsOnFace))
96       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace))
97       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace))
98       suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace))
99     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
100     if s.wasSuccessful():     if s.wasSuccessful():
101       sys.exit(0)       sys.exit(0)

Legend:
Removed from v.526  
changed lines
  Added in v.777

  ViewVC Help
Powered by ViewVC 1.1.26