/[escript]/trunk/dudley/test/python/fixme_run_generators.py
ViewVC logotype

Annotation of /trunk/dudley/test/python/fixme_run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2549 - (hide annotations)
Mon Jul 20 06:43:47 2009 UTC (10 years, 4 months ago) by jfenwick
Original Path: trunk/finley/test/python/run_generators.py
File MIME type: text/x-python
File size: 19943 byte(s)
Remainder of copyright date fixes
1 ksteube 1809
2     ########################################################
3 ksteube 1312 #
4 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1809 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1312 #
8 ksteube 1809 # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11 ksteube 1312 #
12 ksteube 1809 ########################################################
13 jgs 150
14 jfenwick 2549 __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15 ksteube 1809 Earth Systems Science Computational Center (ESSCC)
16     http://www.uq.edu.au/esscc
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 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
21 ksteube 1809
22 jgs 150 """
23 gross 1341 checks the mesh generators against the reference meshes in test_meshes and test the finley integration schemes.
24 jgs 150 """
25    
26 elspeth 626 import sys
27 gross 706 import os
28 elspeth 626 import unittest
29     from esys.escript import *
30 ksteube 1312 from esys.finley import Rectangle,Brick,JoinFaces, ReadGmsh, ReadMesh
31 elspeth 626
32 gross 798 try:
33     FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
34     except KeyError:
35     FINLEY_TEST_DATA='.'
36    
37     try:
38     FINLEY_WORKDIR=os.environ['FINLEY_WORKDIR']
39     except KeyError:
40     FINLEY_WORKDIR='.'
41    
42 gross 2416 FINLEY_TEST_MESH_PATH=os.path.join(FINLEY_TEST_DATA,"data_meshes")
43 phornby 1455 #if os.name == "nt":
44 gross 2416 # FINLEY_TEST_MESH_PATH = os.path.join(FINLEY_TEST_MESH_PATH,"win32")
45     FINLEY_WORKDIR_PATH=FINLEY_WORKDIR
46 gross 709
47 gross 706 TEST_FILE_EXT=".test"
48 jgs 150 class Test_Generators(unittest.TestCase):
49    
50     def checker(self,dom,reference):
51 gross 2416 dom_file=os.path.join(FINLEY_WORKDIR_PATH,TEST_FILE_EXT)
52 jgs 150 dom.write(dom_file)
53 woo409 757 # Uncomment this section to dump the files for regression testing
54     # if True:
55 gross 2416 # dom.write(os.path.join(FINLEY_TEST_MESH_PATH,reference))
56 gross 2319 dom_string=open(dom_file).read().splitlines()
57 gross 2416 ref_string=open(os.path.join(FINLEY_TEST_MESH_PATH,reference)).read().splitlines()
58 jgs 150 self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
59     for l in range(1,len(ref_string)):
60 phornby 1455 line=dom_string[l].strip()
61     if os.name == "nt":
62     line=line.replace("e+00","e+0").replace("e-00","e-0")
63     self.failUnlessEqual(line,ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),line))
64 jgs 150
65     def test_hex_2D_order1(self):
66     file="hex_2D_order1.msh"
67     my_dom=Rectangle(1,1,1)
68     self.checker(my_dom,file)
69    
70     def test_hex_2D_order1_onFace(self):
71     file="hex_2D_order1_onFace.msh"
72     my_dom=Rectangle(1,1,1,useElementsOnFace=1)
73     self.checker(my_dom,file)
74    
75     def test_hex_2D_order2(self):
76     file="hex_2D_order2.msh"
77     my_dom=Rectangle(1,1,2)
78     self.checker(my_dom,file)
79    
80     def test_hex_2D_order2_onFace(self):
81     file="hex_2D_order2_onFace.msh"
82     my_dom=Rectangle(1,1,2,useElementsOnFace=1)
83     self.checker(my_dom,file)
84    
85     def test_hex_3D_order1(self):
86     file="hex_3D_order1.msh"
87     my_dom=Brick(1,1,1,1)
88     self.checker(my_dom,file)
89    
90     def test_hex_3D_order1_onFace(self):
91     file="hex_3D_order1_onFace.msh"
92     my_dom=Brick(1,1,1,1,useElementsOnFace=1)
93     self.checker(my_dom,file)
94    
95     def test_hex_3D_order2(self):
96     file="hex_3D_order2.msh"
97     my_dom=Brick(1,1,1,2)
98     self.checker(my_dom,file)
99    
100     def test_hex_3D_order2_onFace(self):
101     file="hex_3D_order2_onFace.msh"
102     my_dom=Brick(1,1,1,2,useElementsOnFace=1)
103     self.checker(my_dom,file)
104    
105     def test_hex_contact_2D_order1(self):
106     file="hex_contact_2D_order1.msh"
107     ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
108     ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
109     ms2.setX(ms2.getX()+[0,0.5])
110 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
111 jgs 150 self.checker(my_dom,file)
112    
113     def test_hex_contact_2D_order1_onFace(self):
114     file="hex_contact_2D_order1_onFace.msh"
115     ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
116     ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
117     ms2.setX(ms2.getX()+[0,0.5])
118 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
119 jgs 150 self.checker(my_dom,file)
120    
121     def test_hex_contact_2D_order2(self):
122     file="hex_contact_2D_order2.msh"
123     ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
124     ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
125     ms2.setX(ms2.getX()+[0,0.5])
126 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
127 jgs 150 self.checker(my_dom,file)
128    
129     def test_hex_contact_2D_order2_onFace(self):
130     file="hex_contact_2D_order2_onFace.msh"
131     ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
132     ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
133     ms2.setX(ms2.getX()+[0,0.5])
134 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
135 jgs 150 self.checker(my_dom,file)
136    
137     def test_hex_contact_3D_order1(self):
138     file="hex_contact_3D_order1.msh"
139     ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
140     ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
141     ms2.setX(ms2.getX()+[0,0,0.5])
142 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
143 jgs 150 self.checker(my_dom,file)
144    
145     def test_hex_contact_3D_order1_onFace(self):
146     file="hex_contact_3D_order1_onFace.msh"
147     ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
148     ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
149     ms2.setX(ms2.getX()+[0,0,0.5])
150 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
151 jgs 150 self.checker(my_dom,file)
152    
153     def test_hex_contact_3D_order2(self):
154     file="hex_contact_3D_order2.msh"
155     ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
156     ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
157     ms2.setX(ms2.getX()+[0,0,0.5])
158 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
159 jgs 150 self.checker(my_dom,file)
160    
161     def test_hex_contact_3D_order2_onFace(self):
162     file="hex_contact_3D_order2_onFace.msh"
163     ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
164     ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
165     ms2.setX(ms2.getX()+[0,0,0.5])
166 ksteube 1312 my_dom=JoinFaces([ms1,ms2],optimize=False)
167 jgs 150 self.checker(my_dom,file)
168    
169 gross 934 class Test_GMSHReader(unittest.TestCase):
170     def compare(self, test_file, reference_file):
171     dom_string=open(test_file).read().splitlines()
172     ref_string=open(reference_file).read().splitlines()
173     self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
174     for l in range(1,len(ref_string)):
175 phornby 1455 line=dom_string[l].strip()
176     if os.name == "nt":
177     line=line.replace("e+00","e+0").replace("e-00","e-0")
178     self.failUnlessEqual(line,ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),line))
179 gross 934
180     def test_Tri3(self):
181 ksteube 1829 file="tri3_gmsh.msh"
182     ref ="tri3.fly"
183 jfenwick 2419 test = os.path.join(FINLEY_WORKDIR,"tri3_test.fly")
184     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),2,optimize=False)
185 ksteube 1829 dom.write(test)
186 jfenwick 2419 self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
187 gross 934
188     def test_Tri6(self):
189 ksteube 1829 file="tri6_gmsh.msh"
190     ref="tri6.fly"
191 jfenwick 2419 test = os.path.join(FINLEY_WORKDIR,"tri8_test.fly")
192     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),2,optimize=False)
193 ksteube 1829 dom.write(test)
194 jfenwick 2419 self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
195 gross 934
196     def test_Tet4(self):
197 ksteube 1829 file="tet4_gmsh.msh"
198     ref="tet4.fly"
199 jfenwick 2419 test = os.path.join(FINLEY_WORKDIR,"tet4_test.fly")
200     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),3,optimize=False)
201 ksteube 1829 dom.write(test)
202 jfenwick 2419 self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
203 gross 934
204 ksteube 1312 def test_Tet10(self):
205 ksteube 1829 file="tet10_gmsh.msh"
206     ref="tet10.fly"
207 jfenwick 2419 test = os.path.join(FINLEY_WORKDIR,"tet10_test.fly")
208     dom = ReadGmsh(os.path.join(FINLEY_TEST_MESH_PATH,file),3,optimize=False)
209 ksteube 1829 dom.write(test)
210 jfenwick 2419 self.compare(test, os.path.join(FINLEY_TEST_MESH_PATH,ref))
211 gross 934
212 gross 1044 class Test_Reader(unittest.TestCase):
213     def test_ReadWriteTagNames(self):
214     file="hex_2D_order2.msh"
215 jfenwick 2419 test = os.path.join(FINLEY_WORKDIR,"test.fly")
216     dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,file),3,optimize=False)
217 gross 1044 insertTagNames(dom,A=1,B=2)
218     dom.write(test)
219 ksteube 1312 dom2 = ReadMesh(test,3,optimize=False)
220 gross 1044 t=getTagNames(dom)
221 ksteube 1312 self.failUnless(len(t)==6)
222 gross 1044 self.failUnless("A" in t)
223     self.failUnless("B" in t)
224     self.failUnless(dom2.getTag("A") == 1)
225     self.failUnless(dom2.getTag("B") == 2)
226     self.failUnless(dom2.isValidTagName("A"))
227     self.failUnless(dom2.isValidTagName("B"))
228    
229 gross 1341 class Test_Integration(unittest.TestCase):
230     TOL=EPSILON*100.
231     def __test_2DQ(self,dom,order):
232     x=Function(dom).getX()
233     x_bound=FunctionOnBoundary(dom).getX()
234     for i in xrange(order+1):
235     for j in xrange(order+1):
236     res=integrate(x[0]**i*x[1]**j)
237     ref=1./((i+1)*(j+1))
238     error=abs(res-ref)/abs(ref)
239     self.failUnless(error<=self.TOL,"integration for order (%s,%s) failed. True value = %s, calculated = %s"%(i,j,ref,res))
240    
241     res=integrate(x_bound[0]**i*x_bound[1]**j)
242     ref=0
243     if i == 0:
244     ref += 2./(j+1)
245     else:
246     ref += 1./(j+1)
247     if j == 0:
248     ref += 2./(i+1)
249     else:
250     ref += 1./(i+1)
251     error=abs(res-ref)/abs(ref)
252     self.failUnless(error<=self.TOL,"surface integration for order (%s,%s) failed. True value = %s, calculated = %s"%(i,j,ref,res))
253    
254     def __test_2DT(self,dom,order,raise_tol=1.):
255     x=Function(dom).getX()
256     x_bound=FunctionOnBoundary(dom).getX()
257     for i in xrange(order+1):
258     for j in xrange(order+1):
259     if i+j<=order:
260     res=integrate(x[0]**i*x[1]**j)
261     ref=1./((i+1)*(j+1))
262     error=abs(res-ref)/abs(ref)
263     # print order,error
264     self.failUnless(error<=self.TOL*raise_tol,"integration for order (%s,%s) failed. True value = %s, calculated = %s"%(i,j,ref,res))
265    
266     res=integrate(x_bound[0]**i*x_bound[1]**j)
267     ref=0
268     if i == 0:
269     ref += 2./(j+1)
270     else:
271     ref += 1./(j+1)
272     if j == 0:
273     ref += 2./(i+1)
274     else:
275     ref += 1./(i+1)
276     error=abs(res-ref)/abs(ref)
277     self.failUnless(error<=self.TOL*raise_tol,"surface integration for order (%s,%s) failed. True value = %s, calculated = %s"%(i,j,ref,res))
278    
279    
280     def __test_3DQ(self,dom,order):
281     x=Function(dom).getX()
282     x_bound=FunctionOnBoundary(dom).getX()
283     for i in xrange(order+1):
284     for j in xrange(order+1):
285     for k in xrange(order+1):
286     res=integrate(x[0]**i*x[1]**j*x[2]**k)
287     ref=1./((i+1)*(j+1)*(k+1))
288     error=abs(res-ref)/abs(ref)
289     self.failUnless(error<=self.TOL,"integration for order (%s,%s,%s) failed. True value = %s, calculated = %s"%(i,j,k,ref,res))
290    
291     res=integrate(x_bound[0]**i*x_bound[1]**j*x_bound[2]**k)
292     ref=0
293     if i == 0:
294     ref += 2./((j+1)*(k+1))
295     else:
296     ref += 1./((j+1)*(k+1))
297     if j == 0:
298     ref += 2./((i+1)*(k+1))
299     else:
300     ref += 1./((i+1)*(k+1))
301     if k == 0:
302     ref += 2./((i+1)*(j+1))
303     else:
304     ref += 1./((i+1)*(j+1))
305     error=abs(res-ref)/abs(ref)
306     self.failUnless(error<=self.TOL,"surface integration for order (%s,%s,%s) failed. True value = %s, calculated = %s"%(i,j,k,ref,res))
307    
308     def __test_3DT(self,dom,order,raise_tol=1.):
309     x=Function(dom).getX()
310     x_bound=FunctionOnBoundary(dom).getX()
311     for i in xrange(order+1):
312     for j in xrange(order+1):
313     for k in xrange(order+1):
314     if i+j+k<=order:
315     res=integrate(x[0]**i*x[1]**j*x[2]**k)
316     ref=1./((i+1)*(j+1)*(k+1))
317     error=abs(res-ref)/abs(ref)
318     self.failUnless(error<=self.TOL*raise_tol,"integration for order (%s,%s,%s) failed. True value = %s, calculated = %s"%(i,j,k,ref,res))
319    
320     res=integrate(x_bound[0]**i*x_bound[1]**j*x_bound[2]**k)
321     ref=0
322     if i == 0:
323     ref += 2./((j+1)*(k+1))
324     else:
325     ref += 1./((j+1)*(k+1))
326     if j == 0:
327     ref += 2./((i+1)*(k+1))
328     else:
329     ref += 1./((i+1)*(k+1))
330     if k == 0:
331     ref += 2./((i+1)*(j+1))
332     else:
333     ref += 1./((i+1)*(j+1))
334     error=abs(res-ref)/abs(ref)
335     self.failUnless(error<=self.TOL*raise_tol,"surface integration for order (%s,%s,%s) failed. True value = %s, calculated = %s"%(i,j,k,ref,res))
336    
337     def test_hex2D_order1(self):
338 gross 2319 NE=getMPIRankWorld()
339     my_dom=Rectangle(NE,NE,integrationOrder=1)
340 gross 1341 self.__test_2DQ(my_dom,1)
341     def test_hex2D_order2(self):
342 gross 2319 NE=getMPIRankWorld()
343     my_dom=Rectangle(NE,NE,integrationOrder=2)
344 gross 1341 self.__test_2DQ(my_dom,2)
345     def test_hex2D_order3(self):
346 gross 2319 NE=getMPIRankWorld()
347     my_dom=Rectangle(NE,NE,integrationOrder=3)
348 gross 1341 self.__test_2DQ(my_dom,3)
349     def test_hex2D_order4(self):
350 gross 2319 NE=getMPIRankWorld()
351     my_dom=Rectangle(NE,NE,integrationOrder=4)
352 gross 1341 self.__test_2DQ(my_dom,4)
353     def test_hex2D_order5(self):
354 gross 2319 NE=getMPIRankWorld()
355     my_dom=Rectangle(NE,NE,integrationOrder=5)
356 gross 1341 self.__test_2DQ(my_dom,5)
357     def test_hex2D_order6(self):
358 gross 2319 NE=getMPIRankWorld()
359     my_dom=Rectangle(NE,NE,integrationOrder=6)
360 gross 1341 self.__test_2DQ(my_dom,6)
361     def test_hex2D_order7(self):
362 gross 2319 NE=getMPIRankWorld()
363     my_dom=Rectangle(NE,NE,integrationOrder=7)
364 gross 1341 self.__test_2DQ(my_dom,7)
365     def test_hex2D_order8(self):
366 gross 2319 NE=getMPIRankWorld()
367     my_dom=Rectangle(NE,NE,integrationOrder=8)
368 gross 1341 self.__test_2DQ(my_dom,8)
369     def test_hex2D_order9(self):
370 gross 2319 NE=getMPIRankWorld()
371     my_dom=Rectangle(NE,NE,integrationOrder=9)
372 gross 1341 self.__test_2DQ(my_dom,9)
373     def test_hex2D_order10(self):
374 gross 2319 NE=getMPIRankWorld()
375     my_dom=Rectangle(NE,NE,integrationOrder=10)
376 gross 1341 self.__test_2DQ(my_dom,10)
377    
378     def test_Tet2D_order1(self):
379 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=1)
380 gross 1341 self.__test_2DT(my_dom,1)
381     def test_Tet2D_order2(self):
382 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=2)
383 gross 1341 self.__test_2DT(my_dom,2)
384     def test_Tet2D_order3(self):
385 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=3)
386 gross 1341 self.__test_2DT(my_dom,3)
387     def test_Tet2D_order4(self):
388 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=4)
389 gross 1341 self.__test_2DT(my_dom,4)
390     def test_Tet2D_order5(self):
391 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=5)
392 gross 1341 self.__test_2DT(my_dom,5)
393     def test_Tet2D_order6(self):
394 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=6)
395 gross 1341 self.__test_2DT(my_dom,6)
396     def test_Tet2D_order7(self):
397 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=7)
398 gross 1341 self.__test_2DT(my_dom,7)
399     def test_Tet2D_order8(self):
400 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=8)
401 gross 1341 self.__test_2DT(my_dom,8,1./sqrt(EPSILON))
402     def test_Tet2D_order9(self):
403 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=9)
404 gross 1341 self.__test_2DT(my_dom,9,1./sqrt(EPSILON))
405     def test_Tet2D_order10(self):
406 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tri3.fly"),optimize=False,integrationOrder=10)
407 gross 1341 self.__test_2DT(my_dom,10)
408    
409     def test_hex3D_order1(self):
410 gross 2319 NE=getMPIRankWorld()
411     my_dom=Brick(NE,NE,NE,integrationOrder=1)
412 gross 1341 self.__test_3DQ(my_dom,1)
413     def test_hex3D_order2(self):
414 gross 2319 NE=getMPIRankWorld()
415     my_dom=Brick(NE,NE,NE,integrationOrder=2)
416 gross 1341 self.__test_3DQ(my_dom,2)
417     def test_hex3D_order3(self):
418 gross 2319 NE=getMPIRankWorld()
419     my_dom=Brick(NE,NE,NE,integrationOrder=3)
420 gross 1341 self.__test_3DQ(my_dom,3)
421     def test_hex3D_order4(self):
422 gross 2319 NE=getMPIRankWorld()
423     my_dom=Brick(NE,NE,NE,integrationOrder=4)
424 gross 1341 self.__test_3DQ(my_dom,4)
425     def test_hex3D_order5(self):
426 gross 2319 NE=getMPIRankWorld()
427     my_dom=Brick(NE,NE,NE,integrationOrder=5)
428 gross 1341 self.__test_3DQ(my_dom,5)
429     def test_hex3D_order6(self):
430 gross 2319 NE=getMPIRankWorld()
431     my_dom=Brick(NE,NE,NE,integrationOrder=6)
432 gross 1341 self.__test_3DQ(my_dom,6)
433     def test_hex3D_order7(self):
434 gross 2319 NE=getMPIRankWorld()
435     my_dom=Brick(NE,NE,NE,integrationOrder=7)
436 gross 1341 self.__test_3DQ(my_dom,7)
437     def test_hex3D_order8(self):
438 gross 2319 NE=getMPIRankWorld()
439     my_dom=Brick(NE,NE,NE,integrationOrder=8)
440 gross 1341 self.__test_3DQ(my_dom,8)
441     def test_hex3D_order9(self):
442 gross 2319 NE=getMPIRankWorld()
443     my_dom=Brick(NE,NE,NE,integrationOrder=9)
444 gross 1341 self.__test_3DQ(my_dom,9)
445     def test_hex3D_order10(self):
446 gross 2319 NE=getMPIRankWorld()
447     my_dom=Brick(NE,NE,NE,integrationOrder=10)
448 gross 1341 self.__test_3DQ(my_dom,10)
449    
450     def test_Tet3D_order1(self):
451 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=1)
452 gross 1341 self.__test_3DT(my_dom,1)
453     def test_Tet3D_order2(self):
454 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=2)
455 gross 1341 self.__test_3DT(my_dom,2)
456     def test_Tet3D_order3(self):
457 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=3)
458 gross 1341 self.__test_3DT(my_dom,3)
459     def test_Tet3D_order4(self):
460 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=4)
461 gross 1341 self.__test_3DT(my_dom,4)
462     def test_Tet3D_order5(self):
463 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=5)
464 gross 1341 self.__test_3DT(my_dom,5)
465     def test_Tet3D_order6(self):
466 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=6)
467 gross 1341 self.__test_3DT(my_dom,6,1./sqrt(EPSILON))
468     def test_Tet3D_order7(self):
469 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=7)
470 gross 1341 self.__test_3DT(my_dom,7,1./sqrt(EPSILON))
471     def test_Tet3D_order8(self):
472 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=8)
473 gross 1341 self.__test_3DT(my_dom,8,1./sqrt(EPSILON))
474     def test_Tet3D_order9(self):
475 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=9)
476 gross 1341 self.__test_3DT(my_dom,9,1./sqrt(EPSILON))
477     def test_Tet3D_order10(self):
478 jfenwick 2419 my_dom = ReadMesh(os.path.join(FINLEY_TEST_MESH_PATH,"tet4.fly"),optimize=False,integrationOrder=10)
479 gross 1341 self.__test_3DT(my_dom,10)
480    
481 jgs 150 if __name__ == '__main__':
482     suite = unittest.TestSuite()
483 gross 2319
484     if getMPISizeWorld() == 1:
485     suite.addTest(unittest.makeSuite(Test_Generators))
486     else:
487     print "Test_Generators is dropped as number of processors >1"
488    
489     if getMPISizeWorld() == 1:
490     suite.addTest(unittest.makeSuite(Test_GMSHReader))
491     else:
492     print "Test_GMSHReader is dropped as number of processors >1"
493    
494     if getMPISizeWorld() == 1:
495     suite.addTest(unittest.makeSuite(Test_Reader))
496     else:
497     print "Test_Reader is dropped as number of processors >1"
498    
499 gross 1341 suite.addTest(unittest.makeSuite(Test_Integration))
500 jgs 150 s=unittest.TextTestRunner(verbosity=2).run(suite)
501 gross 1376 if not s.wasSuccessful(): sys.exit(1)

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26