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

revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 11  from esys import finley Line 11  from esys import finley
11  print "\nSimpleSolve.py"  print "\nSimpleSolve.py"
12  print "--------------"  print "--------------"
13
14  alpha=0.07  alpha=0.7
15  error_tol=1.e-5  error_tol=1.e-5
16
17  # generate mesh  # generate mesh
# 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)  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)=>"
27  # mydomain=finley.Rectangle(151,151,1)  # mydomain=finley.Rectangle(151,151,1)
# Line 56  print "----------------------------" Line 56  print "----------------------------"
56  print "mypde=LinearPDE( A=[[1.,0.8],[0.4,1.]], D=alpha, Y=alpha, domain=mydomain)"  print "mypde=LinearPDE( A=[[1.,0.8],[0.4,1.]], D=alpha, Y=alpha, domain=mydomain)"
57  mypde=LinearPDE(mydomain)  mypde=LinearPDE(mydomain)
58  mypde.setDebugOn()  mypde.setDebugOn()
59  mypde.setValue(A=[[1.,0.8],[0.4,1.]],D=alpha,Y=alpha)  mypde.setValue(A=[[1.,0.1],[0.04,1.]],D=alpha,Y=alpha)
60
61  print "mypde.checkSymmetry()"  print "mypde.checkSymmetry()"
62  print mypde.checkSymmetry()  print mypde.checkSymmetry()
63
64  print "\nIterative Solver (1)=>"  print "\nIterative Solver (1)=>"
65    mypde.setSolverMethod(mypde.BICGSTAB)
66  u_i=mypde.getSolution(verbose=True,iter_max=3000,preconditioner=mypde.ILU0)  u_i=mypde.getSolution(verbose=True,iter_max=3000,preconditioner=mypde.ILU0)
67
68  print "\nDirect Solver (1)=>"  print "\nDirect Solver (1)=>"
# Line 119  u_d=mypde.getSolution(verbose=True) Line 120  u_d=mypde.getSolution(verbose=True)
120  print "\nIterative Solver (2)=>"  print "\nIterative Solver (2)=>"
121
122  mypde.setSymmetryOn()  mypde.setSymmetryOn()
123  mypde.setSolverMethod(mypde.DEFAULT_METHOD)  mypde.setSolverMethod(mypde.ITERATIVE)
124  u_i=mypde.getSolution(verbose=True,iter_max=3000)  u_i=mypde.getSolution(verbose=True,iter_max=3000)
125
126  print "\n******************************************************************"  print "\n******************************************************************"

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