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

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

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

revision 4575 by jfenwick, Wed Jul 24 02:50:22 2013 UTC revision 4576 by sshaw, Mon Dec 9 23:35:30 2013 UTC
# Line 55  class SolverOptions(object): Line 55  class SolverOptions(object):
55      Typical usage is      Typical usage is
56            
57      ::      ::
58        
59        opts=SolverOptions()        opts=SolverOptions()
60        print(opts)        print(opts)
61        opts.resetDiagnostics()        opts.resetDiagnostics()
# Line 222  class SolverOptions(object): Line 222  class SolverOptions(object):
222          out+="\nMaximum number of iteration steps = %s"%self.getIterMax()          out+="\nMaximum number of iteration steps = %s"%self.getIterMax()
223          # out+="\nInner tolerance = %e"%self.getInnerTolerance()          # out+="\nInner tolerance = %e"%self.getInnerTolerance()
224          # out+="\nAdapt innner tolerance = %s"%self.adaptInnerTolerance()          # out+="\nAdapt innner tolerance = %s"%self.adaptInnerTolerance()
225        
226          if self.getPackage() in (self.DEFAULT, self.PASO):          if self.getPackage() in (self.DEFAULT, self.PASO):
227              out+="\nSolver method = %s"%self.getName(self.getSolverMethod())              out+="\nSolver method = %s"%self.getName(self.getSolverMethod())
228              if self.getSolverMethod() == self.GMRES:              if self.getSolverMethod() == self.GMRES:
# Line 328  class SolverOptions(object): Line 328  class SolverOptions(object):
328          if key == self.CRANK_NICOLSON: return "CRANK_NICOLSON"          if key == self.CRANK_NICOLSON: return "CRANK_NICOLSON"
329          if key == self.BACKWARD_EULER: return "BACKWARD_EULER"          if key == self.BACKWARD_EULER: return "BACKWARD_EULER"
330    
331        
332            
333      def resetDiagnostics(self,all=False):      def resetDiagnostics(self,all=False):
334          """          """
# Line 390  class SolverOptions(object): Line 390  class SolverOptions(object):
390              self.__coarse_level_sparsity = value              self.__coarse_level_sparsity = value
391          if name == "num_coarse_unknowns":          if name == "num_coarse_unknowns":
392              self.__num_coarse_unknowns= value              self.__num_coarse_unknowns= value
393                
394      def getDiagnostics(self, name):      def getDiagnostics(self, name):
395          """          """
396          Returns the diagnostic information ``name``. Possible values are:          Returns the diagnostic information ``name``. Possible values are:
397                        
398      - "num_iter": the number of iteration steps          - "num_iter": the number of iteration steps
399          - "cum_num_iter": the cumulative number of iteration steps          - "cum_num_iter": the cumulative number of iteration steps
400          - "num_level": the number of level in multi level solver          - "num_level": the number of level in multi level solver
401          - "num_inner_iter": the number of inner iteration steps          - "num_inner_iter": the number of inner iteration steps
# Line 410  class SolverOptions(object): Line 411  class SolverOptions(object):
411          - "time_step_backtracking_used": returns True if time step back tracking has been used.          - "time_step_backtracking_used": returns True if time step back tracking has been used.
412          - "coarse_level_sparsity": returns the sparsity of the matrix on the coarsest level          - "coarse_level_sparsity": returns the sparsity of the matrix on the coarsest level
413          - "num_coarse_unknowns": returns the number of unknowns on the coarsest level          - "num_coarse_unknowns": returns the number of unknowns on the coarsest level
414                
415                    
416          :param name: name of diagnostic information to return          :param name: name of diagnostic information to return
417          :type name: ``str`` in the list above.          :type name: ``str`` in the list above.
# Line 625  class SolverOptions(object): Line 626  class SolverOptions(object):
626              if restart<1:              if restart<1:
627                  raise ValueError("restart must be positive.")                  raise ValueError("restart must be positive.")
628              self.__restart=restart              self.__restart=restart
629                        
630      def getRestart(self):      def getRestart(self):
631          """          """
632          Returns the number of iterations steps after which GMRES is performing a restart.          Returns the number of iterations steps after which GMRES is performing a restart.
# Line 648  class SolverOptions(object): Line 649  class SolverOptions(object):
649          """          """
650          Sets the threshold for diagonal dominant rows which are eliminated during AMG coarsening.          Sets the threshold for diagonal dominant rows which are eliminated during AMG coarsening.
651    
652       :param value: threshold          :param value: threshold
653       :type value: ``float``          :type value: ``float``
654          """          """
655          value=float(value)          value=float(value)
656          if value<0 or value>1.:          if value<0 or value>1.:
# Line 998  class SolverOptions(object): Line 999  class SolverOptions(object):
999              self.setVerbosityOn()              self.setVerbosityOn()
1000          else:          else:
1001              self.setVerbosityOff()              self.setVerbosityOff()
1002                        
1003      def adaptInnerTolerance(self):      def adaptInnerTolerance(self):
1004          """          """
1005          Returns ``True`` if the tolerance of the inner solver is selected automatically.          Returns ``True`` if the tolerance of the inner solver is selected automatically.

Legend:
Removed from v.4575  
changed lines
  Added in v.4576

  ViewVC Help
Powered by ViewVC 1.1.26