/[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 3071 by gross, Wed Jul 21 05:37:30 2010 UTC revision 3094 by gross, Fri Aug 13 08:38:06 2010 UTC
# Line 1  Line 1 
1    # -*- coding: utf-8 -*-
2    
3  ########################################################  ########################################################
4  #  #
# Line 69  class SolverOptions(object): Line 70  class SolverOptions(object):
70      :cvar BICGSTAB: The stabilized Bi-Conjugate Gradient method      :cvar BICGSTAB: The stabilized Bi-Conjugate Gradient method
71      :cvar TFQMR: Transpose Free Quasi Minimal Residual method      :cvar TFQMR: Transpose Free Quasi Minimal Residual method
72      :cvar MINRES: Minimum residual method      :cvar MINRES: Minimum residual method
     :cvar SSOR: The symmetric over-relaxation method  
73      :cvar ILU0: The incomplete LU factorization preconditioner with no fill-in      :cvar ILU0: The incomplete LU factorization preconditioner with no fill-in
74      :cvar ILUT: The incomplete LU factorization preconditioner with fill-in      :cvar ILUT: The incomplete LU factorization preconditioner with fill-in
75      :cvar JACOBI: The Jacobi preconditioner      :cvar JACOBI: The Jacobi preconditioner
# Line 89  class SolverOptions(object): Line 89  class SolverOptions(object):
89      :cvar AMLI: Algebraic Multi Level Iteration      :cvar AMLI: Algebraic Multi Level Iteration
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 preconditioner
     :cvar GAUSS_SEIDEL_MPI: MPI versioned Gauss-Seidel solver  
93      :cvar DEFAULT_REORDERING: the reordering method recommended by the solver      :cvar DEFAULT_REORDERING: the reordering method recommended by the solver
94      :cvar SUPER_LU: the Super_LU solver package      :cvar SUPER_LU: the Super_LU solver package
95      :cvar PASTIX: the Pastix direct solver_package      :cvar PASTIX: the Pastix direct solver_package
# Line 108  class SolverOptions(object): Line 107  class SolverOptions(object):
107      CR= 4      CR= 4
108      CGS= 5      CGS= 5
109      BICGSTAB= 6      BICGSTAB= 6
     SSOR= 7  
110      ILU0= 8      ILU0= 8
111      ILUT= 9      ILUT= 9
112      JACOBI= 10      JACOBI= 10
# Line 140  class SolverOptions(object): Line 138  class SolverOptions(object):
138      MIN_COARSE_MATRIX_SIZE=37      MIN_COARSE_MATRIX_SIZE=37
139      AMLI=38      AMLI=38
140      STANDARD_COARSENING=39      STANDARD_COARSENING=39
     GAUSS_SEIDEL_MPI=40  
141    
142      def __init__(self):      def __init__(self):
143          self.setLevelMax()          self.setLevelMax()
# Line 169  class SolverOptions(object): Line 166  class SolverOptions(object):
166          self.setCoarsening()          self.setCoarsening()
167          self.setMinCoarseMatrixSize()          self.setMinCoarseMatrixSize()
168          self.setRelaxationFactor()                  self.setRelaxationFactor()        
169            self.setLocalPreconditionerOff()
170          self.resetDiagnostics(all=True)          self.resetDiagnostics(all=True)
171    
172      def __str__(self):      def __str__(self):
# Line 184  class SolverOptions(object): Line 182  class SolverOptions(object):
182          out+="\nAbsolute tolerance = %e"%self.getAbsoluteTolerance()          out+="\nAbsolute tolerance = %e"%self.getAbsoluteTolerance()
183          out+="\nSymmetric problem = %s"%self.isSymmetric()          out+="\nSymmetric problem = %s"%self.isSymmetric()
184          out+="\nMaximum number of iteration steps = %s"%self.getIterMax()          out+="\nMaximum number of iteration steps = %s"%self.getIterMax()
185          out+="\nInner tolerance = %e"%self.getInnerTolerance()          # out+="\nInner tolerance = %e"%self.getInnerTolerance()
186          out+="\nAdapt innner tolerance = %s"%self.adaptInnerTolerance()          # out+="\nAdapt innner tolerance = %s"%self.adaptInnerTolerance()
187            
188          if self.getPackage() == self.PASO:          if self.getPackage() == self.PASO:
189              out+="\nSolver method = %s"%self.getName(self.getSolverMethod())              out+="\nSolver method = %s"%self.getName(self.getSolverMethod())
# Line 196  class SolverOptions(object): Line 194  class SolverOptions(object):
194                  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())
195                  out+="\nMaximum number of levels = %s"%self.LevelMax()                  out+="\nMaximum number of levels = %s"%self.LevelMax()
196                  out+="\nCoarsening threshold = %e"%self.getCoarseningThreshold()                  out+="\nCoarsening threshold = %e"%self.getCoarseningThreshold()
197                  out+="\Coarsening method = %s"%self.getName(self.getCoarsening())                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())
198              out+="\nPreconditioner = %s"%self.getName(self.getPreconditioner())              out+="\nPreconditioner = %s"%self.getName(self.getPreconditioner())
199                out+="\nApply preconditioner locally = %s"%self.useLocalPreconditioner()
200              if self.getPreconditioner() == self.AMG:              if self.getPreconditioner() == self.AMG:
201                  out+="\nMaximum number of levels = %s"%self.LevelMax()                  out+="\nMaximum number of levels = %s"%self.LevelMax()
202                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())
# Line 213  class SolverOptions(object): Line 212  class SolverOptions(object):
212                  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())
213          if self.getPreconditioner() == self.GAUSS_SEIDEL:          if self.getPreconditioner() == self.GAUSS_SEIDEL:
214                  out+="\nNumber of sweeps = %s"%self.getNumSweeps()                  out+="\nNumber of sweeps = %s"%self.getNumSweeps()
             if self.getPreconditioner() == self.GAUSS_SEIDEL_MPI:  
                 out+="\nNumber of sweeps = %s"%self.getNumSweeps()  
