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

revision 714 by elspeth, Thu Apr 27 05:42:33 2006 UTC revision 773 by gross, Fri Jul 7 10:10:00 2006 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
3  """  """
4  Test suite for the linearPDE iand pdetools test on finley  Test suite for the linearPDE  and pdetools test on finley
5    
6  @remark:  @remark:
7    
# Line 25  __date__="$Date$" Line 25  __date__="$Date$"
25    
26  import unittest  import unittest
27  from test_linearPDEs import Test_Poisson,Test_LinearPDE  from test_linearPDEs import Test_Poisson,Test_LinearPDE
28    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  from test_pdetools import Test_pdetools
31  from esys.finley import Rectangle,Brick  from esys.escript import *
32    from esys.finley import Rectangle,Brick,JoinFaces
33  import sys  import sys
34    
35  class Test_LinearPDEOnFinley2DOrder1(Test_LinearPDE,Test_pdetools):  
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,Test_pdetools):     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,Test_pdetools):  
44      def setUp(self):  class Test_LinearPDEOnFinley2DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do2):
45          self.domain = Brick(20,10,10,1)     RES_TOL=1.e-7
46       ABS_TOL=1.e-8
47  class Test_LinearPDEOnFinley3DOrder2(Test_LinearPDE,Test_pdetools):     def setUp(self):
48      def setUp(self):          self.domain = Rectangle(NE,NE,2)
49          self.domain = Brick(10,10,20,2)  
50    class Test_LinearPDEOnFinley3DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1):
51       RES_TOL=1.e-7
52       ABS_TOL=1.e-8
53       def setUp(self):
54            self.domain = Brick(NE,NE,NE,1)
55    
56    class Test_LinearPDEOnFinley3DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do2):
57       RES_TOL=1.e-7
58       ABS_TOL=1.e-8
59       def setUp(self):
60            self.domain = Brick(NE,NE,NE,2)
61    
62  class Test_PoissonOnFinley(Test_Poisson):  class Test_PoissonOnFinley(Test_Poisson):
63      def setUp(self):     RES_TOL=1.e-7
64          self.domain = Rectangle(20,10,2)     ABS_TOL=1.e-8
65       def setUp(self):
66            self.domain = Rectangle(NE,NE,2)
67    
68    
69    class Test_AssemblePDEwithFinley_2Do1_Contact(Test_assemblage_2Do1_Contact):
70       RES_TOL=1.e-7
71       ABS_TOL=1.e-8
72       def setUp(self):
73           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
74           x1 = ContinuousFunction(d1).getX()
75           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
76           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
77           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
78           d2.setX(d2.getX()+[0.5,0.])
79           self.domain = JoinFaces([d1,d2])
80    
81    class Test_AssemblePDEwithFinley_2Do2_Contact(Test_assemblage_2Do2_Contact):
82       RES_TOL=1.e-7
83       ABS_TOL=1.e-8
84       def setUp(self):
85           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
86           x1 = ContinuousFunction(d1).getX()
87           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
88           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
89           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
90           d2.setX(d2.getX()+[0.5,0.])
91           self.domain = JoinFaces([d1,d2])
92    
93    class Test_AssemblePDEwithFinley_3Do1_Contact(Test_assemblage_3Do1_Contact):
94       RES_TOL=1.e-7
95       ABS_TOL=1.e-8
96       def setUp(self):
97           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
98           x1 = ContinuousFunction(d1).getX()
99           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
100           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
101           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
102           d2.setX(d2.getX()+[0.5,0.,0.])
103           self.domain = JoinFaces([d1,d2])
104    
105    class Test_AssemblePDEwithFinley_3Do2_Contact(Test_assemblage_3Do2_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=2)
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=2)
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    
117    
118    class Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace(Test_assemblage_2Do1_Contact):
119       RES_TOL=1.e-7
120       ABS_TOL=1.e-8
121       def setUp(self):
122           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
123           x1 = ContinuousFunction(d1).getX()
124           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
125           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
126           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
127           d2.setX(d2.getX()+[0.5,0.])
128           self.domain = JoinFaces([d1,d2])
129    
130    class Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace(Test_assemblage_2Do2_Contact):
131       RES_TOL=1.e-7
132       ABS_TOL=1.e-8
133       def setUp(self):
134           d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
135           x1 = ContinuousFunction(d1).getX()
136           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
137           d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
138           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
139           d2.setX(d2.getX()+[0.5,0.])
140           self.domain = JoinFaces([d1,d2])
141    
142    class Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace(Test_assemblage_3Do1_Contact):
143       RES_TOL=1.e-7
144       ABS_TOL=1.e-8
145       def setUp(self):
146           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
147           x1 = ContinuousFunction(d1).getX()
148           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
149           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
150           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
151           d2.setX(d2.getX()+[0.5,0.,0.])
152           self.domain = JoinFaces([d1,d2])
153    
154    class Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace(Test_assemblage_3Do2_Contact):
155       RES_TOL=1.e-7
156       ABS_TOL=1.e-8
157       def setUp(self):
158           d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
159           x1 = ContinuousFunction(d1).getX()
160           ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
161           d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
162           ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
163           d2.setX(d2.getX()+[0.5,0.,0.])
164           self.domain = JoinFaces([d1,d2])
165    
166  if __name__ == '__main__':  if __name__ == '__main__':
167     suite = unittest.TestSuite()     suite = unittest.TestSuite()
# Line 55  if __name__ == '__main__': Line 169  if __name__ == '__main__':
169     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder2))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder2))
170     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder1))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder1))
171     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder2))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder2))
172     suite.addTest(unittest.makeSuite(Test_PoissonOnFinley))  
173       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))
174       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))
175       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))
176       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))
177       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))
178       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))
179       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))
180       suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))
181     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
182     if s.wasSuccessful():     if s.wasSuccessful():
183       sys.exit(0)       sys.exit(0)

Legend:
Removed from v.714  
changed lines
  Added in v.773

  ViewVC Help
Powered by ViewVC 1.1.26