/[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 141 by jgs, Mon Jul 25 05:15:41 2005 UTC revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC
# Line 12  print "\nSimpleSolve.py" Line 12  print "\nSimpleSolve.py"
12  print "--------------"  print "--------------"
13    
14  alpha=0.025  alpha=0.025
15    error_tol=pow(10,-9)
16    
17  # generate mesh  # generate mesh
18    
# Line 63  print "\nIterative Solver (1)=>" Line 64  print "\nIterative Solver (1)=>"
64  # u_i=mypde.getSolution(preconditioner=ILU0,iter_max=3000)  # u_i=mypde.getSolution(preconditioner=ILU0,iter_max=3000)
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(DIRECT)
69  u_d=mypde.getSolution()  u_d=mypde.getSolution()
70    
71  print "\n***************************************************************"  print "\n***************************************************************"
72  error=u_ex-u_d  error=u_ex-u_d
73  print "norm of the error for direct solver is   : ",error.Lsup()/norm_u_ex  error_norm=error.Lsup()/norm_u_ex
74    print "norm of the error for direct solver is   : ",error_norm
75    if error_norm > error_tol:
76      print "### error norm exceeded maximum tolerance ###"
77      sys.exit(1)
78  error=u_ex-u_i  error=u_ex-u_i
79  print "norm of the error for iterative solver is: ",error.Lsup()/norm_u_ex  error_norm=error.Lsup()/norm_u_ex
80    print "norm of the error for iterative solver is: ",error_norm
81    if error_norm > error_tol:
82      print "### error norm exceeded maximum tolerance ###"
83      sys.exit(1)
84  print "***************************************************************"  print "***************************************************************"
85    
86  # get handles to nodes and elements 2  # get handles to nodes and elements 2
# Line 116  u_i=mypde.getSolution(iter_max=3000) Line 124  u_i=mypde.getSolution(iter_max=3000)
124    
125  print "\n******************************************************************"  print "\n******************************************************************"
126  error=u_ex-u_d  error=u_ex-u_d
127  print "norm of the error for direct solver is   : ",error.Lsup()/norm_u_ex  error_norm=error.Lsup()/norm_u_ex
128    print "norm of the error for direct solver is   : ",error_norm
129    if error_norm > error_tol:
130      print "### error norm exceeded maximum tolerance ###"
131      sys.exit(1)
132  error=u_ex-u_i  error=u_ex-u_i
133  print "norm of the error for iterative solver is: ",error.Lsup()/norm_u_ex  error_norm=error.Lsup()/norm_u_ex
134    print "norm of the error for iterative solver is: ",error_norm
135    if error_norm > 10:
136      print "### error norm exceeded maximum tolerance ###"
137      sys.exit(1)
138  print "******************************************************************"  print "******************************************************************"
139    
140  print "\n-----"  print "\n-----"
141  print "Done."  print "Done."
142  print "-----"  print "-----"
143    
144    sys.exit(0)

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

  ViewVC Help
Powered by ViewVC 1.1.26