/[escript]/trunk/escript/test/python/test_assemblage.py
ViewVC logotype

Diff of /trunk/escript/test/python/test_assemblage.py

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

revision 3258 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 20  http://www.opensource.org/licenses/osl-3 Line 20  http://www.opensource.org/licenses/osl-3
20  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
21    
22    
 """  
 Test suite for linearPDEs class  
   
 The tests must be linked with a Domain class object in the setUp method:  
   
    from esys.finley import Rectangle  
    class Test_LinearPDEOnFinley(Test_assemblage_2Do2):  
        RES_TOL=1.e-7  
        ABS_TOL=1.e-8  
        def setUp(self):  
            self.domain = Rectangle(10,10,2)  
        def tearDown(self):  
            del self.domain  
    suite = unittest.TestSuite()  
    suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))  
    unittest.TextTestRunner(verbosity=2).run(suite)  
   
    the domain must be the unit square or cube including all surfaces.  
    Test_assemblage_<d>Do<o> are the test for element order <o> and spatial dimension <d>  
    Test_assemblage_<X>_contact tests contact elements. it requires elements with x[0]<0.5 to be tagged  
    by 1 and x[0]>0.5 by 2.  
   
 :var __author__: name of author  
 :var __copyright__: copyrights  
 :var __license__: licence agreement  
 :var __url__: url entry point on documentation  
 :var __version__: version  
 :var __date__: date of the version  
 """  
   
23  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
24    
25  import unittest  import unittest
# Line 17932  class Test_assemblage_2Do2(unittest.Test Line 17902  class Test_assemblage_2Do2(unittest.Test
17902      y_test=n[0]*((-28)+20*x[1]+64*x[0])      y_test=n[0]*((-28)+20*x[1]+64*x[0])
17903      pde=LinearPDE(self.domain)      pde=LinearPDE(self.domain)
17904      pde.setValue(A=A_test, Y=Y_test, y=y_test)      pde.setValue(A=A_test, Y=Y_test, y=y_test)
17905        
17906        op=pde.getOperator()
17907        fs=escript.Data(u,pde.getFunctionSpaceForSolution())
17908      r=pde.getResidual(u)      r=pde.getResidual(u)
17909      rhs=pde.getRightHandSide()      rhs=pde.getRightHandSide()
17910        self.domain.print_mesh_info()
17911      self.failUnless(Lsup(rhs)>0,"right hand side is zero")      self.failUnless(Lsup(rhs)>0,"right hand side is zero")
17912      self.failUnless(Lsup(r)<=self.RES_TOL*Lsup(rhs),"residual is too big")      self.failUnless(Lsup(r)<=self.RES_TOL*Lsup(rhs),"residual is too big")
17913    #==================================================    #==================================================
# Line 35925  class Test_assemblage_3Do1(unittest.Test Line 35899  class Test_assemblage_3Do1(unittest.Test
35899      r=pde.getResidual(u)      r=pde.getResidual(u)
35900      rhs=pde.getRightHandSide()      rhs=pde.getRightHandSide()
35901      self.failUnless(Lsup(rhs)>0,"right hand side is zero")      self.failUnless(Lsup(rhs)>0,"right hand side is zero")
35902        self.domain.print_mesh_info()
35903    
35904        
35905    #    print rhs
35906      self.failUnless(Lsup(r)<=self.RES_TOL*Lsup(rhs),"residual is too big")      self.failUnless(Lsup(r)<=self.RES_TOL*Lsup(rhs),"residual is too big")
35907    #==================================================    #==================================================
35908    def test_assemblage_3D_solO1_coeffOFull_NEqu1_A_Const_typeStrong_comp01(self):    def test_assemblage_3D_solO1_coeffOFull_NEqu1_A_Const_typeStrong_comp01(self):

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26