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

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

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

revision 2724 by artak, Tue Sep 29 05:19:43 2009 UTC revision 2725 by artak, Wed Oct 21 23:44:06 2009 UTC
# Line 1587  class Test_LinearPDE_noLumping(Test_line Line 1587  class Test_LinearPDE_noLumping(Test_line
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):      def test_PCG_AMG(self):
1590          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1591          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1592          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1593      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1594      mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1595          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1596          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1597                self.failUnless(self.check(u,1.),'solution is wrong.')
1598      def test_PCG_ILU0(self):      def test_PCG_ILU0(self):
1599          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1600          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1634  class Test_LinearPDE_noLumping(Test_line Line 1635  class Test_LinearPDE_noLumping(Test_line
1635          u=mypde.getSolution()          u=mypde.getSolution()
1636          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1637      def test_BICGSTAB_AMG(self):      def test_BICGSTAB_AMG(self):
1638          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1639      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1640      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
1641          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1642          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1643          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1644          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1645                self.failUnless(self.check(u,1.),'solution is wrong.')
1646      def test_BICGSTAB_ILU0(self):      def test_BICGSTAB_ILU0(self):
1647          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1648          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1674  class Test_LinearPDE_noLumping(Test_line Line 1676  class Test_LinearPDE_noLumping(Test_line
1676          u=mypde.getSolution()          u=mypde.getSolution()
1677          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1678      def test_MINRES_AMG(self):      def test_MINRES_AMG(self):
1679          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1680      mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1681      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.MINRES)
1682          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1683          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1684          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1685          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1686                self.failUnless(self.check(u,1.),'solution is wrong.')
1687      def test_MINRES_ILU0(self):      def test_MINRES_ILU0(self):
1688          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1689          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1714  class Test_LinearPDE_noLumping(Test_line Line 1717  class Test_LinearPDE_noLumping(Test_line
1717          u=mypde.getSolution()          u=mypde.getSolution()
1718          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1719      def test_TFQMR_AMG(self):      def test_TFQMR_AMG(self):
1720          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1721      mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1722      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.TFQMR)
1723          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1724          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1725          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1726          self.failUnless(self.check(u,1.),'solution is wrong.')              mypde.getSolverOptions().setVerbosity(True)
1727                u=mypde.getSolution()
1728                self.failUnless(self.check(u,1.),'solution is wrong.')
1729      def test_TFQMR_ILU0(self):      def test_TFQMR_ILU0(self):
1730          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1731          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 1759  class Test_LinearPDE_noLumping(Test_line
1759          u=mypde.getSolution()          u=mypde.getSolution()
1760          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1761      def test_PRES20_AMG(self):      def test_PRES20_AMG(self):
1762          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1763          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1764      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1765      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
1766          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1767          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1768          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1769                self.failUnless(self.check(u,1.),'solution is wrong.')
1770      def test_PRES20_ILU0(self):      def test_PRES20_ILU0(self):
1771          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1772          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1795  class Test_LinearPDE_noLumping(Test_line Line 1801  class Test_LinearPDE_noLumping(Test_line
1801          u=mypde.getSolution()          u=mypde.getSolution()
1802          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1803      def test_GMRESnoRestart_AMG(self):      def test_GMRESnoRestart_AMG(self):
1804          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1805          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1806      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1807      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1808      mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1809      mypde.getSolverOptions().setTruncation(50)              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1810          u=mypde.getSolution()              mypde.getSolverOptions().setTruncation(50)
1811          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1812                self.failUnless(self.check(u,1.),'solution is wrong.')
1813      def test_GMRESnoRestart_ILU0(self):      def test_GMRESnoRestart_ILU0(self):
1814          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1815          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1839  class Test_LinearPDE_noLumping(Test_line Line 1846  class Test_LinearPDE_noLumping(Test_line
1846          u=mypde.getSolution()          u=mypde.getSolution()
1847          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1848      def test_GMRES_AMG(self):      def test_GMRES_AMG(self):
1849          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1850          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1851      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1852      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1853          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1854          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1855          self.failUnless(self.check(u,1.),'solution is wrong.')                      u=mypde.getSolution()
1856                self.failUnless(self.check(u,1.),'solution is wrong.')        
1857      def test_GMRES_ILU0(self):      def test_GMRES_ILU0(self):
1858          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1859          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1881  class Test_LinearPDE_noLumping(Test_line Line 1889  class Test_LinearPDE_noLumping(Test_line
1889          u=mypde.getSolution()          u=mypde.getSolution()
1890          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1891      def test_GMRES_truncation_restart_AMG(self):      def test_GMRES_truncation_restart_AMG(self):
1892          mypde=LinearPDE(self.domain,debug=self.DEBUG)          if self.order!=2:
1893          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1894      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
1895      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
1896      mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1897      mypde.getSolverOptions().setTruncation(10)              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1898      mypde.getSolverOptions().setRestart(20)              mypde.getSolverOptions().setTruncation(10)
1899          u=mypde.getSolution()              mypde.getSolverOptions().setRestart(20)
1900          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1901                self.failUnless(self.check(u,1.),'solution is wrong.')
1902      def test_GMRES_truncation_restart_ILU0(self):      def test_GMRES_truncation_restart_ILU0(self):
1903          mypde=LinearPDE(self.domain,debug=self.DEBUG)          mypde=LinearPDE(self.domain,debug=self.DEBUG)
1904          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)          mypde.setValue(A=kronecker(self.domain),D=1.,Y=1.)
# Line 1966  class Test_LinearPDE_noLumping(Test_line Line 1975  class Test_LinearPDE_noLumping(Test_line
1975          u=mypde.getSolution()          u=mypde.getSolution()
1976          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
1977      def test_PCG_AMG_System(self):      def test_PCG_AMG_System(self):
1978          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
1979          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
1980          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
1981          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
1982              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
1983              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
1984              Y[i]+=i                  D[i,i]+=i
1985          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
1986          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
1987          mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)              mypde.setValue(A=A,D=D,Y=Y)
1988      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.PCG)
1989          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
1990          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
1991          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
1992                self.failUnless(self.check(u,1.),'solution is wrong.')
1993      def test_PCG_ILU0_System(self):      def test_PCG_ILU0_System(self):
1994          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
1995          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2025  class Test_LinearPDE_noLumping(Test_line Line 2035  class Test_LinearPDE_noLumping(Test_line
2035          u=mypde.getSolution()          u=mypde.getSolution()
2036          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2037      def test_BICGSTAB_AMG_System(self):      def test_BICGSTAB_AMG_System(self):
2038          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
2039          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
2040          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
2041          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
2042              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
2043              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
2044              Y[i]+=i                  D[i,i]+=i
2045          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
2046          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
2047      mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)              mypde.setValue(A=A,D=D,Y=Y)
2048      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.BICGSTAB)
2049          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2050          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2051          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
2052                self.failUnless(self.check(u,1.),'solution is wrong.')
2053      def test_BICGSTAB_ILU0_System(self):      def test_BICGSTAB_ILU0_System(self):
2054          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2055          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2070  class Test_LinearPDE_noLumping(Test_line Line 2081  class Test_LinearPDE_noLumping(Test_line
2081          u=mypde.getSolution()          u=mypde.getSolution()
2082          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2083      def test_PRES20_AMG_System(self):      def test_PRES20_AMG_System(self):
2084          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
2085          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
2086          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
2087          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
2088              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
2089              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
2090              Y[i]+=i                  D[i,i]+=i
2091          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
2092          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
2093      mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)              mypde.setValue(A=A,D=D,Y=Y)
2094      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.PRES20)
2095          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2096          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2097          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
2098                self.failUnless(self.check(u,1.),'solution is wrong.')
2099      def test_PRES20_ILU0_System(self):      def test_PRES20_ILU0_System(self):
2100          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2101          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2116  class Test_LinearPDE_noLumping(Test_line Line 2128  class Test_LinearPDE_noLumping(Test_line
2128          u=mypde.getSolution()          u=mypde.getSolution()
2129          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2130      def test_GMRESnoRestart_AMG_System(self):      def test_GMRESnoRestart_AMG_System(self):
2131          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
2132          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
2133          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
2134          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
2135              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
2136              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
2137              Y[i]+=i                  D[i,i]+=i
2138          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
2139          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
2140      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=A,D=D,Y=Y)
2141      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2142          # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2143          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              # u=mypde.getSolution(verbose=self.VERBOSE,truncation=5)
2144          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2145          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
2146                self.failUnless(self.check(u,1.),'solution is wrong.')
2147      def test_GMRESnoRestart_ILU0_System(self):      def test_GMRESnoRestart_ILU0_System(self):
2148          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2149          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2163  class Test_LinearPDE_noLumping(Test_line Line 2176  class Test_LinearPDE_noLumping(Test_line
2176          u=mypde.getSolution()          u=mypde.getSolution()
2177          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2178      def test_GMRES_AMG_System(self):      def test_GMRES_AMG_System(self):
2179          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
2180          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
2181          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
2182          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
2183              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
2184              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
2185              Y[i]+=i                  D[i,i]+=i
2186          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
2187          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
2188      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=A,D=D,Y=Y)
2189      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2190          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2191          u=mypde.getSolution()              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2192          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
2193                self.failUnless(self.check(u,1.),'solution is wrong.')
2194      def test_GMRES_ILU0_System(self):      def test_GMRES_ILU0_System(self):
2195          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2196          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))
# Line 2210  class Test_LinearPDE_noLumping(Test_line Line 2224  class Test_LinearPDE_noLumping(Test_line
2224          u=mypde.getSolution()          u=mypde.getSolution()
2225          self.failUnless(self.check(u,1.),'solution is wrong.')          self.failUnless(self.check(u,1.),'solution is wrong.')
2226      def test_GMRES_truncation_restart_AMG_System(self):      def test_GMRES_truncation_restart_AMG_System(self):
2227          A=Tensor4(0.,Function(self.domain))          if self.order!=2:
2228          D=Tensor(1.,Function(self.domain))              A=Tensor4(0.,Function(self.domain))
2229          Y=Vector(self.domain.getDim(),Function(self.domain))              D=Tensor(1.,Function(self.domain))
2230          for i in range(self.domain.getDim()):              Y=Vector(self.domain.getDim(),Function(self.domain))
2231              A[i,:,i,:]=kronecker(self.domain)              for i in range(self.domain.getDim()):
2232              D[i,i]+=i                  A[i,:,i,:]=kronecker(self.domain)
2233              Y[i]+=i                  D[i,i]+=i
2234          mypde=LinearPDE(self.domain,debug=self.DEBUG)                  Y[i]+=i
2235          mypde.setValue(A=A,D=D,Y=Y)              mypde=LinearPDE(self.domain,debug=self.DEBUG)
2236      mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)              mypde.setValue(A=A,D=D,Y=Y)
2237      mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)              mypde.getSolverOptions().setSolverMethod(SolverOptions.GMRES)
2238          mypde.getSolverOptions().setVerbosity(self.VERBOSE)              mypde.getSolverOptions().setPreconditioner(SolverOptions.AMG)
2239      mypde.getSolverOptions().setTruncation(10)              mypde.getSolverOptions().setVerbosity(self.VERBOSE)
2240      mypde.getSolverOptions().setRestart(20)              mypde.getSolverOptions().setTruncation(10)
2241          u=mypde.getSolution()              mypde.getSolverOptions().setRestart(20)
2242          self.failUnless(self.check(u,1.),'solution is wrong.')              u=mypde.getSolution()
2243                self.failUnless(self.check(u,1.),'solution is wrong.')
2244      def test_GMRES_truncation_restart_ILU0_System(self):      def test_GMRES_truncation_restart_ILU0_System(self):
2245          A=Tensor4(0.,Function(self.domain))          A=Tensor4(0.,Function(self.domain))
2246          D=Tensor(1.,Function(self.domain))          D=Tensor(1.,Function(self.domain))

Legend:
Removed from v.2724  
changed lines
  Added in v.2725

  ViewVC Help
Powered by ViewVC 1.1.26