Changeset 2783


Ignore:
Timestamp:
Apr 30, 2006, 5:35:55 AM (18 years ago)
Author:
ole
Message:

Investigated duplicate yield of finaltime but no conclusive verdict.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • documentation/requirements/least_squares_redesign.txt

    r2750 r2783  
    1616
    1717This is looking at redesigning the least_squares module, excluding
    18 interpolate_function and pts2rectangle.  (Other modules will
    19 be modified, based on these changes.)
     18interpolate_function and pts2rectangle.  Other modules will
     19be modified, based on these changes, e.g.  geospatial_data.py.
    2020
    2121
  • inundation/pyvolution/domain.py

    r2765 r2783  
    634634            #Yield results
    635635            if finaltime is not None and abs(self.time - finaltime) < epsilon:
    636 
     636            #FIXME (Ole): I don't like the the epsilon test, finaltime may not
     637            #be reached, as evolve will stop within one epsilon from finaltime
     638            #if finaltime is not None and self.time >= finaltime:
     639           
    637640                #FIXME: There is a rare situation where the
    638641                #final time step is stored twice. Can we make a test?
    639 
     642                #FIXME (Ole, 30 April 2006): This is an attempt to fix that
     643               
     644                #if self.time > finaltime:
     645                #    #FIXME (Ole, 30 April 2006): Do we need this check?
     646                #    print 'WARNING (domain.py): time overshot finaltime'
     647                #    self.time = finaltime
     648               
    640649                # Yield final time and stop
     650                #print 'finaltime %.18f' %self.time
    641651                yield(self.time)
    642652                break
     
    644654
    645655            if abs(self.yieldtime - yieldstep) < epsilon:
     656            #if self.yieldtime >= yieldstep:
    646657                # Yield (intermediate) time and allow inspection of domain
     658               
     659                #if self.yieldtime > yieldstep:
     660                #    #FIXME (Ole, 30 April 2006): Do we need this check?
     661                #    print 'WARNING (domain.py): yieldtime overshot yielstep'
     662                #    self.yieldtime = yieldstep         
    647663
    648664                if self.checkpoint is True:
     
    651667
    652668                #Pass control on to outer loop for more specific actions
     669                #print 'yieldtime %.18f' %self.time             
    653670                yield(self.time)
    654 
     671               
     672                if self.time >= finaltime:
     673                    #FIXME (Ole, 30 April 2006): Maybe this will remove
     674                    #duplicate final timesteps?         
     675                    break
     676                   
    655677                # Reinitialise
    656678                self.yieldtime = 0.0
  • inundation/pyvolution/test_util.py

    r2679 r2783  
    145145        finaltime = 8
    146146        #Evolution
     147        t0 = -1
    147148        for t in domain1.evolve(yieldstep = 0.1, finaltime = finaltime):
    148             pass
     149            #print 'Timesteps: %f, %f' %(t0, t)
     150            #if t == t0:
     151            #    msg = 'Duplicate timestep found: %f, %f' %(t0, t)
     152            #   raise msg
     153            t0 = t
     154             
    149155            #domain1.write_time()
    150156
Note: See TracChangeset for help on using the changeset viewer.