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

revision 2060 by gross, Mon Nov 3 05:08:42 2008 UTC revision 2061 by jfenwick, Wed Nov 19 03:40:21 2008 UTC
# Line 513  def PCG(b, Aprod, Msolve, bilinearform, Line 513  def PCG(b, Aprod, Msolve, bilinearform,
513     @param b: the right hand side of the liner system. C{b} is altered.     @param b: the right hand side of the liner system. C{b} is altered.
514     @type b: any object supporting inplace add (x+=y) and scaling (x=scalar*y)     @type b: any object supporting inplace add (x+=y) and scaling (x=scalar*y)
515     @param Aprod: returns the value Ax     @param Aprod: returns the value Ax
516     @type Aprod: function C{Aprod(x)} where C{x} is of the same object like argument C{x}. The returned object needs to be of the same type like argument C{b}.     @type Aprod: function C{Aprod(x)} where C{x} is of the same object like argument C{x}.
517     @param Msolve: solves Mx=r         The returned object needs to be of the same type like argument C{b}.
518     @type Msolve: function C{Msolve(r)} where C{r} is of the same type like argument C{b}. The returned object needs to be of the same     @param Msolve: solves Mx=r
519  type like argument C{x}.     @type Msolve: function C{Msolve(r)} where C{r} is of the same type like argument C{b}.
520     @param bilinearform: inner product C{<x,r>}        The returned object needs to be of the same type like argument C{x}.
521     @type bilinearform: function C{bilinearform(x,r)} where C{x} is of the same type like argument C{x} and C{r} is . The returned value is a C{float}.     @param bilinearform: inner product C{<x,r>}
522     @param stoppingcriterium: function which returns True if a stopping criterium is meet. C{stoppingcriterium} has the arguments C{norm_r}, C{r} and C{x} giving the current norm of the residual (=C{sqrt(bilinearform(Msolve(r),r)}), the current residual and the current solution approximation. C{stoppingcriterium} is called in each iteration step.     @type bilinearform: function C{bilinearform(x,r)} where C{x} is of the same type like argument C{x} and C{r} is.
523           The returned value is a C{float}.
524       @param stoppingcriterium: function which returns True if a stopping criterium is meet.
525           C{stoppingcriterium} has the arguments C{norm_r}, C{r} and C{x} giving the current
526           norm of the residual (=C{sqrt(bilinearform(Msolve(r),r)}), the current residual and
527           the current solution approximation. C{stoppingcriterium} is called in each iteration step.
528     @type stoppingcriterium: function that returns C{True} or C{False}     @type stoppingcriterium: function that returns C{True} or C{False}
529     @param x: an initial guess for the solution. If no C{x} is given 0*b is used.     @param x: an initial guess for the solution. If no C{x} is given 0*b is used.
530     @type x: any object supporting inplace add (x+=y) and scaling (x=scalar*y)     @type x: any object supporting inplace add (x+=y) and scaling (x=scalar*y)