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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 798 - (hide annotations)
Fri Aug 4 01:05:36 2006 UTC (13 years, 2 months ago) by gross
File MIME type: text/x-python
File size: 5272 byte(s)
Reimplementation of the assemblage with persistent jacobeans.
There are also a few changes to the tests which has now
dramatically reduced the memory demand.


1 jgs 153 # $Id$
2    
3 elspeth 617 __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 jgs 153 import unittest
9 gross 707 from test_util import Test_util as Test_util
10 gross 777 from test_util import Test_Util_SpatialFunctions, Test_Util_SpatialFunctions_noGradOnBoundary
11 gross 707 from test_symbols import Test_symbols
12 gross 526
13 jgs 153 from esys.escript import FunctionOnBoundary
14 gross 437 from esys.finley import Rectangle,Brick,JoinFaces
15 jgs 153 import sys
16    
17 gross 777 NE=4 # number elements, must be even
18    
19 gross 526 class Test_UtilOnFinley(Test_util,Test_symbols):
20 jgs 153 def setUp(self):
21 gross 777 self.domain =Rectangle(NE,NE+1,2)
22 gross 442 self.functionspace = FunctionOnBoundary(self.domain) # due to a bug in escript python needs to hold a reference to the domain
23 gross 798 def tearDown(self):
24     del self.functionspace
25     del self.domain
26 jgs 153
27 gross 777 class Test_Util_SpatialFunctionsOnFinley2DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
28 gross 437 def setUp(self):
29     self.order=1
30 gross 777 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 gross 437 d2.setX(d2.getX()+[0.5,0.])
33     self.domain = JoinFaces([d1,d2])
34 gross 798 def tearDown(self):
35     del self.order
36     del self.domain
37 gross 437
38 gross 777 class Test_Util_SpatialFunctionsOnFinley2DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
39 gross 437 def setUp(self):
40     self.order=2
41 gross 777 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 gross 437 d2.setX(d2.getX()+[0.5,0.])
44     self.domain = JoinFaces([d1,d2])
45 gross 798 def tearDown(self):
46     del self.order
47     del self.domain
48 gross 437
49 gross 777 class Test_Util_SpatialFunctionsOnFinley3DOrder1(Test_Util_SpatialFunctions_noGradOnBoundary):
50 gross 437 def setUp(self):
51     self.order=1
52 gross 777 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 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
55     self.domain = JoinFaces([d1,d2])
56 gross 798 def tearDown(self):
57     del self.order
58     del self.domain
59 gross 437
60 gross 777 class Test_Util_SpatialFunctionsOnFinley3DOrder2(Test_Util_SpatialFunctions_noGradOnBoundary):
61 gross 437 def setUp(self):
62     self.order=2
63 gross 777 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 gross 437 d2.setX(d2.getX()+[0.5,0.,0.])
66     self.domain = JoinFaces([d1,d2])
67 gross 798 def tearDown(self):
68     del self.order
69     del self.domain
70 gross 437
71 gross 777 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 gross 798 def tearDown(self):
79     del self.order
80     del self.domain
81 gross 777
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 gross 798 def tearDown(self):
90     del self.order
91     del self.domain
92 gross 777
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 gross 798 def tearDown(self):
101     del self.order
102     del self.domain
103 gross 777
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 gross 798 def tearDown(self):
112     del self.order
113     del self.domain
114 gross 777
115 jgs 153 if __name__ == '__main__':
116     suite = unittest.TestSuite()
117     suite.addTest(unittest.makeSuite(Test_UtilOnFinley))
118 gross 698 suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder1))
119     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley2DOrder2))
120     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder1))
121     suite.addTest(unittest.makeSuite(Test_Util_SpatialFunctionsOnFinley3DOrder2))
122 gross 777 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 jgs 153 s=unittest.TextTestRunner(verbosity=2).run(suite)
127     if s.wasSuccessful():
128     sys.exit(0)
129     else:
130     sys.exit(1)
131    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26