215              if self.getPreconditioner() == self.ILUT:              if self.getPreconditioner() == self.ILUT:
216                  out+="\nDrop tolerance = %e"%self.getDropTolerance()                  out+="\nDrop tolerance = %e"%self.getDropTolerance()
217                  out+="\nStorage increase = %e"%self.getDropStorage()                  out+="\nStorage increase = %e"%self.getDropStorage()
# Line 235  class SolverOptions(object): Line 232  class SolverOptions(object):
232          if key == self.CR: return "CR"          if key == self.CR: return "CR"
233          if key == self.CGS: return "CGS"          if key == self.CGS: return "CGS"
234          if key == self.BICGSTAB: return "BICGSTAB"          if key == self.BICGSTAB: return "BICGSTAB"
         if key == self.SSOR: return "SSOR"  
235          if key == self.ILU0: return "ILU0:"          if key == self.ILU0: return "ILU0:"
236          if key == self.ILUT: return "ILUT"          if key == self.ILUT: return "ILUT"
237          if key == self.JACOBI: return "JACOBI"          if key == self.JACOBI: return "JACOBI"
# Line 257  class SolverOptions(object): Line 253  class SolverOptions(object):
253          if key == self.TFQMR: return "TFQMR"          if key == self.TFQMR: return "TFQMR"
254          if key == self.MINRES: return "MINRES"          if key == self.MINRES: return "MINRES"
255          if key == self.GAUSS_SEIDEL: return "GAUSS_SEIDEL"          if key == self.GAUSS_SEIDEL: return "GAUSS_SEIDEL"
         if key == self.GAUSS_SEIDEL_MPI: return "GAUSS_SEIDEL_MPI"  
