Changeset 6246


Ignore:
Timestamp:
Jan 30, 2009, 1:45:37 PM (10 years ago)
Author:
rwilson
Message:

Changes to yieldtime to make runs on different architectures more similar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py

    r6226 r6246  
    12801280                self.finaltime = self.starttime + float(duration)
    12811281
    1282         N = len(self)            # Number of triangles
    1283         self.yieldtime = 0.0     # Track time between 'yields'
     1282        N = len(self)                             # Number of triangles
     1283        self.yieldtime = self.time + yieldstep    # set next yield time
    12841284
    12851285        # Initialise interval of timestep sizes (for reporting only)
     
    13201320
    13211321            # Update extrema if necessary (for reporting)
    1322             self.update_extrema()
    1323 
    1324             self.yieldtime += self.timestep
     1322            self.update_extrema()           
     1323
    13251324            self.number_of_steps += 1
    13261325            if self._order_ == 1:
     
    13421341                break
    13431342
    1344             if self.yieldtime >= yieldstep:
     1343            # if we are at the next yield point
     1344            if self.time >= self.yieldtime:
    13451345                # Yield (intermediate) time and allow inspection of domain
    13461346                if self.checkpoint is True:
     
    13521352
    13531353                # Reinitialise
    1354                 self.yieldtime = 0.0
     1354                self.yieldtime += yieldstep                 # move to next yield
    13551355                self.min_timestep = max_timestep
    13561356                self.max_timestep = min_timestep
     
    17001700
    17011701        # Ensure that model time is aligned with yieldsteps
    1702         if self.yieldtime + timestep > yieldstep:
    1703             timestep = yieldstep-self.yieldtime
     1702        if self.time + timestep > self.yieldtime:
     1703            timestep = self.yieldtime - self.time
    17041704
    17051705        self.timestep = timestep
Note: See TracChangeset for help on using the changeset viewer.