/[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 1694 - (hide annotations)
Fri Aug 8 04:27:46 2008 UTC (12 years, 2 months ago) by artak
File MIME type: text/x-python
File size: 10475 byte(s)
test_NoPDE_vector_variable is changed to avoid 0/0 division
1 ksteube 1312 #
2 jgs 149 # $Id$
3 ksteube 1312 #
4     #######################################################
5     #
6     # Copyright 2003-2007 by ACceSS MNRF
7     # Copyright 2007 by University of Queensland
8     #
9     # http://esscc.uq.edu.au
10     # Primary Business: Queensland, Australia
11     # Licensed under the Open Software License version 3.0
12     # http://www.opensource.org/licenses/osl-3.0.php
13     #
14     #######################################################
15     #
16 jgs 149
17 jgs 154 """
18 gross 773 Test suite for the linearPDE and pdetools test on finley
19 jgs 154
20     @remark:
21    
22     @var __author__: name of author
23     @var __licence__: licence agreement
24     @var __url__: url entry point on documentation
25     @var __version__: version
26     @var __date__: date of the version
27     """
28    
29 elspeth 617 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
30     http://www.access.edu.au
31     Primary Business: Queensland, Australia"""
32     __license__="""Licensed under the Open Software License version 3.0
33     http://www.opensource.org/licenses/osl-3.0.php"""
34 jgs 154 __author__="Lutz Gross, l.gross@uq.edu.au"
35     __url__="http://www.iservo.edu.au/esys/escript"
36     __version__="$Revision$"
37     __date__="$Date$"
38    
39    
40 jgs 149 import unittest
41 gross 855 from test_linearPDEs import Test_Poisson,Test_LinearPDE, Test_LinearPDE_noLumping
42 gross 773 from test_assemblage import Test_assemblage_2Do1, Test_assemblage_2Do2, Test_assemblage_3Do1, Test_assemblage_3Do2, \
43     Test_assemblage_2Do1_Contact,Test_assemblage_2Do2_Contact, Test_assemblage_3Do1_Contact, Test_assemblage_3Do2_Contact
44 gross 855 from test_pdetools import Test_pdetools, Test_pdetools_noLumping
45 gross 773 from esys.escript import *
46 gross 855 from esys.finley import Rectangle,Brick,JoinFaces, ReadMesh
47 jgs 154 import sys
48 jgs 149
49    
50 gross 855 try:
51     FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
52     except KeyError:
53     FINLEY_TEST_DATA='.'
54    
55     FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"
56    
57 gross 773 NE=6 # number of element in each spatial direction (must be even)
58 jgs 153
59 gross 1382 class Test_LinearPDEOnFinleyHex2DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1):
60 gross 773 RES_TOL=1.e-7
61     ABS_TOL=1.e-8
62     def setUp(self):
63     self.domain = Rectangle(NE,NE,1)
64 gross 798 def tearDown(self):
65     del self.domain
66 jgs 153
67 gross 855 class Test_LinearPDEOnFinleyHex2DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do2):
68 gross 773 RES_TOL=1.e-7
69     ABS_TOL=1.e-8
70     def setUp(self):
71     self.domain = Rectangle(NE,NE,2)
72 gross 798 def tearDown(self):
73     del self.domain
74 jgs 153
75 gross 855 class Test_LinearPDEOnFinleyHex3DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1):
76 gross 773 RES_TOL=1.e-7
77     ABS_TOL=1.e-8
78     def setUp(self):
79     self.domain = Brick(NE,NE,NE,1)
80    
81 gross 855 class Test_LinearPDEOnFinleyHex3DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do2):
82 gross 773 RES_TOL=1.e-7
83     ABS_TOL=1.e-8
84     def setUp(self):
85     self.domain = Brick(NE,NE,NE,2)
86 gross 798 def tearDown(self):
87     del self.domain
88 gross 773
89 gross 855 class Test_LinearPDEOnFinleyTet2DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_2Do1):
90     RES_TOL=1.e-7
91     ABS_TOL=1.e-8
92     def setUp(self):
93 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order1.fly",optimize=False)
94 gross 855 def tearDown(self):
95     del self.domain
96    
97     class Test_LinearPDEOnFinleyTet2DOrder2(Test_LinearPDE_noLumping,Test_pdetools_noLumping,Test_assemblage_2Do2):
98     RES_TOL=1.e-7
99     ABS_TOL=1.e-8
100     def setUp(self):
101 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_2D_order2.fly",optimize=False)
102 gross 855 def tearDown(self):
103     del self.domain
104    
105     class Test_LinearPDEOnFinleyTet3DOrder1(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do1):
106     RES_TOL=1.e-7
107     ABS_TOL=1.e-8
108     def setUp(self):
109 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order1.fly",optimize=False)
110 artak 1694 def tearDown(self):
111     del self.domain
112 gross 855
113     class Test_LinearPDEOnFinleyTet3DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do2):
114     RES_TOL=1.e-7
115     ABS_TOL=1.e-8
116     def setUp(self):
117 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order2.fly",optimize=False)
118 gross 855 def tearDown(self):
119     del self.domain
120    
121 jgs 149 class Test_PoissonOnFinley(Test_Poisson):
122 gross 773 RES_TOL=1.e-7
123     ABS_TOL=1.e-8
124     def setUp(self):
125     self.domain = Rectangle(NE,NE,2)
126 gross 798 def tearDown(self):
127     del self.domain
128 jgs 149
129 gross 773
130     class Test_AssemblePDEwithFinley_2Do1_Contact(Test_assemblage_2Do1_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=1)
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=1)
138     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
139     d2.setX(d2.getX()+[0.5,0.])
140 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
141 gross 798 def tearDown(self):
142     del self.domain
143 gross 773
144     class Test_AssemblePDEwithFinley_2Do2_Contact(Test_assemblage_2Do2_Contact):
145     RES_TOL=1.e-7
146     ABS_TOL=1.e-8
147     def setUp(self):
148     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
149     x1 = ContinuousFunction(d1).getX()
150     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
151     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
152     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
153     d2.setX(d2.getX()+[0.5,0.])
154 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
155 gross 798 def tearDown(self):
156     del self.domain
157 gross 773
158     class Test_AssemblePDEwithFinley_3Do1_Contact(Test_assemblage_3Do1_Contact):
159     RES_TOL=1.e-7
160     ABS_TOL=1.e-8
161     def setUp(self):
162     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
163     x1 = ContinuousFunction(d1).getX()
164     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
165     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
166     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
167     d2.setX(d2.getX()+[0.5,0.,0.])
168 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
169 gross 798 def tearDown(self):
170     del self.domain
171 gross 773
172     class Test_AssemblePDEwithFinley_3Do2_Contact(Test_assemblage_3Do2_Contact):
173     RES_TOL=1.e-7
174     ABS_TOL=1.e-8
175     def setUp(self):
176     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
177     x1 = ContinuousFunction(d1).getX()
178     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
179     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
180     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
181     d2.setX(d2.getX()+[0.5,0.,0.])
182 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
183 gross 798 def tearDown(self):
184     del self.domain
185 gross 773
186    
187     class Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace(Test_assemblage_2Do1_Contact):
188     RES_TOL=1.e-7
189     ABS_TOL=1.e-8
190     def setUp(self):
191     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
192     x1 = ContinuousFunction(d1).getX()
193     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
194     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
195     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
196     d2.setX(d2.getX()+[0.5,0.])
197 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
198 gross 798 def tearDown(self):
199     del self.domain
200 gross 773
201     class Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace(Test_assemblage_2Do2_Contact):
202     RES_TOL=1.e-7
203     ABS_TOL=1.e-8
204     def setUp(self):
205     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
206     x1 = ContinuousFunction(d1).getX()
207     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
208     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
209     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
210     d2.setX(d2.getX()+[0.5,0.])
211 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
212 gross 798 def tearDown(self):
213     del self.domain
214 gross 773
215     class Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace(Test_assemblage_3Do1_Contact):
216     RES_TOL=1.e-7
217     ABS_TOL=1.e-8
218     def setUp(self):
219     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
220     x1 = ContinuousFunction(d1).getX()
221     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
222     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
223     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
224     d2.setX(d2.getX()+[0.5,0.,0.])
225 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
226 gross 798 def tearDown(self):
227     del self.domain
228 gross 773
229     class Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace(Test_assemblage_3Do2_Contact):
230     RES_TOL=1.e-7
231     ABS_TOL=1.e-8
232     def setUp(self):
233     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
234     x1 = ContinuousFunction(d1).getX()
235     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
236     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
237     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
238     d2.setX(d2.getX()+[0.5,0.,0.])
239 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
240 gross 798 def tearDown(self):
241     del self.domain
242 gross 773
243 jgs 149 if __name__ == '__main__':
244     suite = unittest.TestSuite()
245 gross 857 if True:
246     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex2DOrder1))
247 gross 1374 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex2DOrder2))
248     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex3DOrder1))
249     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex3DOrder2))
250 gross 773
251 gross 1374 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet2DOrder1))
252     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet2DOrder2))
253     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet3DOrder1))
254     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet3DOrder2))
255 gross 1174
256 gross 1374 suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))
257     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))
258     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))
259     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))
260     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))
261     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))
262     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))
263     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))
264 ksteube 1512 else:
265 phornby 1494 pass
266 gross 855
267 jgs 149 s=unittest.TextTestRunner(verbosity=2).run(suite)
268 gross 1376 if not s.wasSuccessful(): sys.exit(1)
269    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26