/[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 2263 by gross, Tue Feb 10 08:38:53 2009 UTC revision 2264 by gross, Wed Feb 11 06:48:28 2009 UTC
# Line 534  def PCG(r, Aprod, x, Msolve, bilinearfor Line 534  def PCG(r, Aprod, x, Msolve, bilinearfor
534         if rhat_dot_r<0: raise NegativeNorm,"negative norm."         if rhat_dot_r<0: raise NegativeNorm,"negative norm."
535         if verbose: print "PCG: iteration step %s: residual norm = %e"%(iter, math.sqrt(rhat_dot_r))         if verbose: print "PCG: iteration step %s: residual norm = %e"%(iter, math.sqrt(rhat_dot_r))
536     if verbose: print "PCG: tolerance reached after %s steps."%iter     if verbose: print "PCG: tolerance reached after %s steps."%iter
537     return x,r     return x,r,math.sqrt(rhat_dot_r)
538    
539  class Defect(object):  class Defect(object):
540      """      """
# Line 1625  class HomogeneousSaddlePointProblem(obje Line 1625  class HomogeneousSaddlePointProblem(obje
1625                   ATOL_ITER=ATOL/norm_Bv*norm2                   ATOL_ITER=ATOL/norm_Bv*norm2
1626                   if self.verbose: print "saddle point solver: tolerance for solver: %e"%ATOL_ITER                   if self.verbose: print "saddle point solver: tolerance for solver: %e"%ATOL_ITER
1627                   if usePCG:                   if usePCG:
1628                         p,v0=PCG(v,self.__Aprod_PCG,p,self.__Msolve_PCG,self.__inner_PCG,atol=ATOL_ITER, rtol=0.,iter_max=max_iter, verbose=self.verbose)                         p,v0,a_norm=PCG(v,self.__Aprod_PCG,p,self.__Msolve_PCG,self.__inner_PCG,atol=ATOL_ITER, rtol=0.,iter_max=max_iter, verbose=self.verbose)
1629                   else:                   else:
1630                         p=GMRES(dp,self.__Aprod_GMRES, p, self.__inner_GMRES,atol=ATOL_ITER, rtol=0.,iter_max=max_iter, iter_restart=iter_restart, verbose=self.verbose)                         p=GMRES(dp,self.__Aprod_GMRES, p, self.__inner_GMRES,atol=ATOL_ITER, rtol=0.,iter_max=max_iter, iter_restart=iter_restart, verbose=self.verbose)
1631           if self.verbose: print "saddle point solver: tolerance reached."           if self.verbose: print "saddle point solver: tolerance reached."

Legend:
Removed from v.2263  
changed lines
  Added in v.2264

  ViewVC Help
Powered by ViewVC 1.1.26