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

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

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

revision 2816 by artak, Thu Dec 10 02:09:43 2009 UTC revision 2828 by artak, Tue Dec 22 01:24:40 2009 UTC
# Line 143  class SolverOptions(object): Line 143  class SolverOptions(object):
143      def __init__(self):      def __init__(self):
144          self.setLevelMax()          self.setLevelMax()
145          self.setCoarseningThreshold()          self.setCoarseningThreshold()
146            self.setSmoother()
147          self.setNumSweeps()          self.setNumSweeps()
148          self.setNumPreSweeps()          self.setNumPreSweeps()
149          self.setNumPostSweeps()          self.setNumPostSweeps()
# Line 199  class SolverOptions(object): Line 200  class SolverOptions(object):
200                  out+="\nMaximum number of levels = %s"%self.LevelMax()                  out+="\nMaximum number of levels = %s"%self.LevelMax()
201                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())
202                  out+="\nCoarsening threshold = %e"%self.getMinCoarseMatrixSize()                  out+="\nCoarsening threshold = %e"%self.getMinCoarseMatrixSize()
203                    out+="\nSmoother = %e"%self.getName(self.getSmoother())
204                  out+="\nMinimum size of the coarsest level matrix = %e"%self.getCoarseningThreshold()                  out+="\nMinimum size of the coarsest level matrix = %e"%self.getCoarseningThreshold()
205                  out+="\nNumber of pre / post sweeps = %s / %s, %s"%(self.getNumPreSweeps(), self.getNumPostSweeps(), self.getNumSweeps())                  out+="\nNumber of pre / post sweeps = %s / %s, %s"%(self.getNumPreSweeps(), self.getNumPostSweeps(), self.getNumSweeps())
206              if self.getPreconditioner() == self.AMLI:              if self.getPreconditioner() == self.AMLI:
# Line 426  class SolverOptions(object): Line 428  class SolverOptions(object):
428                                      `SolverOptions.NO_PRECONDITIONER`                                      `SolverOptions.NO_PRECONDITIONER`
429          """          """
430          return self.__preconditioner          return self.__preconditioner
431        def setSmoother(self, smoother=10):
432            """
433            Sets the smoother to be used.
434    
435            :param smoother: key of the smoother to be used.
436            :type smoother: in `SolverOptions.JACOBI`, `SolverOptions.GAUSS_SEIDEL`
437            :note: Not all packages support all smoothers. It can be assumed that a package makes a reasonable choice if it encounters an unknown smoother.
438            """
439        if smoother==None: smoother=10
440            if not smoother in [ SolverOptions.JACOBI, SolverOptions.GAUSS_SEIDEL ] :
441                 raise ValueError,"unknown smoother %s"%preconditioner
442            self.__smoother=smoother    
443        def getSmoother(self):
444            """
445            Returns key of the smoother to be used.
446    
447            :rtype: in the list `SolverOptions.JACOBI`, `SolverOptions.GAUSS_SEIDEL`
448            """
449            return self.__smoother  
450      def setSolverMethod(self, method=0):      def setSolverMethod(self, method=0):
451          """          """
452          Sets the solver method to be used. Use ``method``=``SolverOptions.DIRECT`` to indicate that a direct rather than an iterative          Sets the solver method to be used. Use ``method``=``SolverOptions.DIRECT`` to indicate that a direct rather than an iterative

Legend:
Removed from v.2816  
changed lines
  Added in v.2828

  ViewVC Help
Powered by ViewVC 1.1.26