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

Diff of /branches/domexper/dudley/test/python/fixme_run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/finley/test/python/test_generators.py revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC trunk/finley/test/python/run_generators.py revision 1809 by ksteube, Thu Sep 25 06:43:44 2008 UTC
# Line 1  Line 1 
1  # $Id$  
2    ########################################################
3    #
4    # Copyright (c) 2003-2008 by University of Queensland
5    # Earth Systems Science Computational Center (ESSCC)
6    # http://www.uq.edu.au/esscc
7    #
8    # 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    #
12    ########################################################
13    
14    __copyright__="""Copyright (c) 2003-2008 by University of Queensland
15    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    __url__="http://www.uq.edu.au/esscc/escript-finley"
21    
22    """
23    checks the mesh generators against the reference meshes in test_meshes and test the finley integration schemes.
24    """
25    
26  import sys  import sys
27    import os
28  import unittest  import unittest
29  from esys.escript import *  from esys.escript import *
30  from esys.finley import Interval,Rectangle,Brick,JoinFaces  from esys.finley import Rectangle,Brick,JoinFaces, ReadGmsh, ReadMesh
31    
32  """  try:
33  checks the mesh generators against the reference meshes in test_meshes       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    FINLEY_TEST_MESH_PATH=FINLEY_TEST_DATA+"/data_meshes/"
43    #if os.name == "nt":
44    #   FINLEY_TEST_MESH_PATH = FINLEY_TEST_MESH_PATH+"win32/"
45    FINLEY_WORKDIR_PATH=FINLEY_WORKDIR+"/"
46    
47  TEST_FILE_EXT=".test"  TEST_FILE_EXT=".test"
 REERFENCE_FILE_DIR="test_meshes"  
   
48  class Test_Generators(unittest.TestCase):  class Test_Generators(unittest.TestCase):
49    
50     def checker(self,dom,reference):     def checker(self,dom,reference):
51        dom_file=reference+TEST_FILE_EXT        dom_file=FINLEY_WORKDIR_PATH+TEST_FILE_EXT
52        dom.write(dom_file)        dom.write(dom_file)
53    # Uncomment this section to dump the files for regression testing
54    #      if True:
55    #         dom.write(FINLEY_TEST_MESH_PATH+reference)
56        dom_string=open(dom_file).read().splitlines()        dom_string=open(dom_file).read().splitlines()
57        ref_string=open(REERFENCE_FILE_DIR+"/"+reference).read().splitlines()        ref_string=open(FINLEY_TEST_MESH_PATH+reference).read().splitlines()
58        self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")        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)):        for l in range(1,len(ref_string)):
60           self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))       line=dom_string[l].strip()
61         if os.name == "nt":
62     def test_hex_1D_order1(self):             line=line.replace("e+00","e+0").replace("e-00","e-0")
63        file="hex_1D_order1.msh"           self.failUnlessEqual(line,ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),line))
       my_dom=Interval(1,1)  
       self.checker(my_dom,file)  
   
    def test_hex_1D_order1_onFace(self):  
       file="hex_1D_order1_onFace.msh"  
       my_dom=Interval(1,1,useElementsOnFace=1)  
       self.checker(my_dom,file)  
   
    def test_hex_1D_order2(self):  
       file="hex_1D_order2.msh"  
       my_dom=Interval(1,2)  
       self.checker(my_dom,file)  
   
    def test_hex_1D_order2_onFace(self):  
       file="hex_1D_order2_onFace.msh"  
       my_dom=Interval(1,2,useElementsOnFace=1)  
       self.checker(my_dom,file)  
