/[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 1329 by ksteube, Mon Sep 24 06:18:44 2007 UTC revision 1330 by gross, Mon Oct 22 04:54:49 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  from esys.escript.pdetools import Locator,Projector,TimeIntegrationManager,NoPDE,PCG, IterationHistory
54    
55  class Test_pdetools_noLumping(unittest.TestCase):  class Test_pdetools_noLumping(unittest.TestCase):
56      DEBUG=False      DEBUG=False
# Line 403  class Test_pdetools_noLumping(unittest.T Line 403  class Test_pdetools_noLumping(unittest.T
403            for i in xrange(size(b)):            for i in xrange(size(b)):
404              out[i]=b[i]/A[i,i]              out[i]=b[i]/A[i,i]
405            return out            return out
       def norm(d):  
           return sqrt(dot(d,d))  
406    
       x=x_ref*1.5  
407        tol=1.e-4        tol=1.e-4
408        x,r=PCG(b*1.,x,Ap,Ms,dot, norm, verbose=False, iter_max=12, tolerance=tol)        x,r=PCG(b*1.,Ap,Ms,dot, IterationHistory(tol).stoppingcriterium,x=x_ref*1.5, iter_max=12)
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    

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

  ViewVC Help
Powered by ViewVC 1.1.26