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

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

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

revision 1330 by gross, Mon Oct 22 04:54:49 2007 UTC revision 1331 by gross, Tue Oct 23 00:42:15 2007 UTC
# Line 50  __date__="$Date$" Line 50  __date__="$Date$"
50    
51  import unittest  import unittest
52  from esys.escript import *  from esys.escript import *
53  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager,NoPDE,PCG, IterationHistory  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager,NoPDE,PCG, IterationHistory, ArithmeticTuple
54    
55  class Test_pdetools_noLumping(unittest.TestCase):  class Test_pdetools_noLumping(unittest.TestCase):
56      DEBUG=False      DEBUG=False
# Line 409  class Test_pdetools_noLumping(unittest.T Line 409  class Test_pdetools_noLumping(unittest.T
409        self.failUnless(Lsup(x-x_ref)<=Lsup(x_ref)*tol*10.,"wrong solution")        self.failUnless(Lsup(x-x_ref)<=Lsup(x_ref)*tol*10.,"wrong solution")
410        self.failUnless(Lsup(r-(b-matrixmultiply(A,x)))<=Lsup(b)*EPSILON*100.,"wrong solution")        self.failUnless(Lsup(r-(b-matrixmultiply(A,x)))<=Lsup(b)*EPSILON*100.,"wrong solution")
411    
412        def testArithmeticTuple(self):
413            a=ArithmeticTuple(1.,2.)
414            self.failUnless(len(a)==2,"wrong length")
415            self.failUnless(a[0]==1.,"wrong first item")
416            self.failUnless(a[1]==2.,"wrong second item")
417            c=a*6.
418            self.failUnless(isinstance(c,ArithmeticTuple),"c is not an instance of ArithmeticTuple")
419            self.failUnless(len(c)==2,"c has wrong length")
420            self.failUnless(c[0]==6.,"c has wrong first item")
421            self.failUnless(c[1]==12.,"c has wrong second item")
422            b=5.*a
423            self.failUnless(isinstance(b,ArithmeticTuple),"b is not an instance of ArithmeticTuple")
424            self.failUnless(len(b)==2,"b has wrong length")
425            self.failUnless(b[0]==5.,"b has wrong first item")
426            self.failUnless(b[1]==10.,"b has wrong second item")
427            a+=ArithmeticTuple(3.,4.)
428            self.failUnless(a[0]==4.,"wrong first item of inplace update")
429            self.failUnless(a[1]==6.,"wrong second item of inplace update")
430    
431    
432    
433  class Test_pdetools(Test_pdetools_noLumping):  class Test_pdetools(Test_pdetools_noLumping):
434      def testProjector_rank0_fast_reduced(self):      def testProjector_rank0_fast_reduced(self):

Legend:
Removed from v.1330  
changed lines
  Added in v.1331

  ViewVC Help
Powered by ViewVC 1.1.26