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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 815 - (show annotations)
Wed Aug 23 09:31:50 2006 UTC (12 years, 9 months ago) by gross
File MIME type: text/x-python
File size: 5387 byte(s)
ops! wrong file has been sent
1 # $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
9 from test_util import Test_util as Test_util
10 from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary
11 from test_symbols import Test_symbols
12
13 from esys.escript import FunctionOnBoundary
14 from esys.finley import Rectangle,Brick,JoinFaces
15 import sys
16
17 NE=4 # number elements, must be even
18
19 class Test_UtilOnFinley(Test_util,Test_symbols):
20 def setUp(self):
21 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
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_SpatialFunctionsOnFinley2DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
72 def setUp(self):
73 self.order=1
74 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
75 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=1,useElementsOnFace=True)
76 d2.setX(d2.getX()+[0.5,0.])
77 self.domain = JoinFaces([d1,d2])
78 def tearDown(self):
79 del self.order
80 del self.domain
81
82 class Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
83 def setUp(self):
84 self.order=2
85 d1 = Rectangle(n0=NE/2+1,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
86 d2 = Rectangle(n0=NE/2,n1=NE,l0=0.5,order=2,useElementsOnFace=True)
87 d2.setX(d2.getX()+[0.5,0.])
88 self.domain = JoinFaces([d1,d2])
89 def tearDown(self):
90 del self.order
91 del self.domain
92
93 class Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace(Test_Util_SpatialFunctions):
94 def setUp(self):
95 self.order=1
96 d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
97 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.])
99 self.domain = JoinFaces([d1,d2])
100 def tearDown(self):
101 del self.order
102 del self.domain
103
104 class Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace(Test_Util_SpatialFunctions):
105 def setUp(self):
106 self.order=2
107 d1 = Brick(n0=NE/2,n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
108 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.])
110 self.domain = JoinFaces([d1,d2])
111 def tearDown(self):
112 del self.order
113 del self.domain
114
115 if __name__ == '__main__':
116 suite = unittest.TestSuite()
117 # suite.addTest(Test_UtilOnFinley("test_generalTensorTransposedProduct_Symbol_rank1_taggedData_rank3_offset1"))
118 suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
119 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1))
120 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))
121 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))
122 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))
123 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1useElementsOnFace))
124 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2useElementsOnFace))
125 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1useElementsOnFace))
126 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2useElementsOnFace))
127 s=unittest.TextTestRunner(verbosity=2).run(suite)
128 if s.wasSuccessful():
129 sys.exit(0)
130 else:
131 sys.exit(1)
132

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26