256          if key == self.RILU: return "RILU"          if key == self.RILU: return "RILU"
257          if key == self.DEFAULT_REORDERING: return "DEFAULT_REORDERING"          if key == self.DEFAULT_REORDERING: return "DEFAULT_REORDERING"
258          if key == self.SUPER_LU: return "SUPER_LU"          if key == self.SUPER_LU: return "SUPER_LU"
# Line 267  class SolverOptions(object): Line 262  class SolverOptions(object):
262          if key == self.STANDARD_COARSENING: return "STANDARD_COARSENING"          if key == self.STANDARD_COARSENING: return "STANDARD_COARSENING"
263          if key == self.AGGREGATION_COARSENING: return "AGGREGATION_COARSENING"          if key == self.AGGREGATION_COARSENING: return "AGGREGATION_COARSENING"
264          if key == self.NO_PRECONDITIONER: return "NO_PRECONDITIONER"          if key == self.NO_PRECONDITIONER: return "NO_PRECONDITIONER"
         if key == self.MIN_COARSE_MATRIX_SIZE: return "MIN_COARSE_MATRIX_SIZE"  
265                    
266      def resetDiagnostics(self,all=False):      def resetDiagnostics(self,all=False):
267          """          """
# Line 284  class SolverOptions(object): Line 278  class SolverOptions(object):
278          self.__net_time=None          self.__net_time=None
279          self.__residual_norm=None          self.__residual_norm=None
280          self.__converged=None          self.__converged=None
281            self.__preconditioner_size=-1
282          if all:          if all:
283              self.__cum_num_inner_iter=0              self.__cum_num_inner_iter=0
284              self.__cum_num_iter=0              self.__cum_num_iter=0
# Line 336  class SolverOptions(object): Line 331  class SolverOptions(object):
331          - "cum_set_up_time": cumulative time to set up of the solver          - "cum_set_up_time": cumulative time to set up of the solver
332          - "net_time": net execution time, excluding setup time for the solver and execution time for preconditioner          - "net_time": net execution time, excluding setup time for the solver and execution time for preconditioner
333          - "cum_net_time": cumulative net execution time          - "cum_net_time": cumulative net execution time
334          - "residual_norm": norm of the final residual          - "preconditioner_size": size of preconditioner [Bytes]
335          - "converged": return self.__converged          - "converged": return self.__converged
       
336            
337                    
338          :param name: name of diagnostic information to return          :param name: name of diagnostic information to return
# Line 359  class SolverOptions(object): Line 353  class SolverOptions(object):
353          elif name == "cum_net_time": return self.__cum_net_time          elif name == "cum_net_time": return self.__cum_net_time
354          elif name == "residual_norm": return self.__residual_norm          elif name == "residual_norm": return self.__residual_norm
355          elif name == "converged": return self.__converged                elif name == "converged": return self.__converged      
356            elif name == "preconditioner_size": return  self.__preconditioner_size
357          else:          else:
358              raise ValueError,"unknown diagnostic item %s"%name              raise ValueError,"unknown diagnostic item %s"%name
359      def hasConverged(self):      def hasConverged(self):
# Line 369  class SolverOptions(object): Line 364  class SolverOptions(object):
364          return self.getDiagnostics("converged")          return self.getDiagnostics("converged")
365      def setCoarsening(self,method=0):      def setCoarsening(self,method=0):
366          """          """
367          Sets the key of the coarsening method to be applied in AMG.          Sets the key of the coarsening method to be applied in AMG or AMLI
368    
369          :param method: selects the coarsening method .          :param method: selects the coarsening method .
370          :type method: in {SolverOptions.DEFAULT}, `SolverOptions.YAIR_SHAPIRA_COARSENING`,  `SolverOptions.RUGE_STUEBEN_COARSENING`, `SolverOptions.AGGREGATION_COARSENING`          :type method: in {SolverOptions.DEFAULT}, `SolverOptions.YAIR_SHAPIRA_COARSENING`,  `SolverOptions.RUGE_STUEBEN_COARSENING`, `SolverOptions.AGGREGATION_COARSENING`
# Line 381  class SolverOptions(object): Line 376  class SolverOptions(object):
376            
377      def getCoarsening(self):      def getCoarsening(self):
378          """          """
379          Returns the key of the coarsening algorithm to be applied AMG.          Returns the key of the coarsening algorithm to be applied AMG or AMLI
380    
381          :rtype: in the list `SolverOptions.DEFAULT`, `SolverOptions.YAIR_SHAPIRA_COARSENING`, `SolverOptions.RUGE_STUEBEN_COARSENING`, `SolverOptions.AGGREGATION_COARSENING`          :rtype: in the list `SolverOptions.DEFAULT`, `SolverOptions.YAIR_SHAPIRA_COARSENING`, `SolverOptions.RUGE_STUEBEN_COARSENING`, `SolverOptions.AGGREGATION_COARSENING`
382          """          """
# Line 389  class SolverOptions(object): Line 384  class SolverOptions(object):
384                
385      def setMinCoarseMatrixSize(self,size=500):      def setMinCoarseMatrixSize(self,size=500):
386          """          """
387          Sets the minumum size of the coarsest level matrix in AMG.          Sets the minumum size of the coarsest level matrix in AMG or AMLI
388    
389          :param size: minumum size of the coarsest level matrix .          :param size: minumum size of the coarsest level matrix .
390          :type size: positive ``int`` or ``None``          :type size: positive ``int`` or ``None``
391          """          """
392        if size==None: size=500
393          size=int(size)          size=int(size)
394          if size<0:          if size<0:
395             raise ValueError,"minumum size of the coarsest level matrix must be non-negative."             raise ValueError,"minumum size of the coarsest level matrix must be non-negative."
     if size==None: size=500  
