/[escript]/trunk/escript/py_src/pdetools.py
ViewVC logotype

Diff of /trunk/escript/py_src/pdetools.py

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

revision 1557 by artak, Mon May 19 04:44:27 2008 UTC revision 1639 by gross, Mon Jul 14 08:55:25 2008 UTC
# Line 474  class IterationHistory(object): Line 474  class IterationHistory(object):
474    
475         """         """
476         self.history.append(norm_r)         self.history.append(norm_r)
477         if self.verbose: print "iter: #s:  inner(rhat,r) = #e"#(len(self.history)-1, self.history[-1])         if self.verbose: print "iter: %s:  inner(rhat,r) = %e"#(len(self.history)-1, self.history[-1])
478         return self.history[-1]<=self.tolerance * self.history[0]         return self.history[-1]<=self.tolerance * self.history[0]
479    
480     def stoppingcriterium2(self,norm_r,norm_b,solver="GMRES",TOL=None):     def stoppingcriterium2(self,norm_r,norm_b,solver="GMRES",TOL=None):
# Line 493  class IterationHistory(object): Line 493  class IterationHistory(object):
493         if TOL==None:         if TOL==None:
494            TOL=self.tolerance            TOL=self.tolerance
495         self.history.append(norm_r)         self.history.append(norm_r)
496         if self.verbose: print "iter: #s:  norm(r) = #e"#(len(self.history)-1, self.history[-1])         if self.verbose: print "iter: %s:  norm(r) = %e"#(len(self.history)-1, self.history[-1])
497         return self.history[-1]<=TOL * norm_b         return self.history[-1]<=TOL * norm_b
498    
499  def PCG(b, Aprod, Msolve, bilinearform, stoppingcriterium, x=None, iter_max=100):  def PCG(b, Aprod, Msolve, bilinearform, stoppingcriterium, x=None, iter_max=100):
# Line 1044  def NewtonGMRES(b, Aprod, Msolve, biline Line 1044  def NewtonGMRES(b, Aprod, Msolve, biline
1044              etanew=gamma*rat*rat              etanew=gamma*rat*rat
1045              if gamma*etaold*etaold > .1 :              if gamma*etaold*etaold > .1 :
1046                  etanew=max(etanew,gamma*etaold*etaold)                  etanew=max(etanew,gamma*etaold*etaold)
               
1047              etamax=min(etanew,etamax)              etamax=min(etanew,etamax)
1048              etamax=max(etamax,.5*stop_tol/fnrm)              etamax=max(etamax,.5*stop_tol/fnrm)
   
1049      return x      return x
1050    
1051  def TFQMR(b, Aprod, Msolve, bilinearform, stoppingcriterium, x=None, iter_max=100):  def TFQMR(b, Aprod, Msolve, bilinearform, stoppingcriterium, x=None, iter_max=100):
# Line 1604  class SaddlePointProblem(object): Line 1602  class SaddlePointProblem(object):
1602         @param text: a text message         @param text: a text message
1603         @type text: C{str}         @type text: C{str}
1604         """         """
1605         if self.__verbose: print "#s: #s"%(str(self),text)         if self.__verbose: print "%s: %s"%(str(self),text)
1606    
1607     def solve_f(self,u,p,tol=1.e-8):     def solve_f(self,u,p,tol=1.e-8):
1608         """         """

Legend:
Removed from v.1557  
changed lines
  Added in v.1639

  ViewVC Help
Powered by ViewVC 1.1.26