Changeset 2851


Ignore:
Timestamp:
May 11, 2006, 4:38:06 PM (18 years ago)
Author:
ole
Message:

Another stab at removing potential for duplicate timesteps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/domain.py

    r2814 r2851  
    693693
    694694            #Yield results
    695             if finaltime is not None and abs(self.time - finaltime) < epsilon:
    696             #FIXME (Ole): I don't like the the epsilon test, finaltime may not
    697             #be reached, as evolve will stop within one epsilon from finaltime
    698             #if finaltime is not None and self.time >= finaltime:
    699 
    700                 #FIXME: There is a rare situation where the
    701                 #final time step is stored twice. Can we make a test?
    702                 #FIXME (Ole, 30 April 2006): This is an attempt to fix that
    703 
    704                 #if self.time > finaltime:
    705                 #    #FIXME (Ole, 30 April 2006): Do we need this check?
    706                 #    print 'WARNING (domain.py): time overshot finaltime'
    707                 #    self.time = finaltime
     695            if finaltime is not None and self.time >= finaltime:
     696
     697                if self.time > finaltime:
     698                    #FIXME (Ole, 30 April 2006): Do we need this check?
     699                    print 'WARNING (domain.py): time overshot finaltime'
     700                    self.time = finaltime
    708701
    709702                # Yield final time and stop
     
    713706
    714707
    715             if abs(self.yieldtime - yieldstep) < epsilon:
    716             #if self.yieldtime >= yieldstep:
     708            if self.yieldtime >= yieldstep:
    717709                # Yield (intermediate) time and allow inspection of domain
    718 
    719                 #if self.yieldtime > yieldstep:
    720                 #    #FIXME (Ole, 30 April 2006): Do we need this check?
    721                 #    print 'WARNING (domain.py): yieldtime overshot yielstep'
    722                 #    self.yieldtime = yieldstep
    723710
    724711                if self.checkpoint is True:
     
    730717                yield(self.time)
    731718
     719                #if finaltime is not None and self.time >= finaltime:
    732720                if finaltime is not None and abs(self.time - finaltime) < epsilon:
    733721                    # FIXME (Ole, 30 April 2006): Maybe this will remove
Note: See TracChangeset for help on using the changeset viewer.