/[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 3351 by gross, Mon Oct 18 22:39:28 2010 UTC revision 3352 by gross, Tue Nov 16 03:58:09 2010 UTC
# Line 171  class SolverOptions(object): Line 171  class SolverOptions(object):
171          self.setMinCoarseMatrixSparsity()          self.setMinCoarseMatrixSparsity()
172          self.setNumRefinements()          self.setNumRefinements()
173          self.setNumCoarseMatrixRefinements()          self.setNumCoarseMatrixRefinements()
174            self.setUsePanel()
175            self.setUseDirectInterpolation()
176                    
177    
178      def __str__(self):      def __str__(self):
# Line 203  class SolverOptions(object): Line 205  class SolverOptions(object):
205              out+="\nApply preconditioner locally = %s"%self.useLocalPreconditioner()              out+="\nApply preconditioner locally = %s"%self.useLocalPreconditioner()
206              if self.getPreconditioner() == self.AMG:              if self.getPreconditioner() == self.AMG:
207                  out+="\nMaximum number of levels = %s"%self.getLevelMax()                  out+="\nMaximum number of levels = %s"%self.getLevelMax()
208                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())                  out+="\nCoarsening threshold = %e"%self.getCoarseningThreshold()
209                  out+="\nCoarsening threshold = %e"%self.getMinCoarseMatrixSize()                  out+="\nMinimal sparsity on coarsest level = %e"%(self.getMinCoarseMatrixSparsity(),)
210                  out+="\nSmoother = %s"%self.getName(self.getSmoother())                  out+="\nSmoother = %s"%self.getName(self.getSmoother())
211                  out+="\nMinimum size of the coarsest level matrix = %e"%self.getCoarseningThreshold()                  out+="\nMinimum size of the coarsest level matrix = %e"%self.getCoarseningThreshold()
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())
                 out+="\nMinimal sparsity on coarsest level = %e"%(self.getMinCoarseMatrixSparsity(),)  
