/[escript]/trunk/finley/test/python/SimpleSolve.py
ViewVC logotype

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

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

revision 113 by jgs, Mon Feb 28 07:06:33 2005 UTC revision 115 by jgs, Fri Mar 4 07:12:47 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.01  alpha=0.025
15    
16  # generate mesh  # generate mesh
17    
18  # print "\nGenerate mesh: finley.Rectangle(9,12,1)=>"  # print "\nGenerate mesh: finley.Rectangle(9,12,1)=>"
19  # mydomain=finley.Rectangle(1,1)  # mydomain=finley.Rectangle(140,140)
20    
21  # print "\nGenerate mesh: finley.Rectangle(4,4,1)=>"  # print "\nGenerate mesh: finley.Rectangle(4,4,1)=>"
22  mydomain=finley.Rectangle(4,4,1)  # mydomain=finley.Rectangle(4,4,1)
23    
24  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"
25  # mydomain=finley.Rectangle(151,151,1)  mydomain=finley.Rectangle(151,151,1)
26    # mydomain=finley.Rectangle(128,128,1)
27    
28  print "\nSetup domain and functions"  print "\nSetup domain and functions"
29  print "--------------------------"  print "--------------------------"
# Line 59  print "mypde.checkSymmetry()" Line 60  print "mypde.checkSymmetry()"
60  print mypde.checkSymmetry()  print mypde.checkSymmetry()
61    
62  print "\nIterative Solver (1)=>"  print "\nIterative Solver (1)=>"
63  u_i=mypde.getSolution()  u_i=mypde.getSolution(preconditioner=ILU0,iter_max=3000)
64    # u_i=mypde.getSolution(iter_max=3000)
65    
66    
67  print "\nDirect Solver (1)=>"  print "\nDirect Solver (1)=>"
68  mypde.setSolverMethod(DIRECT)  mypde.setSolverMethod(DIRECT)
# Line 99  print "----------------------------" Line 102  print "----------------------------"
102    
103  print "\nDirect Solver (2)=>"  print "\nDirect Solver (2)=>"
104    
105    
106  # mypde.setSymmetryOn() : is not woking yet!  # mypde.setSymmetryOn() : is not woking yet!
107  mypde.setSolverMethod(mypde.DIRECT)  mypde.setSolverMethod(mypde.DIRECT)
108  u_d=mypde.getSolution()  u_d=mypde.getSolution()
# Line 107  print "\nIterative Solver (2)=>" Line 111  print "\nIterative Solver (2)=>"
111    
112  mypde.setSymmetryOn()  mypde.setSymmetryOn()
113  mypde.setSolverMethod(DEFAULT_METHOD)  mypde.setSolverMethod(DEFAULT_METHOD)
114  u_i=mypde.getSolution()  u_i=mypde.getSolution(iter_max=3000)
115    
116  print "\n******************************************************************"  print "\n******************************************************************"
117  error=u_ex-u_d  error=u_ex-u_d
# Line 119  print "********************************* Line 123  print "*********************************
123  print "\n-----"  print "\n-----"
124  print "Done."  print "Done."
125  print "-----"  print "-----"
   
 grad(u_d).saveDX("t.dx")  

Legend:
Removed from v.113  
changed lines
  Added in v.115

  ViewVC Help
Powered by ViewVC 1.1.26