# Diff of /trunk/escript/py_src/flows.py

revision 1551 by artak, Wed May 7 23:11:44 2008 UTC revision 1552 by gross, Thu May 8 08:52:41 2008 UTC
# Line 131  class StokesProblemCartesian(Homogeneous Line 131  class StokesProblemCartesian(Homogeneous
131
132        def stoppingcriterium(self,Bv,v,p):        def stoppingcriterium(self,Bv,v,p):
133            n_r=util.sqrt(self.inner(Bv,Bv))            n_r=util.sqrt(self.inner(Bv,Bv))
135            if self.verbose: print "PCG step %s: L2(div(v)) = %s, Lsup(v)=%s"%(self.iter,n_r,n_v)            if self.verbose: print "PCG step %s: L2(div(v)) = %s, L2(grad(v))=%s"%(self.iter,n_r,n_v)
136              if self.iter == 0: self.__n_v=n_v;
137              self.__n_v, n_v_old =n_v, self.__n_v
138            self.iter+=1            self.iter+=1
139            if n_r <= self.vol**(1./2.-1./self.domain.getDim())*n_v*self.getTolerance():            print abs(n_v_old-self.__n_v), n_v, self.getTolerance()
140              if self.iter>1 and n_r <= n_v*self.getTolerance() and abs(n_v_old-self.__n_v) <= n_v * self.getTolerance():
141                if self.verbose: print "PCG terminated after %s steps."%self.iter                if self.verbose: print "PCG terminated after %s steps."%self.iter
142                return True                return True
143            else:            else:

Legend:
 Removed from v.1551 changed lines Added in v.1552