213                  out+="\nNumber of refinement steps in coarsest level solver = %d"%(self.getNumCoarseMatrixRefinements(),)                  out+="\nNumber of refinement steps in coarsest level solver = %d"%(self.getNumCoarseMatrixRefinements(),)
214                                    out+="\nUse node panel = %s"%(self.usePanel())
215                    out+="\nUse direct interpolation only = %s"%(self.useDirectInterpolation())
216    
217              if self.getPreconditioner() == self.AMLI:              if self.getPreconditioner() == self.AMLI:
218                  out+="\nMaximum number of levels = %s"%self.getLevelMax()                  out+="\nMaximum number of levels = %s"%self.getLevelMax()
219                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())                  out+="\nCoarsening method = %s"%self.getName(self.getCoarsening())
# Line 900  class SolverOptions(object): Line 903  class SolverOptions(object):
903          self.__adapt_inner_tolerance=False          self.__adapt_inner_tolerance=False
904      def setInnerToleranceAdaption(self,adapt=True):      def setInnerToleranceAdaption(self,adapt=True):
905          """          """
906          Sets a flag to indicate automatic selection of the inner tolerance.          Sets the flag to indicate automatic selection of the inner tolerance.
907    
908          :param adapt: If ``True``, the inner tolerance is selected automatically.          :param adapt: If ``True``, the inner tolerance is selected automatically.
909          :type adapt: ``bool``          :type adapt: ``bool``
# Line 936  class SolverOptions(object): Line 939  class SolverOptions(object):
939          self.__accept_convergence_failure=False          self.__accept_convergence_failure=False
940      def setAcceptanceConvergenceFailure(self,accept=False):      def setAcceptanceConvergenceFailure(self,accept=False):
941          """          """
942          Sets a flag to indicate the acceptance of a failure of convergence.          Sets the flag to indicate the acceptance of a failure of convergence.
943    
944          :param accept: If ``True``, any failure to achieve convergence is accepted.          :param accept: If ``True``, any failure to achieve convergence is accepted.
945          :type accept: ``bool``          :type accept: ``bool``
# Line 959  class SolverOptions(object): Line 962  class SolverOptions(object):
962    
963      def setLocalPreconditionerOn(self):      def setLocalPreconditionerOn(self):
964          """          """
965          Sets a flag to use  local preconditioning to on          Sets the flag to use  local preconditioning to on
966          """          """
967          self.__use_local_preconditioner=True          self.__use_local_preconditioner=True
968      def setLocalPreconditionerOff(self):      def setLocalPreconditionerOff(self):
969          """          """
970          Sets a flag to use  local preconditioning to off          Sets the flag to use  local preconditioning to off
971          """          """
972          self.__use_local_preconditioner=False          self.__use_local_preconditioner=False
973            
974      def setLocalPreconditioner(self,use=False):      def setLocalPreconditioner(self,use=False):
975          """          """
976          Sets a flag to use  local preconditioning          Sets the flag to use  local preconditioning
977    
978          :param accept: If ``True``, local proconditioning on each MPI rank is applied          :param use: If ``True``, local proconditioning on each MPI rank is applied
979          :type accept: ``bool``          :type use: ``bool``
980          """          """
981          if use:          if use:
982              self.setUseLocalPreconditionerOn()              self.setUseLocalPreconditionerOn()
# Line 1060  class SolverOptions(object): Line 1064  class SolverOptions(object):
1064        :rtype: non-negative ``int``        :rtype: non-negative ``int``
1065        """        """
1066        return self.__coarse_refinements        return self.__coarse_refinements
1067          
1068        def usePanel(self):
1069            """
1070            Returns ``True`` if a panel is used to serach for unknown in the AMG coarsening, The panel approach is normally faster
1071            but can lead to larger coarse level systems.
1072            
1073            :return: ``True`` if a panel is used to find unknowns in AMG coarsening
1074            :rtype: ``bool``
1075            """
1076            return self.__use_panel
1077    
1078        def setUsePanelOn(self):
1079            """
1080            Sets the flag to use a panel to find unknowns in AMG coarsening
1081            """
1082            self.__use_panel=True
1083            
1084        def setUsePanelOff(self):
1085            """
1086            Sets the flag to use a panel to find unknowns in AMG coarsening to off
1087            """
1088            self.__use_panel=False
1089            
1090        def setUsePanel(self,use=True):
1091            """
1092            Sets the flag to use  a panel to find unknowns in AMG coarsening
1093    
1094         :param use: If ``True``,a panel is used to find unknowns in AMG coarsening
1095            :type use: ``bool``
1096            """
1097            if use:
1098                self.setUsePanelOn()
1099            else:
1100                self.setUsePanelOff()
1101                
1102        def useDirectInterpolation(self):
1103            """
1104            Returns ``True`` if direct interpolation is used in AMG.
1105    
1106        :return: ``True`` if direct interpolation is used in AMG.
1107            :rtype: ``bool``
1108            """
1109            return self.__use_direct_interpolation
1110    
1111        def setUseDirectInterpolationOn(self):
1112            """
1113            Sets the flag to use direct interpolation in AMG
1114            """
1115            self.__use_direct_interpolation=True
1116            
1117        def setUseDirectInterpolationOff(self):
1118            """
1119            Sets the flag to use direct interpolation in AMG
1120            """
1121            self.__use_direct_interpolation=False
1122            
1123        def setUseDirectInterpolation(self,use=False):
1124            """
1125            Sets the flag to use direct interpolation in AMG
1126    
1127        :param use: If ``True``, direct interpolation in AMG
1128        :type use: ``bool``
1129            """
1130            if use:
1131                self.setUseDirectInterpolationOn()
1132            else:
1133                self.setUseDirectInterpolationOff()
1134    
1135    
1136  class IllegalCoefficient(ValueError):  class IllegalCoefficient(ValueError):
1137     """     """
1138     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.3351  
changed lines
  Added in v.3352

  ViewVC Help
Powered by ViewVC 1.1.26