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

revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC revision 148 by jgs, Tue Aug 23 01:24:31 2005 UTC
# Line 11  from finley import finley Line 11  from finley import finley
11  print "\nSimpleSolve.py"  print "\nSimpleSolve.py"
12  print "--------------"  print "--------------"
13
14  alpha=0.025  alpha=0.07
15  error_tol=pow(10,-9)  error_tol=1.e-5
16
17  # generate mesh  # generate mesh
18
# Line 20  error_tol=pow(10,-9) Line 20  error_tol=pow(10,-9)
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(5,5,1)  mydomain=finley.Rectangle(190,190,1)
24
25  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"  print "\nGenerate mesh: finley.Rectangle(151,151,1)=>"
26  mydomain=finley.Rectangle(151,151,1)  # mydomain=finley.Rectangle(151,151,1)
27  # mydomain=finley.Rectangle(128,128,1)  # mydomain=finley.Rectangle(128,128,1)
28
29  print "\nSetup domain and functions"  print "\nSetup domain and functions"
# Line 65  print "\nIterative Solver (1)=>" Line 65  print "\nIterative Solver (1)=>"
65  u_i=mypde.getSolution(iter_max=3000)  u_i=mypde.getSolution(iter_max=3000)
66
67  print "\nDirect Solver (1)=>"  print "\nDirect Solver (1)=>"
68  mypde.setSolverMethod(DIRECT)  mypde.setSolverMethod(mypde.DIRECT)
69  u_d=mypde.getSolution()  u_d=mypde.getSolution()
70
71  print "\n***************************************************************"  print "\n***************************************************************"
# Line 132  if error_norm > error_tol: Line 132  if error_norm > error_tol:
132  error=u_ex-u_i  error=u_ex-u_i
133  error_norm=error.Lsup()/norm_u_ex  error_norm=error.Lsup()/norm_u_ex
134  print "norm of the error for iterative solver is: ",error_norm  print "norm of the error for iterative solver is: ",error_norm
135  if error_norm > 10:  if error_norm >  error_tol:
136    print "### error norm exceeded maximum tolerance ###"    print "### error norm exceeded maximum tolerance ###"
137    sys.exit(1)    sys.exit(1)
138  print "******************************************************************"  print "******************************************************************"

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