64    
65     def test_hex_2D_order1(self):     def test_hex_2D_order1(self):
66        file="hex_2D_order1.msh"        file="hex_2D_order1.msh"
# Line 88  class Test_Generators(unittest.TestCase) Line 107  class Test_Generators(unittest.TestCase)
107        ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)        ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
108        ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)        ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=False)
109        ms2.setX(ms2.getX()+[0,0.5])        ms2.setX(ms2.getX()+[0,0.5])
110        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
111        self.checker(my_dom,file)        self.checker(my_dom,file)
112    
113     def test_hex_contact_2D_order1_onFace(self):     def test_hex_contact_2D_order1_onFace(self):
# Line 96  class Test_Generators(unittest.TestCase) Line 115  class Test_Generators(unittest.TestCase)
115        ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)        ms1=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
116        ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)        ms2=Rectangle(1,1,1,l1=0.5,useElementsOnFace=True)
117        ms2.setX(ms2.getX()+[0,0.5])        ms2.setX(ms2.getX()+[0,0.5])
118        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
119        self.checker(my_dom,file)        self.checker(my_dom,file)
120    
121     def test_hex_contact_2D_order2(self):     def test_hex_contact_2D_order2(self):
# Line 104  class Test_Generators(unittest.TestCase) Line 123  class Test_Generators(unittest.TestCase)
123        ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)        ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
124        ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)        ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=False)
125        ms2.setX(ms2.getX()+[0,0.5])        ms2.setX(ms2.getX()+[0,0.5])
126        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
127        self.checker(my_dom,file)        self.checker(my_dom,file)
128    
129     def test_hex_contact_2D_order2_onFace(self):     def test_hex_contact_2D_order2_onFace(self):
# Line 112  class Test_Generators(unittest.TestCase) Line 131  class Test_Generators(unittest.TestCase)
131        ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)        ms1=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
132        ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)        ms2=Rectangle(1,1,2,l1=0.5,useElementsOnFace=True)
133        ms2.setX(ms2.getX()+[0,0.5])        ms2.setX(ms2.getX()+[0,0.5])
134        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
135        self.checker(my_dom,file)        self.checker(my_dom,file)
136    
137     def test_hex_contact_3D_order1(self):     def test_hex_contact_3D_order1(self):
# Line 120  class Test_Generators(unittest.TestCase) Line 139  class Test_Generators(unittest.TestCase)
139        ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)        ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
140        ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)        ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=False)
141        ms2.setX(ms2.getX()+[0,0,0.5])        ms2.setX(ms2.getX()+[0,0,0.5])
142        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
143        self.checker(my_dom,file)        self.checker(my_dom,file)
144    
145     def test_hex_contact_3D_order1_onFace(self):     def test_hex_contact_3D_order1_onFace(self):
# Line 128  class Test_Generators(unittest.TestCase) Line 147  class Test_Generators(unittest.TestCase)
147        ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)        ms1=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
148        ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)        ms2=Brick(1,1,1,1,l2=0.5,useElementsOnFace=True)
149        ms2.setX(ms2.getX()+[0,0,0.5])        ms2.setX(ms2.getX()+[0,0,0.5])
150        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
151        self.checker(my_dom,file)        self.checker(my_dom,file)
152    
153     def test_hex_contact_3D_order2(self):     def test_hex_contact_3D_order2(self):
# Line 136  class Test_Generators(unittest.TestCase) Line 155  class Test_Generators(unittest.TestCase)
155        ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)        ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
156        ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)        ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=False)
157        ms2.setX(ms2.getX()+[0,0,0.5])        ms2.setX(ms2.getX()+[0,0,0.5])
158        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
159        self.checker(my_dom,file)        self.checker(my_dom,file)
160    
161     def test_hex_contact_3D_order2_onFace(self):     def test_hex_contact_3D_order2_onFace(self):
# Line 144  class Test_Generators(unittest.TestCase) Line 163  class Test_Generators(unittest.TestCase)
163        ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)        ms1=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
164        ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)        ms2=Brick(1,1,1,2,l2=0.5,useElementsOnFace=True)
165        ms2.setX(ms2.getX()+[0,0,0.5])        ms2.setX(ms2.getX()+[0,0,0.5])
166        my_dom=JoinFaces([ms1,ms2])        my_dom=JoinFaces([ms1,ms2],optimize=False)
167        self.checker(my_dom,file)        self.checker(my_dom,file)
168    
169    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         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    
180       def test_Tri3(self):
181           file="tri3_gmsh.msh"
182           ref ="tri3.fly"
183           test = FINLEY_WORKDIR+os.sep+"tri3_test.fly"
184           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,2,optimize=False)
185           dom.write(test)
186           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
187    
188       def test_Tri6(self):
189           file="tri6_gmsh.msh"
190           ref="tri6.fly"
191           test = FINLEY_WORKDIR+os.sep+"tri8_test.fly"
192           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,2,optimize=False)
193           dom.write(test)
194           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
195    
196       def test_Tet4(self):
197           file="tet4_gmsh.msh"
198           ref="tet4.fly"
199           test = FINLEY_WORKDIR+os.sep+"tet4_test.fly"
200           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,3,optimize=False)
201           dom.write(test)
202           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
203    
204       def test_Tet10(self):
205           file="tet10_gmsh.msh"
206           ref="tet10.fly"
207           test = FINLEY_WORKDIR+os.sep+"tet10_test.fly"
208           dom = ReadGmsh(FINLEY_TEST_MESH_PATH+os.sep+file,3,optimize=False)
209           dom.write(test)
210           self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
211    
212    class Test_Reader(unittest.TestCase):
213       def test_ReadWriteTagNames(self):
214           file="hex_2D_order2.msh"
215           test = FINLEY_WORKDIR+os.sep+"test.fly"
216           dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+file,3,optimize=False)
217           insertTagNames(dom,A=1,B=2)
218           dom.write(test)
219           dom2 = ReadMesh(test,3,optimize=False)
220           t=getTagNames(dom)
221           self.failUnless(len(t)==6)
222           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    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          my_dom=Rectangle(1,1,integrationOrder=1)
339          self.__test_2DQ(my_dom,1)
340       def test_hex2D_order2(self):
341          my_dom=Rectangle(1,1,integrationOrder=2)
342          self.__test_2DQ(my_dom,2)
343       def test_hex2D_order3(self):
344          my_dom=Rectangle(1,1,integrationOrder=3)
345          self.__test_2DQ(my_dom,3)
346       def test_hex2D_order4(self):
347          my_dom=Rectangle(1,1,integrationOrder=4)
348          self.__test_2DQ(my_dom,4)
349       def test_hex2D_order5(self):
350          my_dom=Rectangle(1,1,integrationOrder=5)
351          self.__test_2DQ(my_dom,5)
352       def test_hex2D_order6(self):
353          my_dom=Rectangle(1,1,integrationOrder=6)
354          self.__test_2DQ(my_dom,6)
355       def test_hex2D_order7(self):
356          my_dom=Rectangle(1,1,integrationOrder=7)
357          self.__test_2DQ(my_dom,7)
358       def test_hex2D_order8(self):
359          my_dom=Rectangle(1,1,integrationOrder=8)
360          self.__test_2DQ(my_dom,8)
361       def test_hex2D_order9(self):
362          my_dom=Rectangle(1,1,integrationOrder=9)
363          self.__test_2DQ(my_dom,9)
364       def test_hex2D_order10(self):
365          my_dom=Rectangle(1,1,integrationOrder=10)
366          self.__test_2DQ(my_dom,10)
367    
368       def test_Tet2D_order1(self):
369          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=1)
370          self.__test_2DT(my_dom,1)
371       def test_Tet2D_order2(self):
372          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=2)
373          self.__test_2DT(my_dom,2)
374       def test_Tet2D_order3(self):
375          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=3)
376          self.__test_2DT(my_dom,3)
377       def test_Tet2D_order4(self):
378          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=4)
379          self.__test_2DT(my_dom,4)
380       def test_Tet2D_order5(self):
381          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=5)
382          self.__test_2DT(my_dom,5)
383       def test_Tet2D_order6(self):
384          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=6)
385          self.__test_2DT(my_dom,6)
386       def test_Tet2D_order7(self):
387          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=7)
388          self.__test_2DT(my_dom,7)
389       def test_Tet2D_order8(self):
390          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=8)
391          self.__test_2DT(my_dom,8,1./sqrt(EPSILON))
392       def test_Tet2D_order9(self):
393          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=9)
394          self.__test_2DT(my_dom,9,1./sqrt(EPSILON))
395       def test_Tet2D_order10(self):
396          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tri3.fly",optimize=False,integrationOrder=10)
397          self.__test_2DT(my_dom,10)
398    
399       def test_hex3D_order1(self):
400          my_dom=Brick(1,1,1,integrationOrder=1)
401          self.__test_3DQ(my_dom,1)
402       def test_hex3D_order2(self):
403          my_dom=Brick(1,1,1,integrationOrder=2)
404          self.__test_3DQ(my_dom,2)
405       def test_hex3D_order3(self):
406          my_dom=Brick(1,1,1,integrationOrder=3)
407          self.__test_3DQ(my_dom,3)
408       def test_hex3D_order4(self):
409          my_dom=Brick(1,1,1,integrationOrder=4)
410          self.__test_3DQ(my_dom,4)
411       def test_hex3D_order5(self):
412          my_dom=Brick(1,1,1,integrationOrder=5)
413          self.__test_3DQ(my_dom,5)
414       def test_hex3D_order6(self):
415          my_dom=Brick(1,1,1,integrationOrder=6)
416          self.__test_3DQ(my_dom,6)
417       def test_hex3D_order7(self):
418          my_dom=Brick(1,1,1,integrationOrder=7)
419          self.__test_3DQ(my_dom,7)
420       def test_hex3D_order8(self):
421          my_dom=Brick(1,1,1,integrationOrder=8)
422          self.__test_3DQ(my_dom,8)
423       def test_hex3D_order9(self):
424          my_dom=Brick(1,1,1,integrationOrder=9)
425          self.__test_3DQ(my_dom,9)
426       def test_hex3D_order10(self):
427          my_dom=Brick(1,1,1,integrationOrder=10)
428          self.__test_3DQ(my_dom,10)
429    
430       def test_Tet3D_order1(self):
431          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=1)
432          self.__test_3DT(my_dom,1)
433       def test_Tet3D_order2(self):
434          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=2)
435          self.__test_3DT(my_dom,2)
436       def test_Tet3D_order3(self):
437          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=3)
438          self.__test_3DT(my_dom,3)
439       def test_Tet3D_order4(self):
440          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=4)
441          self.__test_3DT(my_dom,4)
442       def test_Tet3D_order5(self):
443          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=5)
444          self.__test_3DT(my_dom,5)
445       def test_Tet3D_order6(self):
446          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=6)
447          self.__test_3DT(my_dom,6,1./sqrt(EPSILON))
448       def test_Tet3D_order7(self):
449          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=7)
450          self.__test_3DT(my_dom,7,1./sqrt(EPSILON))
451       def test_Tet3D_order8(self):
452          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=8)
453          self.__test_3DT(my_dom,8,1./sqrt(EPSILON))
454       def test_Tet3D_order9(self):
455          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=9)
456          self.__test_3DT(my_dom,9,1./sqrt(EPSILON))
457       def test_Tet3D_order10(self):
458          my_dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+"tet4.fly",optimize=False,integrationOrder=10)
459          self.__test_3DT(my_dom,10)
460    
461  if __name__ == '__main__':  if __name__ == '__main__':
462     suite = unittest.TestSuite()     suite = unittest.TestSuite()
463     suite.addTest(unittest.makeSuite(Test_Generators))     suite.addTest(unittest.makeSuite(Test_Generators))
464       suite.addTest(unittest.makeSuite(Test_GMSHReader))
465       suite.addTest(unittest.makeSuite(Test_Reader))
466       suite.addTest(unittest.makeSuite(Test_Integration))
467     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
468     if s.wasSuccessful():     if not s.wasSuccessful(): sys.exit(1)
469       sys.exit(0)  
    else:  
      sys.exit(1)  

Legend:
Removed from v.155  
changed lines
  Added in v.1809

  ViewVC Help
Powered by ViewVC 1.1.26