396          self.__MinCoarseMatrixSize=size          self.__MinCoarseMatrixSize=size
397                    
398      def getMinCoarseMatrixSize(self):      def getMinCoarseMatrixSize(self):
399          """          """
400          Returns the minumum size of the coarsest level matrix in AMG.          Returns the minumum size of the coarsest level matrix in AMG or AMLI
401    
402          :rtype: ``int``          :rtype: ``int``
403          """          """
# Line 413  class SolverOptions(object): Line 408  class SolverOptions(object):
408          Sets the preconditioner to be used.          Sets the preconditioner to be used.
409    
410          :param preconditioner: key of the preconditioner to be used.          :param preconditioner: key of the preconditioner to be used.
411          :type preconditioner: in `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,          :type preconditioner: in `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,
412                                      `SolverOptions.AMG`, `SolverOptions.AMLI`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`, `SolverOptions.RILU`,                                      `SolverOptions.AMG`, `SolverOptions.AMLI`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.RILU`,
413                                      `SolverOptions.NO_PRECONDITIONER`                                      `SolverOptions.NO_PRECONDITIONER`
414          :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.
415          """          """
416      if preconditioner==None: preconditioner=10      if preconditioner==None: preconditioner=10
417          if not preconditioner in [ SolverOptions.SSOR, SolverOptions.ILU0, SolverOptions.ILUT, SolverOptions.JACOBI,          if not preconditioner in [  SolverOptions.ILU0, SolverOptions.ILUT, SolverOptions.JACOBI,
418                                      SolverOptions.AMG, SolverOptions.AMLI, SolverOptions.REC_ILU, SolverOptions.GAUSS_SEIDEL, SolverOptions.GAUSS_SEIDEL_MPI, SolverOptions.RILU,                                      SolverOptions.AMG, SolverOptions.AMLI, SolverOptions.REC_ILU, SolverOptions.GAUSS_SEIDEL, SolverOptions.RILU,
419                                      SolverOptions.NO_PRECONDITIONER] :                                      SolverOptions.NO_PRECONDITIONER] :
420               raise ValueError,"unknown preconditioner %s"%preconditioner               raise ValueError,"unknown preconditioner %s"%preconditioner
421          self.__preconditioner=preconditioner              self.__preconditioner=preconditioner    
# Line 428  class SolverOptions(object): Line 423  class SolverOptions(object):
423          """          """
424          Returns key of the preconditioner to be used.          Returns key of the preconditioner to be used.
425    
426          :rtype: in the list `SolverOptions.SSOR`, `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`,          :rtype: in the list `SolverOptions.ILU0`, `SolverOptions.ILUT`, `SolverOptions.JACOBI`, SolverOptions.AMLI,
427                                      `SolverOptions.AMG`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`, `SolverOptions.RILU`,                                      `SolverOptions.AMG`, `SolverOptions.REC_ILU`, `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.RILU`,
428                                      `SolverOptions.NO_PRECONDITIONER`                                      `SolverOptions.NO_PRECONDITIONER`
429          """          """
430          return self.__preconditioner          return self.__preconditioner
431      def setSmoother(self, smoother=28):      def setSmoother(self, smoother=None):
432          """          """
433          Sets the smoother to be used.          Sets the smoother to be used.
434    
# Line 460  class SolverOptions(object): Line 455  class SolverOptions(object):
455    
456          :param method: key of the solver method to be used.          :param method: key of the solver method to be used.
457          :type method: in `SolverOptions.DEFAULT`, `SolverOptions.DIRECT`, `SolverOptions.CHOLEVSKY`, `SolverOptions.PCG`,          :type method: in `SolverOptions.DEFAULT`, `SolverOptions.DIRECT`, `SolverOptions.CHOLEVSKY`, `SolverOptions.PCG`,
458                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`,
459                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,
460                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,                          `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`
                         `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`  
