/[escript]/trunk/escriptcore/test/python/test_linearPDEs.py
ViewVC logotype

Diff of /trunk/escriptcore/test/python/test_linearPDEs.py

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

revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2688 by artak, Tue Sep 29 05:19:43 2009 UTC
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14  __copyright__="""Copyright (c) 2003-2008 by University of Queensland  __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15  Earth Systems Science Computational Center (ESSCC)  Earth Systems Science Computational Center (ESSCC)
16  http://www.uq.edu.au/esscc  http://www.uq.edu.au/esscc
17  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
# Line 34  The tests must be linked with a Domain c Line 34  The tests must be linked with a Domain c
34     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))     suite.addTest(unittest.makeSuite(Test_LinearPDEOnFinley))
35     unittest.TextTestRunner(verbosity=2).run(suite)     unittest.TextTestRunner(verbosity=2).run(suite)
36    
37  @var __author__: name of author  :var __author__: name of author
38  @var __copyright__: copyrights  :var __copyright__: copyrights
39  @var __license__: licence agreement  :var __license__: licence agreement
40  @var __url__: url entry point on documentation  :var __url__: url entry point on documentation
41  @var __version__: version  :var __version__: version
42  @var __date__: date of the version  :var __date__: date of the version
43  """  """
44    
45  __author__="Lutz Gross, l.gross@uq.edu.au"  __author__="Lutz Gross, l.gross@uq.edu.au"
# Line 57  class Test_linearPDEs(unittest.TestCase) Line 57  class Test_linearPDEs(unittest.TestCase)
57      VERBOSE=False      VERBOSE=False
58      def check(self,arg,ref_arg,tol=None):      def check(self,arg,ref_arg,tol=None):
59          """          """
60          checks if arg and ref_arg are nearly identical using the L{Lsup<esys.escript.util.Lsup>}          checks if arg and ref_arg are nearly identical using the `Lsup`
61          """          """
62          if tol==None: tol=self.TOL          if tol==None: tol=self.TOL
63          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)          return Lsup(arg-ref_arg)<=tol*Lsup(ref_arg)
# Line 643  class Test_LinearPDE_noLumping(Test_line Line 643  class Test_LinearPDE_noLumping(Test_line
643      def test_SolverOptions(self):      def test_SolverOptions(self):
644          so=SolverOptions()          so=SolverOptions()
645    
646          self.failUnless(so.getLevelMax() == 10, "initial  LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 3, "initial  LevelMax is wrong.")
647          self.failUnlessRaises(ValueError,so.setLevelMax,-1)          self.failUnlessRaises(ValueError,so.setLevelMax,-1)
648          so.setLevelMax(3)          so.setLevelMax(20)
649          self.failUnless(so.getLevelMax() == 3, "LevelMax is wrong.")          self.failUnless(so.getLevelMax() == 20, "LevelMax is wrong.")
650    
651          self.failUnless(so.getCoarseningThreshold() == 0.05, "initial  CoarseningThreshold is wrong.")          self.failUnless(so.getCoarseningThreshold() == 0.25, "initial  CoarseningThreshold is wrong.")
652          self.failUnlessRaises(ValueError,so.setCoarseningThreshold,-1)          self.failUnlessRaises(ValueError,so.setCoarseningThreshold,-1)
653          so.setCoarseningThreshold(0.1)          so.setCoarseningThreshold(0.1)
654          self.failUnless(so.getCoarseningThreshold() == 0.1, "CoarseningThreshold is wrong.")          self.failUnless(so.getCoarseningThreshold() == 0.1, "CoarseningThreshold is wrong.")
# Line 1586  class Test_LinearPDE_noLumping(Test_line Line 1586  class Test_LinearPDE_noLumping(Test_line
1586      mypde.getSolverOptions().setVerbosity(self.VERBOSE)      mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1587          u=mypde.getSolution()          u=mypde.getSolution()
1588          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1589        def test_PCG_AMG(self):
1590            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1591            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1592            mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1593        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1594        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1595            u=mypde.getSolution()
1596            self.failUnless(self.check(u,1.),'solution is wrong.')
1597      def test_PCG_ILU0(self):      def test_PCG_ILU0(self):
1598          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1599          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1625  class Test_LinearPDE_noLumping(Test_line Line 1633  class Test_LinearPDE_noLumping(Test_line
1633          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1634          u=mypde.getSolution()          u=mypde.getSolution()
1635          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1636        def test_BICGSTAB_AMG(self):
1637            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1638        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1639        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1640            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1641            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1642            u=mypde.getSolution()
1643            self.failUnless(self.check(u,1.),'solution is wrong.')
1644      def test_BICGSTAB_ILU0(self):      def test_BICGSTAB_ILU0(self):
1645          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1646          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1657  class Test_LinearPDE_noLumping(Test_line Line 1673  class Test_LinearPDE_noLumping(Test_line
1673          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1674          u=mypde.getSolution()          u=mypde.getSolution()
1675          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1676        def test_MINRES_AMG(self):
1677            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1678        mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1679        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1680            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1681            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1682            u=mypde.getSolution()
1683            self.failUnless(self.check(u,1.),'solution is wrong.')
1684      def test_MINRES_ILU0(self):      def test_MINRES_ILU0(self):
1685          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1686          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1689  class Test_LinearPDE_noLumping(Test_line Line 1713  class Test_LinearPDE_noLumping(Test_line
1713          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1714          u=mypde.getSolution()          u=mypde.getSolution()
1715          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1716        def test_TFQMR_AMG(self):
1717            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1718        mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1719        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1720            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1721            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1722            u=mypde.getSolution()
1723            self.failUnless(self.check(u,1.),'solution is wrong.')
1724      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
1725          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1726          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1721  class Test_LinearPDE_noLumping(Test_line Line 1753  class Test_LinearPDE_noLumping(Test_line
1753          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1754          u=mypde.getSolution()          u=mypde.getSolution()
1755          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1756        def test_PRES20_AMG(self):
1757            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1758            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1759        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1760        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1761            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1762            u=mypde.getSolution()
1763            self.failUnless(self.check(u,1.),'solution is wrong.')
1764      def test_PRES20_ILU0(self):      def test_PRES20_ILU0(self):
1765          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1766          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1754  class Test_LinearPDE_noLumping(Test_line Line 1794  class Test_LinearPDE_noLumping(Test_line
1794      mypde.getSolverOptions().setTruncation(50)      mypde.getSolverOptions().setTruncation(50)
1795          u=mypde.getSolution()          u=mypde.getSolution()
1796          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1797        def test_GMRESnoRestart_AMG(self):
1798            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1799            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1800        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1801        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1802        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1803        mypde.getSolverOptions().setTruncation(50)
1804            u=mypde.getSolution()
1805            self.failUnless(self.check(u,1.),'solution is wrong.')
1806      def test_GMRESnoRestart_ILU0(self):      def test_GMRESnoRestart_ILU0(self):
1807          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1808          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1789  class Test_LinearPDE_noLumping(Test_line Line 1838  class Test_LinearPDE_noLumping(Test_line
1838          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1839          u=mypde.getSolution()          u=mypde.getSolution()
1840          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1841        def test_GMRES_AMG(self):
1842            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1843            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1844        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1845        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1846            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1847            u=mypde.getSolution()
1848            self.failUnless(self.check(u,1.),'solution is wrong.')        
1849      def test_GMRES_ILU0(self):      def test_GMRES_ILU0(self):
1850          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1851          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1823  class Test_LinearPDE_noLumping(Test_line Line 1880  class Test_LinearPDE_noLumping(Test_line
1880      mypde.getSolverOptions().setRestart(20)      mypde.getSolverOptions().setRestart(20)
1881          u=mypde.getSolution()          u=mypde.getSolution()
1882          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1883        def test_GMRES_truncation_restart_AMG(self):
1884            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1885            mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1886        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1887        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1888        mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1889        mypde.getSolverOptions().setTruncation(10)
1890        mypde.getSolverOptions().setRestart(20)
1891            u=mypde.getSolution()
1892            self.failUnless(self.check(u,1.),'solution is wrong.')
1893      def test_GMRES_truncation_restart_ILU0(self):      def test_GMRES_truncation_restart_ILU0(self):
1894          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1895          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1898  class Test_LinearPDE_noLumping(Test_line Line 1965  class Test_LinearPDE_noLumping(Test_line
1965          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1966          u=mypde.getSolution()          u=mypde.getSolution()
1967          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1968        def test_PCG_AMG_System(self):
1969            A=Tensor4(0.,Function(self.domain))
1970            D=Tensor(1.,Function(self.domain))
1971            Y=Vector(self.domain.getDim(),Function(self.domain))
1972            for i in range(self.domain.getDim()):
1973                A[i,:,i,:]=kronecker(self.domain)
1974                D[i,i]+=i
1975                Y[i]+=i
1976            mypde=LinearPDE(self.domain,debug=self.DEBUG)
1977            mypde.setValue(A=A,D=D,Y=Y)
1978            mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1979        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1980            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1981            u=mypde.getSolution()
1982            self.failUnless(self.check(u,1.),'solution is wrong.')
1983      def test_PCG_ILU0_System(self):      def test_PCG_ILU0_System(self):
1984          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
1985          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1942  class Test_LinearPDE_noLumping(Test_line Line 2024  class Test_LinearPDE_noLumping(Test_line
2024          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2025          u=mypde.getSolution()          u=mypde.getSolution()
2026          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2027        def test_BICGSTAB_AMG_System(self):
2028            A=Tensor4(0.,Function(self.domain))
2029            D=Tensor(1.,Function(self.domain))
2030            Y=Vector(self.domain.getDim(),Function(self.domain))
2031            for i in range(self.domain.getDim()):
2032                A[i,:,i,:]=kronecker(self.domain)
2033                D[i,i]+=i
2034                Y[i]+=i
2035            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2036            mypde.setValue(A=A,D=D,Y=Y)
2037        mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2038        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2039            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2040            u=mypde.getSolution()
2041            self.failUnless(self.check(u,1.),'solution is wrong.')
2042      def test_BICGSTAB_ILU0_System(self):      def test_BICGSTAB_ILU0_System(self):
2043          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2044          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 1972  class Test_LinearPDE_noLumping(Test_line Line 2069  class Test_LinearPDE_noLumping(Test_line
2069          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2070          u=mypde.getSolution()          u=mypde.getSolution()
2071          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2072        def test_PRES20_AMG_System(self):
2073            A=Tensor4(0.,Function(self.domain))
2074            D=Tensor(1.,Function(self.domain))
2075            Y=Vector(self.domain.getDim(),Function(self.domain))
2076            for i in range(self.domain.getDim()):
2077                A[i,:,i,:]=kronecker(self.domain)
2078                D[i,i]+=i
2079                Y[i]+=i
2080            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2081            mypde.setValue(A=A,D=D,Y=Y)
2082        mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2083        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2084            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2085            u=mypde.getSolution()
2086            self.failUnless(self.check(u,1.),'solution is wrong.')
2087      def test_PRES20_ILU0_System(self):      def test_PRES20_ILU0_System(self):
2088          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2089          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2003  class Test_LinearPDE_noLumping(Test_line Line 2115  class Test_LinearPDE_noLumping(Test_line
2115          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2116          u=mypde.getSolution()          u=mypde.getSolution()
2117          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2118        def test_GMRESnoRestart_AMG_System(self):
2119            A=Tensor4(0.,Function(self.domain))
2120            D=Tensor(1.,Function(self.domain))
2121            Y=Vector(self.domain.getDim(),Function(self.domain))
2122            for i in range(self.domain.getDim()):
2123                A[i,:,i,:]=kronecker(self.domain)
2124                D[i,i]+=i
2125                Y[i]+=i
2126            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2127            mypde.setValue(A=A,D=D,Y=Y)
2128        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2129        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2130            # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2131            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2132            u=mypde.getSolution()
2133            self.failUnless(self.check(u,1.),'solution is wrong.')
2134      def test_GMRESnoRestart_ILU0_System(self):      def test_GMRESnoRestart_ILU0_System(self):
2135          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2136          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2034  class Test_LinearPDE_noLumping(Test_line Line 2162  class Test_LinearPDE_noLumping(Test_line
2162          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2163          u=mypde.getSolution()          u=mypde.getSolution()
2164          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2165        def test_GMRES_AMG_System(self):
2166            A=Tensor4(0.,Function(self.domain))
2167            D=Tensor(1.,Function(self.domain))
2168            Y=Vector(self.domain.getDim(),Function(self.domain))
2169            for i in range(self.domain.getDim()):
2170                A[i,:,i,:]=kronecker(self.domain)
2171                D[i,i]+=i
2172                Y[i]+=i
2173            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2174            mypde.setValue(A=A,D=D,Y=Y)
2175        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2176        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2177            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2178            u=mypde.getSolution()
2179            self.failUnless(self.check(u,1.),'solution is wrong.')
2180      def test_GMRES_ILU0_System(self):      def test_GMRES_ILU0_System(self):
2181          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2182          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2064  class Test_LinearPDE_noLumping(Test_line Line 2207  class Test_LinearPDE_noLumping(Test_line
2207          mypde.getSolverOptions().setVerbosity(self.VERBOSE)          mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2208      mypde.getSolverOptions().setTruncation(10)      mypde.getSolverOptions().setTruncation(10)
2209      mypde.getSolverOptions().setRestart(20)      mypde.getSolverOptions().setRestart(20)
2210            u=mypde.getSolution()
2211            self.failUnless(self.check(u,1.),'solution is wrong.')
2212        def test_GMRES_truncation_restart_AMG_System(self):
2213            A=Tensor4(0.,Function(self.domain))
2214            D=Tensor(1.,Function(self.domain))
2215            Y=Vector(self.domain.getDim(),Function(self.domain))
2216            for i in range(self.domain.getDim()):
2217                A[i,:,i,:]=kronecker(self.domain)
2218                D[i,i]+=i
2219                Y[i]+=i
2220            mypde=LinearPDE(self.domain,debug=self.DEBUG)
2221            mypde.setValue(A=A,D=D,Y=Y)
2222        mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2223        mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2224            mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2225        mypde.getSolverOptions().setTruncation(10)
2226        mypde.getSolverOptions().setRestart(20)
2227          u=mypde.getSolution()          u=mypde.getSolution()
2228          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2229      def test_GMRES_truncation_restart_ILU0_System(self):      def test_GMRES_truncation_restart_ILU0_System(self):

Legend:
Removed from v.2548  
changed lines
  Added in v.2688

  ViewVC Help
Powered by ViewVC 1.1.26