/[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 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2596 by lgao, Thu Aug 6 03:09:03 2009 UTC
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14  __copyright__="""Copyright (c) 2003-2008 by University of Queensland  __copyright__="""Copyright (c) 2003-2009 by University of Queensland
15  Earth Systems Science Computational Center (ESSCC)  Earth Systems Science Computational Center (ESSCC)
16  http://www.uq.edu.au/esscc  http://www.uq.edu.au/esscc
17  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
# Line 261  class SolverOptions(object): Line 261  class SolverOptions(object):
261          self.__num_inner_iter=None          self.__num_inner_iter=None
262          self.__time=None          self.__time=None
263          self.__set_up_time=None          self.__set_up_time=None
264            self.__net_time=None
265          self.__residual_norm=None          self.__residual_norm=None
266          self.__converged=None          self.__converged=None
267          if all:          if all:
# Line 268  class SolverOptions(object): Line 269  class SolverOptions(object):
269              self.__cum_num_iter=0              self.__cum_num_iter=0
270              self.__cum_time=0              self.__cum_time=0
271              self.__cum_set_up_time=0              self.__cum_set_up_time=0
272                self.__cum_net_time=0
273    
274      def _updateDiagnostics(self, name, value):      def _updateDiagnostics(self, name, value):
275          """          """
276          Updates diagnostic information          Updates diagnostic information
277                    
278          @param name: name of  diagnostic information          @param name: name of  diagnostic information
279          @type name: C{str} in the list "num_iter", "num_level", "num_inner_iter", "time", "set_up_time", "residual_norm", "converged".          @type name: C{str} in the list "num_iter", "num_level", "num_inner_iter", "time", "set_up_time", "net_time", "residual_norm", "converged".
280          @param vale: new value of the diagnostic information          @param vale: new value of the diagnostic information
281          @note: this function is used by a solver to report diagnostics informations.          @note: this function is used by a solver to report diagnostics informations.
282          """          """
# Line 282  class SolverOptions(object): Line 284  class SolverOptions(object):
284              self.__num_iter=int(value)              self.__num_iter=int(value)
285              self.__cum_num_iter+=self.__num_iter              self.__cum_num_iter+=self.__num_iter
286          if name == "num_level":          if name == "num_level":
287              self.__num_iter=int(value)              self.__num_level=int(value)
288          if name == "num_inner_iter":          if name == "num_inner_iter":
289              self.__num_inner_iter=int(value)              self.__num_inner_iter=int(value)
290              self.__cum_num_inner_iter+=self.__num_inner_iter              self.__cum_num_inner_iter+=self.__num_inner_iter
# Line 292  class SolverOptions(object): Line 294  class SolverOptions(object):
294          if name == "set_up_time":          if name == "set_up_time":
295              self.__set_up_time=float(value)              self.__set_up_time=float(value)
296              self.__cum_set_up_time+=self.__set_up_time              self.__cum_set_up_time+=self.__set_up_time
297            if name == "net_time":
298                self.__net_time=float(value)
299                self.__cum_net_time+=self.__net_time
300          if name == "residual_norm":          if name == "residual_norm":
301              self.__residual_norm=float(value)              self.__residual_norm=float(value)
302          if name == "converged":          if name == "converged":
# Line 310  class SolverOptions(object): Line 315  class SolverOptions(object):
315          - "cum_time": cumulative execution time          - "cum_time": cumulative execution time
316          - "set_up_time": time to set up of the solver, typically this includes factorization and reordering          - "set_up_time": time to set up of the solver, typically this includes factorization and reordering
317          - "cum_set_up_time": cumulative time to set up of the solver          - "cum_set_up_time": cumulative time to set up of the solver
318            - "net_time": net execution time, excluding setup time for the solver and execution time for preconditioner
319            - "cum_net_time": cumulative net execution time
320          - "residual_norm": norm of the final residual          - "residual_norm": norm of the final residual
321          - "converged": return self.__converged              - "converged": return self.__converged    
322          @type name: C{str} in the list "num_iter", "num_level", "num_inner_iter", "time", "set_up_time", "residual_norm", "converged".          @type name: C{str} in the list "num_iter", "num_level", "num_inner_iter", "time", "set_up_time", "net_time", "residual_norm", "converged".
323          @return: requested value. C{None} is returned if the value is undefined.          @return: requested value. C{None} is returned if the value is undefined.
324          @note: If the solver has thrown an exception diagnostic values have an undefined status.          @note: If the solver has thrown an exception diagnostic values have an undefined status.
325          """          """
# Line 325  class SolverOptions(object): Line 332  class SolverOptions(object):
332          elif name == "cum_time": return self.__cum_time          elif name == "cum_time": return self.__cum_time
333          elif name == "set_up_time": return self.__set_up_time          elif name == "set_up_time": return self.__set_up_time
334          elif name == "cum_set_up_time": return self.__cum_set_up_time          elif name == "cum_set_up_time": return self.__cum_set_up_time
335            elif name == "net_time": return self.__net_time
336            elif name == "cum_net_time": return self.__cum_net_time
337          elif name == "residual_norm": return self.__residual_norm          elif name == "residual_norm": return self.__residual_norm
338          elif name == "converged": return self.__converged                elif name == "converged": return self.__converged      
339          else:          else:
# Line 2064  class LinearProblem(object): Line 2073  class LinearProblem(object):
2073             if self.isUsingLumping():             if self.isUsingLumping():
2074                 self.__operator.setToZero()                 self.__operator.setToZero()
2075             else:             else:
2076                 self.__operator.resetValues()                 if self.getOperatorType() == self.getRequiredOperatorType():
2077                       self.__operator.resetValues()
2078                   else:
2079                       self.__operator=self.createOperator()
2080                   self.__operator_type=self.getRequiredOperatorType()
2081             self.trace("Operator reset to zero")             self.trace("Operator reset to zero")
2082    
2083     def getCurrentOperator(self):     def getCurrentOperator(self):

Legend:
Removed from v.2548  
changed lines
  Added in v.2596

  ViewVC Help
Powered by ViewVC 1.1.26