# Diff of /branches/windows_from_1456_trunk_1490_merged_in/escript/py_src/flows.py

revision 1521 by trankine, Mon Apr 14 06:43:51 2008 UTC revision 1522 by phornby, Tue Apr 22 06:13:48 2008 UTC
# Line 123  class StokesProblemCartesian(Homogeneous Line 123  class StokesProblemCartesian(Homogeneous
123                return True                return True
124            else:            else:
125                return False                return False
126        def stoppingcriterium_GMRES(self,norm_r,norm_b):        def stoppingcriterium2(self,norm_r,norm_b,solver='GMRES',TOL=None):
127            if self.verbose: print "GMRES step %s: L2(r) = %s, L2(b)*TOL=%s"%(self.iter,norm_r,norm_b*self.getTolerance())        if TOL==None:
128                 TOL=self.getTolerance()
129              if self.verbose: print "%s step %s: L2(r) = %s, L2(b)*TOL=%s"%(solver,self.iter,norm_r,norm_b*TOL)
130            self.iter+=1            self.iter+=1
131            if norm_r <= norm_b*self.getTolerance():
132                if self.verbose: print "GMRES terminated after %s steps."%self.iter            if norm_r <= norm_b*TOL:
133                  if self.verbose: print "%s terminated after %s steps."%(solver,self.iter)
134                return True                return True
135            else:            else:
136                return False                return False
137
138        def stoppingcriterium_MINRES(self,norm_r,norm_Ax):
if self.verbose: print "MINRES step %s: L2(r) = %s, L2(b)*TOL=%s"%(self.iter,norm_r,norm_Ax*self.getTolerance())
self.iter+=1
if norm_r <= norm_Ax*self.getTolerance():
if self.verbose: print "MINRES terminated after %s steps."%self.iter
return True
else:
return False

Legend:
 Removed from v.1521 changed lines Added in v.1522