/[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 2994 by artak, Tue Mar 23 06:13:14 2010 UTC revision 3051 by lgao, Tue Jun 29 00:45:49 2010 UTC
# Line 90  class SolverOptions(object): Line 90  class SolverOptions(object):
90      :cvar REC_ILU: recursive ILU0      :cvar REC_ILU: recursive ILU0
91      :cvar RILU: relaxed ILU0      :cvar RILU: relaxed ILU0
92      :cvar GAUSS_SEIDEL: Gauss-Seidel solver      :cvar GAUSS_SEIDEL: Gauss-Seidel solver
93        :cvar GAUSS_SEIDEL_MPI: MPI versioned Gauss-Seidel solver
94      :cvar DEFAULT_REORDERING: the reordering method recommended by the solver      :cvar DEFAULT_REORDERING: the reordering method recommended by the solver
95      :cvar SUPER_LU: the Super_LU solver package      :cvar SUPER_LU: the Super_LU solver package
96      :cvar PASTIX: the Pastix direct solver_package      :cvar PASTIX: the Pastix direct solver_package
# Line 139  class SolverOptions(object): Line 140  class SolverOptions(object):
140      MIN_COARSE_MATRIX_SIZE=37      MIN_COARSE_MATRIX_SIZE=37
141      AMLI=38      AMLI=38
142      STANDARD_COARSENING=39      STANDARD_COARSENING=39
143        GAUSS_SEIDEL_MPI=40
144    
145      def __init__(self):      def __init__(self):
146          self.setLevelMax()          self.setLevelMax()
# Line 211  class SolverOptions(object): Line 213  class SolverOptions(object):
213                  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())
214          if self.getPreconditioner() == self.GAUSS_SEIDEL:          if self.getPreconditioner() == self.GAUSS_SEIDEL:
215                  out+="\nNumber of sweeps = %s"%self.getNumSweeps()                  out+="\nNumber of sweeps = %s"%self.getNumSweeps()
216                if self.getPreconditioner() == self.GAUSS_SEIDEL_MPI:
217                    out+="\nNumber of sweeps = %s"%self.getNumSweeps()
218              if self.getPreconditioner() == self.ILUT:              if self.getPreconditioner() == self.ILUT:
219                  out+="\nDrop tolerance = %e"%self.getDropTolerance()                  out+="\nDrop tolerance = %e"%self.getDropTolerance()
220                  out+="\nStorage increase = %e"%self.getDropStorage()                  out+="\nStorage increase = %e"%self.getDropStorage()
# Line 253  class SolverOptions(object): Line 257  class SolverOptions(object):
257          if key == self.TFQMR: return "TFQMR"          if key == self.TFQMR: return "TFQMR"
258          if key == self.MINRES: return "MINRES"          if key == self.MINRES: return "MINRES"
259          if key == self.GAUSS_SEIDEL: return "GAUSS_SEIDEL"          if key == self.GAUSS_SEIDEL: return "GAUSS_SEIDEL"
260            if key == self.GAUSS_SEIDEL_MPI: return "GAUSS_SEIDEL_MPI"
261          if key == self.RILU: return "RILU"          if key == self.RILU: return "RILU"
262          if key == self.DEFAULT_REORDERING: return "DEFAULT_REORDERING"          if key == self.DEFAULT_REORDERING: return "DEFAULT_REORDERING"
263          if key == self.SUPER_LU: return "SUPER_LU"          if key == self.SUPER_LU: return "SUPER_LU"
# Line 409  class SolverOptions(object): Line 414  class SolverOptions(object):
414    
415          :param preconditioner: key of the preconditioner to be used.          :param preconditioner: key of the preconditioner to be used.
416          :type preconditioner: in `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,          :type preconditioner: in `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,
417                                      `SolverOptions.AMG`, `SolverOptions.AMLI`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.RILU`,                                      `SolverOptions.AMG`, `SolverOptions.AMLI`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`, `SolverOptions.RILU`,
418                                      `SolverOptions.NO_PRECONDITIONER`                                      `SolverOptions.NO_PRECONDITIONER`
419          :note: Not all packages support all preconditioner. It can be assumed that a package makes a reasonable choice if it encounters an unknown preconditioner.          :note: Not all packages support all preconditioner. It can be assumed that a package makes a reasonable choice if it encounters an unknown preconditioner.
420          """          """
421      if preconditioner==None: preconditioner=10      if preconditioner==None: preconditioner=10
422          if not preconditioner in [ SolverOptions.SSOR, SolverOptions.ILU0, SolverOptions.ILUT, SolverOptions.JACOBI,          if not preconditioner in [ SolverOptions.SSOR, SolverOptions.ILU0, SolverOptions.ILUT, SolverOptions.JACOBI,
423                                      SolverOptions.AMG, SolverOptions.AMLI, SolverOptions.REC_ILU, SolverOptions.GAUSS_SEIDEL, SolverOptions.RILU,                                      SolverOptions.AMG, SolverOptions.AMLI, SolverOptions.REC_ILU, SolverOptions.GAUSS_SEIDEL, SolverOptions.GAUSS_SEIDEL_MPI, SolverOptions.RILU,
424                                      SolverOptions.NO_PRECONDITIONER] :                                      SolverOptions.NO_PRECONDITIONER] :
425               raise ValueError,"unknown preconditioner %s"%preconditioner               raise ValueError,"unknown preconditioner %s"%preconditioner
426          self.__preconditioner=preconditioner              self.__preconditioner=preconditioner    
# Line 424  class SolverOptions(object): Line 429  class SolverOptions(object):
429          Returns key of the preconditioner to be used.          Returns key of the preconditioner to be used.
430    
431          :rtype: in the list `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,          :rtype: in the list `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,
432                                      `SolverOptions.AMG`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.RILU`,                                      `SolverOptions.AMG`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`, `SolverOptions.RILU`,
433                                      `SolverOptions.NO_PRECONDITIONER`                                      `SolverOptions.NO_PRECONDITIONER`
434          """          """
435          return self.__preconditioner          return self.__preconditioner
# Line 458  class SolverOptions(object): Line 463  class SolverOptions(object):
463                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,
464                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,
465                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,
466                          `SolverOptions.GAUSS_SEIDEL`                          `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`
467          :note: Not all packages support all solvers. It can be assumed that a package makes a reasonable choice if it encounters an unknown solver method.          :note: Not all packages support all solvers. It can be assumed that a package makes a reasonable choice if it encounters an unknown solver method.
468          """          """
469      if method==None: method=0      if method==None: method=0
470          if not method in [ SolverOptions.DEFAULT, SolverOptions.DIRECT, SolverOptions.CHOLEVSKY, SolverOptions.PCG,          if not method in [ SolverOptions.DEFAULT, SolverOptions.DIRECT, SolverOptions.CHOLEVSKY, SolverOptions.PCG,
471                             SolverOptions.CR, SolverOptions.CGS, SolverOptions.BICGSTAB, SolverOptions.SSOR,                             SolverOptions.CR, SolverOptions.CGS, SolverOptions.BICGSTAB, SolverOptions.SSOR,
472                             SolverOptions.GMRES, SolverOptions.PRES20, SolverOptions.LUMPING, SolverOptions.ITERATIVE, SolverOptions.AMG,                             SolverOptions.GMRES, SolverOptions.PRES20, SolverOptions.LUMPING, SolverOptions.ITERATIVE, SolverOptions.AMG,
473                             SolverOptions.NONLINEAR_GMRES, SolverOptions.TFQMR, SolverOptions.MINRES, SolverOptions.GAUSS_SEIDEL]:                             SolverOptions.NONLINEAR_GMRES, SolverOptions.TFQMR, SolverOptions.MINRES, SolverOptions.GAUSS_SEIDEL, SolverOptions.GAUSS_SEIDEL_MPI]:
474               raise ValueError,"unknown solver method %s"%method               raise ValueError,"unknown solver method %s"%method
475          self.__method=method          self.__method=method
476      def getSolverMethod(self):      def getSolverMethod(self):
# Line 476  class SolverOptions(object): Line 481  class SolverOptions(object):
481                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,
482                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,
483                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,
484                          `SolverOptions.GAUSS_SEIDEL`                          `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`
485          """          """
486          return self.__method          return self.__method
487                    

Legend:
Removed from v.2994  
changed lines
  Added in v.3051

  ViewVC Help
Powered by ViewVC 1.1.26