Ignore:
Timestamp:
Sep 5, 2008, 9:16:45 PM (15 years ago)
Author:
steve
Message:

Updated timestepping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anuga_1d/domain.py

    r5740 r5741  
    724724    #--------------------------   
    725725
    726     def evolve(self, yieldstep = None, finaltime = None, duration = None,
     726    def evolve(self, yieldstep = None,
     727               finaltime = None,
     728               duration = None,
    727729               skip_initial_step = False):
    728730        """Evolve model through time starting from self.starttime.
     
    759761
    760762        from config import min_timestep, max_timestep, epsilon
    761 
    762         print 'yieldstep', yieldstep
    763         print 'duration', duration
    764763
    765764        # FIXME: Maybe lump into a larger check prior to evolving
     
    13881387    def update_timestep(self, yieldstep, finaltime):
    13891388
    1390         from config import min_timestep
     1389        from config import min_timestep, max_timestep
    13911390
    13921391        # self.timestep is calculated from speed of characteristics
    13931392        # Apply CFL condition here
    1394         timestep = self.CFL*self.timestep
     1393        timestep = min(self.CFL*self.flux_timestep, max_timestep)
    13951394
    13961395        #Record maximal and minimal values of timestep for reporting
     
    14591458   
    14601459    #def update_conserved_quantities(self):
    1461     def update_conserved_quantities(self,timestep):
     1460    def update_conserved_quantities(self):
    14621461        """Update vectors of conserved quantities using previously
    14631462        computed fluxes specified forcing functions.
     
    14691468        d = len(self.conserved_quantities)
    14701469
    1471         #timestep = self.timestep
     1470        timestep = self.timestep
    14721471
    14731472        #Compute forcing terms
    1474         #self.compute_forcing_terms()
     1473        self.compute_forcing_terms()
    14751474
    14761475        #Update conserved_quantities
     
    14791478            Q.update(timestep)
    14801479
    1481             #Clean up
    1482             #Note that Q.explicit_update is reset by compute_fluxes
    1483 
    1484             #MH090605 commented out the following since semi_implicit_update is now re-initialized
    1485             #at the end of the _update function in quantity_ext.c (This is called by the
    1486             #preceeding Q.update(timestep) statement above).
    1487             #For run_profile.py with N=128, the time of update_conserved_quantities is cut from 14.00 secs
    1488             #to 8.35 secs
    1489 
    1490             #Q.semi_implicit_update[:] = 0.0
     1480
    14911481
    14921482if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.