461          :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.
462          """          """
463      if method==None: method=0      if method==None: method=0
464          if not method in [ SolverOptions.DEFAULT, SolverOptions.DIRECT, SolverOptions.CHOLEVSKY, SolverOptions.PCG,          if not method in [ SolverOptions.DEFAULT, SolverOptions.DIRECT, SolverOptions.CHOLEVSKY, SolverOptions.PCG,
465                             SolverOptions.CR, SolverOptions.CGS, SolverOptions.BICGSTAB, SolverOptions.SSOR,                             SolverOptions.CR, SolverOptions.CGS, SolverOptions.BICGSTAB,
466                             SolverOptions.GMRES, SolverOptions.PRES20, SolverOptions.LUMPING, SolverOptions.ITERATIVE, SolverOptions.AMG,                             SolverOptions.GMRES, SolverOptions.PRES20, SolverOptions.LUMPING, SolverOptions.ITERATIVE,
467                             SolverOptions.NONLINEAR_GMRES, SolverOptions.TFQMR, SolverOptions.MINRES, SolverOptions.GAUSS_SEIDEL, SolverOptions.GAUSS_SEIDEL_MPI]:                             SolverOptions.NONLINEAR_GMRES, SolverOptions.TFQMR, SolverOptions.MINRES ]:
468               raise ValueError,"unknown solver method %s"%method               raise ValueError,"unknown solver method %s"%method
469          self.__method=method          self.__method=method
470      def getSolverMethod(self):      def getSolverMethod(self):
# Line 478  class SolverOptions(object): Line 472  class SolverOptions(object):
472          Returns key of the solver method to be used.          Returns key of the solver method to be used.
473    
474          :rtype: in the list `SolverOptions.DEFAULT`, `SolverOptions.DIRECT`, `SolverOptions.CHOLEVSKY`, `SolverOptions.PCG`,          :rtype: in the list `SolverOptions.DEFAULT`, `SolverOptions.DIRECT`, `SolverOptions.CHOLEVSKY`, `SolverOptions.PCG`,
475                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`, `SolverOptions.SSOR`,                          `SolverOptions.CR`, `SolverOptions.CGS`, `SolverOptions.BICGSTAB`,
476                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,                          `SolverOptions.GMRES`, `SolverOptions.PRES20`, `SolverOptions.LUMPING`, `SolverOptions.ITERATIVE`,
477                          `SolverOptions.AMG`, `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`,                          `SolverOptions.NONLINEAR_GMRES`, `SolverOptions.TFQMR`, `SolverOptions.MINRES`
                         `SolverOptions.GAUSS_SEIDEL`, `SolverOptions.GAUSS_SEIDEL_MPI`  
478          """          """
479          return self.__method          return self.__method
480                    
# Line 510  class SolverOptions(object): Line 503  class SolverOptions(object):
503          to optimize compute time and storage use during elimination.          to optimize compute time and storage use during elimination.
504    
505          :param ordering: selects the reordering strategy.          :param ordering: selects the reordering strategy.
506          :type ordering: in `SolverOptions.NO_REORDERING`, `SolverOptions.NO_REORDERING`, `SolverOptions.NO_REORDERING`, `SolverOptions.DEFAULT_REORDERING`          :type ordering: in 'SolverOptions.NO_REORDERING', 'SolverOptions.MINIMUM_FILL_IN', 'SolverOptions.NESTED_DISSECTION', 'SolverOptions.DEFAULT_REORDERING'
507          """          """
508          if not ordering in [self.NO_REORDERING, self.MINIMUM_FILL_IN, self.NESTED_DISSECTION, self.DEFAULT_REORDERING]:          if not ordering in [self.NO_REORDERING, self.MINIMUM_FILL_IN, self.NESTED_DISSECTION, self.DEFAULT_REORDERING]:
509               raise ValueError,"unknown reordering strategy %s"%ordering               raise ValueError,"unknown reordering strategy %s"%ordering
# Line 519  class SolverOptions(object): Line 512  class SolverOptions(object):
512          """          """
513          Returns the key of the reordering method to be applied if supported by the solver.          Returns the key of the reordering method to be applied if supported by the solver.
514    
515          :rtype: in the list `SolverOptions.NO_REORDERING`, `SolverOptions.NO_REORDERING`,  `SolverOptions.NO_REORDERING`, `SolverOptions.DEFAULT_REORDERING`          :rtype ordering: in 'SolverOptions.NO_REORDERING', 'SolverOptions.MINIMUM_FILL_IN', 'SolverOptions.NESTED_DISSECTION', 'SolverOptions.DEFAULT_REORDERING'
516          """          """
517          return self.__reordering          return self.__reordering
518      def setRestart(self,restart=None):      def setRestart(self,restart=None):
# Line 941  class SolverOptions(object): Line 934  class SolverOptions(object):
934          else:          else:
935              self.setAcceptanceConvergenceFailureOff()              self.setAcceptanceConvergenceFailureOff()
936    
937        def useLocalPreconditioner(self):
938            """
939            Returns ``True`` if the preconditoner is applied locally on each MPI. This reducess communication costs
940            and speeds up the application of the preconditioner but at the costs of more iteration steps. This can be an
941            advantage on clusters with slower interconnects.
942    
943            :return: ``True`` if local preconditioning is applied
944            :rtype: ``bool``
945            """
946            return self.__use_local_preconditioner
947    
948        def setLocalPreconditionerOn(self):
949            """
950            Sets a flag to use  local preconditioning to on
951            """
952            self.__use_local_preconditioner=True
953        def setLocalPreconditionerOff(self):
954            """
955            Sets a flag to use  local preconditioning to off
956            """
957            self.__use_local_preconditioner=False
958        def setLocalPreconditioner(self,use=False):
959            """
960            Sets a flag to use  local preconditioning
961    
962            :param accept: If ``True``, local proconditioning on each MPI rank is applied
963            :type accept: ``bool``
964            """
965            if use:
966                self.setUseLocalPreconditionerOn()
967            else:
968                self.setUseLocalPreconditionerOff()
969    
970  class IllegalCoefficient(ValueError):  class IllegalCoefficient(ValueError):
971     """     """
972     Exception that is raised if an illegal coefficient of the general or     Exception that is raised if an illegal coefficient of the general or

Legend:
Removed from v.3071  
changed lines
  Added in v.3094

  ViewVC Help
Powered by ViewVC 1.1.26