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

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

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

trunk/finley/test/python/test_linearPDEsOnFinley.py revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC trunk/finley/test/python/run_linearPDEsOnFinley.py revision 798 by gross, Fri Aug 4 01:05:36 2006 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  """  """
4  Test suite for the linearPDE test on finley  Test suite for the linearPDE  and pdetools test on finley
5    
6  @remark:  @remark:
7    
# Line 12  Test suite for the linearPDE test on fin Line 12  Test suite for the linearPDE test on fin
12  @var __date__: date of the version  @var __date__: date of the version
13  """  """
14    
15    __copyright__="""  Copyright (c) 2006 by ACcESS MNRF
16                        http://www.access.edu.au
17                    Primary Business: Queensland, Australia"""
18    __license__="""Licensed under the Open Software License version 3.0
19                 http://www.opensource.org/licenses/osl-3.0.php"""
20  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
 __licence__="contact: esys@access.uq.edu.au"  
21  __url__="http://www.iservo.edu.au/esys/escript"  __url__="http://www.iservo.edu.au/esys/escript"
22  __version__="$Revision$"  __version__="$Revision$"
23  __date__="$Date$"  __date__="$Date$"
24    
25    
26  import unittest  import unittest
27  from esys.escript.test_linearPDEs import Test_Poisson,Test_LinearPDE  from test_linearPDEs import Test_Poisson,Test_LinearPDE
28  from esys.finley import Rectangle,Brick  from test_assemblage import Test_assemblage_2Do1, Test_assemblage_2Do2, Test_assemblage_3Do1, Test_assemblage_3Do2, \
29                                Test_assemblage_2Do1_Contact,Test_assemblage_2Do2_Contact, Test_assemblage_3Do1_Contact, Test_assemblage_3Do2_Contact
30    from test_pdetools import Test_pdetools
31    from esys.escript import *
32    from esys.finley import Rectangle,Brick,JoinFaces
33  import sys  import sys
34    
35  class Test_LinearPDEOnFinley2DOrder1(Test_LinearPDE):  
36      def setUp(self):  NE=6 # number of element in each spatial direction (must be even)
37          self.domain = Rectangle(50,50,1)  
38    class Test_LinearPDEOnFinley2DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1):
39  class Test_LinearPDEOnFinley2DOrder2(Test_LinearPDE):     RES_TOL=1.e-7
40      def setUp(self):     ABS_TOL=1.e-8
41          self.domain = Rectangle(50,50,2)     def setUp(self):
42            self.domain = Rectangle(NE,NE,1)
43  class Test_LinearPDEOnFinley3DOrder1(Test_LinearPDE):     def tearDown(self):
44      def setUp(self):          del self.domain
45          self.domain = Brick(20,10,10,1)  
46    class Test_LinearPDEOnFinley2DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do2):
47  class Test_LinearPDEOnFinley3DOrder2(Test_LinearPDE):     RES_TOL=1.e-7
48      def setUp(self):     ABS_TOL=1.e-8
49          self.domain = Brick(10,10,20,2)     def setUp(self):
50            self.domain = Rectangle(NE,NE,2)
51       def tearDown(self):
52            del self.domain
53    
54    class Test_LinearPDEOnFinley3DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1):
55       RES_TOL=1.e-7
56       ABS_TOL=1.e-8
57       def setUp(self):
58            self.domain = Brick(NE,NE,NE,1)
59    
60    class Test_LinearPDEOnFinley3DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do2):
61       RES_TOL=1.e-7
62       ABS_TOL=1.e-8
63       def setUp(self):
64            self.domain = Brick(NE,NE,NE,2)
65       def tearDown(self):
66            del self.domain
67    
68  class Test_PoissonOnFinley(Test_Poisson):  class Test_PoissonOnFinley(Test_Poisson):
69      def setUp(self):     RES_TOL=1.e-7
70          self.domain = Rectangle(20,10,2)     ABS_TOL=1.e-8
71       def setUp(self):
72            self.domain = Rectangle(NE,NE,2)
73       def tearDown(self):
74            del self.domain
75    
76    
77    class Test_AssemblePDEwithFinley_2Do1_Contact(Test_assemblage_2Do1_Contact):
78       RES_TOL=1.e-7
79       ABS_TOL=1.e-8
80       def setUp(self):
81           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
82           x1 = ContinuousFunction(d1).getX()
83           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
84           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
85           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
86           d2.setX(d2.getX()+[0.5,0.])
87           self.domain = JoinFaces([d1,d2])
88       def tearDown(self):
89            del self.domain
90    
91    class Test_AssemblePDEwithFinley_2Do2_Contact(Test_assemblage_2Do2_Contact):
92       RES_TOL=1.e-7
93       ABS_TOL=1.e-8
94       def setUp(self):
95           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
96           x1 = ContinuousFunction(d1).getX()
97           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
98           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
99           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
100           d2.setX(d2.getX()+[0.5,0.])
101           self.domain = JoinFaces([d1,d2])
102       def tearDown(self):
103            del self.domain
104    
105    class Test_AssemblePDEwithFinley_3Do1_Contact(Test_assemblage_3Do1_Contact):
106       RES_TOL=1.e-7
107       ABS_TOL=1.e-8
108       def setUp(self):
109           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
110           x1 = ContinuousFunction(d1).getX()
111           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
112           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
113           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
114           d2.setX(d2.getX()+[0.5,0.,0.])
115           self.domain = JoinFaces([d1,d2])
116       def tearDown(self):
117            del self.domain
118    
119    class Test_AssemblePDEwithFinley_3Do2_Contact(Test_assemblage_3Do2_Contact):
120       RES_TOL=1.e-7
121       ABS_TOL=1.e-8
122       def setUp(self):
123           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
124           x1 = ContinuousFunction(d1).getX()
125           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
126           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
127           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
128           d2.setX(d2.getX()+[0.5,0.,0.])
129           self.domain = JoinFaces([d1,d2])
130       def tearDown(self):
131            del self.domain
132    
133    
134    class Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace(Test_assemblage_2Do1_Contact):
135       RES_TOL=1.e-7
136       ABS_TOL=1.e-8
137       def setUp(self):
138           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
139           x1 = ContinuousFunction(d1).getX()
140           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
141           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
142           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
143           d2.setX(d2.getX()+[0.5,0.])
144           self.domain = JoinFaces([d1,d2])
145       def tearDown(self):
146            del self.domain
147    
148    class Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace(Test_assemblage_2Do2_Contact):
149       RES_TOL=1.e-7
150       ABS_TOL=1.e-8
151       def setUp(self):
152           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
153           x1 = ContinuousFunction(d1).getX()
154           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
155           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
156           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
157           d2.setX(d2.getX()+[0.5,0.])
158           self.domain = JoinFaces([d1,d2])
159       def tearDown(self):
160            del self.domain
161    
162    class Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace(Test_assemblage_3Do1_Contact):
163       RES_TOL=1.e-7
164       ABS_TOL=1.e-8
165       def setUp(self):
166           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
167           x1 = ContinuousFunction(d1).getX()
168           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
169           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
170           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
171           d2.setX(d2.getX()+[0.5,0.,0.])
172           self.domain = JoinFaces([d1,d2])
173       def tearDown(self):
174            del self.domain
175    
176    class Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace(Test_assemblage_3Do2_Contact):
177       RES_TOL=1.e-7
178       ABS_TOL=1.e-8
179       def setUp(self):
180           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
181           x1 = ContinuousFunction(d1).getX()
182           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
183           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
184           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
185           d2.setX(d2.getX()+[0.5,0.,0.])
186           self.domain = JoinFaces([d1,d2])
187       def tearDown(self):
188            del self.domain
189    
190  if __name__ == '__main__':  if __name__ == '__main__':
191     suite = unittest.TestSuite()     suite = unittest.TestSuite()
# Line 50  if __name__ == '__main__': Line 193  if __name__ == '__main__':
193     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder2))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder2))
194     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder1))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder1))
195     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder2))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder2))
196     suite.addTest(unittest.makeSuite(Test_PoissonOnFinley))  
197       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))
198       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))
199       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))
200       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))
201       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))
202       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))
203       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))
204       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))
205     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
206     if s.wasSuccessful():     if s.wasSuccessful():
207       sys.exit(0)       sys.exit(0)

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

  ViewVC Help
Powered by ViewVC 1.1.26