/[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 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (12 years, 6 months ago) by ksteube
File MIME type: text/x-python
File size: 10386 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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 855 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 gross 855
111     class Test_LinearPDEOnFinleyTet3DOrder2(Test_LinearPDE,Test_pdetools,Test_assemblage_3Do2):
112     RES_TOL=1.e-7
113     ABS_TOL=1.e-8
114     def setUp(self):
115 ksteube 1312 self.domain = ReadMesh(FINLEY_TEST_MESH_PATH+"tet_3D_order2.fly",optimize=False)
116 gross 855 def tearDown(self):
117     del self.domain
118    
119 jgs 149 class Test_PoissonOnFinley(Test_Poisson):
120 gross 773 RES_TOL=1.e-7
121     ABS_TOL=1.e-8
122     def setUp(self):
123     self.domain = Rectangle(NE,NE,2)
124 gross 798 def tearDown(self):
125     del self.domain
126 jgs 149
127 gross 773
128     class Test_AssemblePDEwithFinley_2Do1_Contact(Test_assemblage_2Do1_Contact):
129     RES_TOL=1.e-7
130     ABS_TOL=1.e-8
131     def setUp(self):
132     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
133     x1 = ContinuousFunction(d1).getX()
134     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
135     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1)
136     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
137     d2.setX(d2.getX()+[0.5,0.])
138 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
139 gross 798 def tearDown(self):
140     del self.domain
141 gross 773
142     class Test_AssemblePDEwithFinley_2Do2_Contact(Test_assemblage_2Do2_Contact):
143     RES_TOL=1.e-7
144     ABS_TOL=1.e-8
145     def setUp(self):
146     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
147     x1 = ContinuousFunction(d1).getX()
148     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
149     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2)
150     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
151     d2.setX(d2.getX()+[0.5,0.])
152 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
153 gross 798 def tearDown(self):
154     del self.domain
155 gross 773
156     class Test_AssemblePDEwithFinley_3Do1_Contact(Test_assemblage_3Do1_Contact):
157     RES_TOL=1.e-7
158     ABS_TOL=1.e-8
159     def setUp(self):
160     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
161     x1 = ContinuousFunction(d1).getX()
162     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
163     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1)
164     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
165     d2.setX(d2.getX()+[0.5,0.,0.])
166 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
167 gross 798 def tearDown(self):
168     del self.domain
169 gross 773
170     class Test_AssemblePDEwithFinley_3Do2_Contact(Test_assemblage_3Do2_Contact):
171     RES_TOL=1.e-7
172     ABS_TOL=1.e-8
173     def setUp(self):
174     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
175     x1 = ContinuousFunction(d1).getX()
176     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
177     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2)
178     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
179     d2.setX(d2.getX()+[0.5,0.,0.])
180 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
181 gross 798 def tearDown(self):
182     del self.domain
183 gross 773
184    
185     class Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace(Test_assemblage_2Do1_Contact):
186     RES_TOL=1.e-7
187     ABS_TOL=1.e-8
188     def setUp(self):
189     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
190     x1 = ContinuousFunction(d1).getX()
191     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
192     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=1,useElementsOnFace=True)
193     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
194     d2.setX(d2.getX()+[0.5,0.])
195 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
196 gross 798 def tearDown(self):
197     del self.domain
198 gross 773
199     class Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace(Test_assemblage_2Do2_Contact):
200     RES_TOL=1.e-7
201     ABS_TOL=1.e-8
202     def setUp(self):
203     d1 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
204     x1 = ContinuousFunction(d1).getX()
205     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
206     d2 = Rectangle(n0=int(NE/2),n1=NE,l0=0.5,order=2,useElementsOnFace=True)
207     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
208     d2.setX(d2.getX()+[0.5,0.])
209 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
210 gross 798 def tearDown(self):
211     del self.domain
212 gross 773
213     class Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace(Test_assemblage_3Do1_Contact):
214     RES_TOL=1.e-7
215     ABS_TOL=1.e-8
216     def setUp(self):
217     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
218     x1 = ContinuousFunction(d1).getX()
219     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
220     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=1,useElementsOnFace=True)
221     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
222     d2.setX(d2.getX()+[0.5,0.,0.])
223 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
224 gross 798 def tearDown(self):
225     del self.domain
226 gross 773
227     class Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace(Test_assemblage_3Do2_Contact):
228     RES_TOL=1.e-7
229     ABS_TOL=1.e-8
230     def setUp(self):
231     d1 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
232     x1 = ContinuousFunction(d1).getX()
233     ContinuousFunction(d1).setTags(1,Scalar(1,ContinuousFunction(d1)))
234     d2 = Brick(n0=int(NE/2),n1=NE,n2=NE,l0=0.5,order=2,useElementsOnFace=True)
235     ContinuousFunction(d2).setTags(2,Scalar(1,ContinuousFunction(d2)))
236     d2.setX(d2.getX()+[0.5,0.,0.])
237 ksteube 1312 self.domain = JoinFaces([d1,d2],optimize=False)
238 gross 798 def tearDown(self):
239     del self.domain
240 gross 773
241 jgs 149 if __name__ == '__main__':
242     suite = unittest.TestSuite()
243 gross 857 if True:
244     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex2DOrder1))
245     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex2DOrder2))
246     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex3DOrder1))
247     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyHex3DOrder2))
248 gross 773
249 gross 857 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet2DOrder1))
250     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet2DOrder2))
251 gross 859 suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet3DOrder1))
252     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinleyTet3DOrder2))
253 gross 1174
254 gross 857 suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact))
255     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact))
256     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact))
257     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact))
258     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do1_Contact_withElementsOnFace))
259     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_2Do2_Contact_withElementsOnFace))
260     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do1_Contact_withElementsOnFace))
261     suite.addTest(unittest.makeSuite(Test_AssemblePDEwithFinley_3Do2_Contact_withElementsOnFace))
262     else:
263 gross 859 pass
264 gross 855
265 jgs 149 s=unittest.TextTestRunner(verbosity=2).run(suite)

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26