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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 798 - (hide annotations)
Fri Aug 4 01:05:36 2006 UTC (14 years, 8 months ago) by gross
File MIME type: text/x-python
File size: 8198 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 149 # $Id$
2    
3 jgs 154 """
4 gross 773 Test suite for the linearPDE and pdetools test on finley
5 jgs 154
6     @remark:
7    
8     @var __author__: name of author
9     @var __licence__: licence agreement
10     @var __url__: url entry point on documentation
11     @var __version__: version
12     @var __date__: date of the version
13     """
14    
15 elspeth 617 __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 jgs 154 __author__="Lutz Gross, l.gross@uq.edu.au"
21     __url__="http://www.iservo.edu.au/esys/escript"
22     __version__="$Revision$"
23     __date__="$Date$"
24    
25    
26 jgs 149 import unittest
27 elspeth 714 from test_linearPDEs import Test_Poisson,Test_LinearPDE
28 gross 773 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 elspeth 714 from test_pdetools import Test_pdetools
31 gross 773 from esys.escript import *
32     from esys.finley import Rectangle,Brick,JoinFaces
33 jgs 154 import sys
34 jgs 149
35    
36 gross 773 NE=6 # number of element in each spatial direction (must be even)
37 jgs 153
38 gross 773 class Test_LinearPDEOnFinley2DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1):
39     RES_TOL=1.e-7
40     ABS_TOL=1.e-8
41     def setUp(self):
42     self.domain = Rectangle(NE,NE,1)
43 gross 798 def tearDown(self):
44     del self.domain
45 jgs 153
46 gross 773 class Test_LinearPDEOnFinley2DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do2):
47     RES_TOL=1.e-7
48     ABS_TOL=1.e-8
49     def setUp(self):
50     self.domain = Rectangle(NE,NE,2)
51 gross 798 def tearDown(self):
52     del self.domain
53 jgs 153
54 gross 773 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 gross 798 def tearDown(self):
66     del self.domain
67 gross 773
68 jgs 149 class Test_PoissonOnFinley(Test_Poisson):
69 gross 773 RES_TOL=1.e-7
70     ABS_TOL=1.e-8
71     def setUp(self):
72     self.domain = Rectangle(NE,NE,2)
73 gross 798 def tearDown(self):
74     del self.domain
75 jgs 149
76 gross 773
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 gross 798 def tearDown(self):
89     del self.domain
90 gross 773
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 gross 798 def tearDown(self):
103     del self.domain
104 gross 773
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 gross 798 def tearDown(self):
117     del self.domain
118 gross 773
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 gross 798 def tearDown(self):
131     del self.domain
132 gross 773
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 gross 798 def tearDown(self):
146     del self.domain
147 gross 773
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 gross 798 def tearDown(self):
160     del self.domain
161 gross 773
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 gross 798 def tearDown(self):
174     del self.domain
175 gross 773
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 gross 798 def tearDown(self):
188     del self.domain
189 gross 773
190 jgs 149 if __name__ == '__main__':
191     suite = unittest.TestSuite()
192 jgs 153 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder1))
193 jgs 154 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley2DOrder2))
194 jgs 153 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder1))
195     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley3DOrder2))
196 gross 773
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 jgs 149 s=unittest.TextTestRunner(verbosity=2).run(suite)
206     if s.wasSuccessful():
207     sys.exit(0)
208     else:
209     sys.exit(1)
210 jgs 154

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26