/[escript]/trunk/escript/py_src/modelframe.py
ViewVC logotype

Diff of /trunk/escript/py_src/modelframe.py

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

revision 906 by gross, Tue Nov 21 05:34:15 2006 UTC revision 908 by gross, Thu Nov 23 06:39:39 2006 UTC
# Line 397  class ParameterSet(LinkableObject): Line 397  class ParameterSet(LinkableObject):
397          self.declareParameters(parameters)          self.declareParameters(parameters)
398    
399      def __repr__(self):      def __repr__(self):
400          return "<%s %r>" % (self.__class__.__name__,          return "<%s %d>"%(self.__class__.__name__,id(self))
                             [(p, getattr(self, p, None)) for p in self.parameters])  
401            
402      def declareParameter(self,**parameters):      def declareParameter(self,**parameters):
403          """          """
# Line 650  class Model(ParameterSet): Line 649  class Model(ParameterSet):
649          ParameterSet.__init__(self, parameters=parameters,**kwarg)          ParameterSet.__init__(self, parameters=parameters,**kwarg)
650    
651      def __str__(self):      def __str__(self):
652         return "<%s %d>"%(self.__class__,id(self))         return "<%s %d>"%(self.__class__.__name__,id(self))
653    
654      def toDom(self, document, node):      def toDom(self, document, node):
655          """          """
# Line 878  class Simulation(Model): Line 877  class Simulation(Model):
877          """          """
878      performs an iteration step in the initialization step for all models      performs an iteration step in the initialization step for all models
879      """      """
880          for o in self.iterModels():          iter=0
881               o.doInitialStep()          while not self.terminateInitialIteration():
882                if iter==0: self.trace("iteration for initialization starts")
883                iter+=1
884                self.trace("iteration step %d"%(iter))
885                for o in self.iterModels():
886                     o.doInitialStep()
887                if iter>self.MAX_ITER_STEPS:
888                     raise IterationDivergenceError("initial iteration did not converge after %s steps."%iter)
889            self.trace("Initialization finalized after %s iteration steps."%iter)
890    
891      def doInitialPostprocessing(self):      def doInitialPostprocessing(self):
892          """          """
# Line 974  class Simulation(Model): Line 981  class Simulation(Model):
981      C{Simulation.FAILED_TIME_STEPS_MAX} attempts.      C{Simulation.FAILED_TIME_STEPS_MAX} attempts.
982          """          """
983          self.doInitialization()          self.doInitialization()
984          iter=0          self.doInitialStep()
         while not self.terminateInitialIteration():  
             self.doInitialStep()  
             iter+=1  
             if iter>self.MAX_ITER_STEPS:  
                  raise IterationDivergenceError("initial iteration did not converge after %s steps."%iter)  
985          self.doInitialPostprocessing()          self.doInitialPostprocessing()
         self.trace("Initialization finalized after %s iteration steps."%iter)  
986          dt=self.UNDEF_DT          dt=self.UNDEF_DT
987          while not self.finalize():          while not self.finalize():
988              step_fail_counter=0              step_fail_counter=0

Legend:
Removed from v.906  
changed lines
  Added in v.908

  ViewVC Help
Powered by ViewVC 1.1.26