# Diff of /trunk/finley/test/python/SimpleSolve.py

revision 148 by jgs, Tue Aug 23 01:24:31 2005 UTC revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 4  import sys Line 4  import sys
4  import os  import os
5  import unittest  import unittest
6
7  from escript.escript import *  from esys.escript import *
8  from escript.linearPDEs import *  from esys.escript.linearPDEs import *
9  from finley import finley  from esys import finley
10
11  print "\nSimpleSolve.py"  print "\nSimpleSolve.py"
12  print "--------------"  print "--------------"
# Line 20  error_tol=1.e-5 Line 20  error_tol=1.e-5
20  # mydomain=finley.Rectangle(140,140)  # mydomain=finley.Rectangle(140,140)
21
22  # print "\nGenerate mesh: finley.Rectangle(4,4,1)=>"  # print "\nGenerate mesh: finley.Rectangle(4,4,1)=>"
23    # mydomain=finley.Rectangle(10,10,1)
24  mydomain=finley.Rectangle(190,190,1)  mydomain=finley.Rectangle(190,190,1)
25
26  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"
# Line 61  print "mypde.checkSymmetry()" Line 62  print "mypde.checkSymmetry()"
62  print mypde.checkSymmetry()  print mypde.checkSymmetry()
63
64  print "\nIterative Solver (1)=>"  print "\nIterative Solver (1)=>"
65  # u_i=mypde.getSolution(preconditioner=ILU0,iter_max=3000)  u_i=mypde.getSolution(verbose=True,iter_max=3000,preconditioner=mypde.ILU0)
u_i=mypde.getSolution(iter_max=3000)
66
67  print "\nDirect Solver (1)=>"  print "\nDirect Solver (1)=>"
68  mypde.setSolverMethod(mypde.DIRECT)  mypde.setSolverMethod(mypde.DIRECT)
69  u_d=mypde.getSolution()  u_d=mypde.getSolution(verbose=True)
70
71  print "\n***************************************************************"  print "\n***************************************************************"
72  error=u_ex-u_d  error=u_ex-u_d
# Line 114  mypde.setTolerance(1.e-13) Line 114  mypde.setTolerance(1.e-13)
114
115  # mypde.setSymmetryOn() : is not woking yet!  # mypde.setSymmetryOn() : is not woking yet!
116  mypde.setSolverMethod(mypde.DIRECT)  mypde.setSolverMethod(mypde.DIRECT)
117  u_d=mypde.getSolution()  u_d=mypde.getSolution(verbose=True)
118
119  print "\nIterative Solver (2)=>"  print "\nIterative Solver (2)=>"
120
121  mypde.setSymmetryOn()  mypde.setSymmetryOn()
122  mypde.setSolverMethod(mypde.DEFAULT_METHOD)  mypde.setSolverMethod(mypde.DEFAULT_METHOD)
123  u_i=mypde.getSolution(iter_max=3000)  u_i=mypde.getSolution(verbose=True,iter_max=3000)
124
125  print "\n******************************************************************"  print "\n******************************************************************"
126  error=u_ex-u_d  error=u_ex-u_d

Legend:
 Removed from v.148 changed lines Added in v.149