/[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 1484 by artak, Wed Apr 9 03:25:53 2008 UTC revision 1486 by artak, Thu Apr 10 00:10:50 2008 UTC
# Line 729  def MINRES(b, Aprod, Msolve, bilinearfor Line 729  def MINRES(b, Aprod, Msolve, bilinearfor
729      if beta1==0: return x*0.      if beta1==0: return x*0.
730    
731      if beta1> 0:      if beta1> 0:
732        beta1  = math.sqrt(beta1)       # Normalize y to get v1 later.        beta1  = math.sqrt(beta1)      
733    
734      #------------------------------------------------------------------      #------------------------------------------------------------------
735      # Initialize quantities.      # Initialize quantities.
# Line 757  def MINRES(b, Aprod, Msolve, bilinearfor Line 757  def MINRES(b, Aprod, Msolve, bilinearfor
757      #---------------------------------------------------------------------      #---------------------------------------------------------------------
758      # Main iteration loop.      # Main iteration loop.
759      # --------------------------------------------------------------------      # --------------------------------------------------------------------
760      while not stoppingcriterium(rnorm,Anorm*ynorm):    #  ||r|| / (||A|| ||x||)      while not stoppingcriterium(rnorm,Anorm*ynorm):    #  checks ||r|| < (||A|| ||x||) * TOL
761    
762      if iter  >= iter_max: raise MaxIterReached,"maximum number of %s steps reached."%iter_max      if iter  >= iter_max: raise MaxIterReached,"maximum number of %s steps reached."%iter_max
763          iter    = iter  +  1          iter    = iter  +  1
# Line 1088  class HomogeneousSaddlePointProblem(obje Line 1088  class HomogeneousSaddlePointProblem(obje
1088    
1089            if solver=='MINRES':                  if solver=='MINRES':      
1090                  if self.verbose: print "enter MINRES method (iter_max=%s)"%max_iter                  if self.verbose: print "enter MINRES method (iter_max=%s)"%max_iter
1091                  p=GMRES(Bz,self.__Aprod_GMRES,self.__Msolve_GMRES,self.__inner_p,self.__stoppingcriterium_MINRES,iter_max=max_iter, x=p*1.)                  p=MINRES(Bz,self.__Aprod_GMRES,self.__Msolve_GMRES,self.__inner_p,self.__stoppingcriterium_MINRES,iter_max=max_iter, x=p*1.)
1092                  # solve Au=f-B^*p                  # solve Au=f-B^*p
1093                  #       A(u-v)=f-B^*p-Av                  #       A(u-v)=f-B^*p-Av
1094                  #       u=v+(u-v)                  #       u=v+(u-v)

Legend:
Removed from v.1484  
changed lines
  Added in v.1486

  ViewVC Help
Powered by ViewVC 1.1.26