Changeset 7485


Ignore:
Timestamp:
Sep 7, 2009, 11:37:31 AM (11 years ago)
Author:
steve
Message:

Allow max and min timestep to be changed dynamically

File:
1 edited

Legend:

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

    r7342 r7485  
    1313from anuga.config import epsilon
    1414from anuga.config import beta_euler, beta_rk2
     15
    1516from anuga.abstract_2d_finite_volumes.neighbour_mesh import Mesh
    1617from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\
     
    222223        from anuga.config import protect_against_isolated_degenerate_timesteps
    223224        from anuga.config import default_order
     225        from anuga.config import max_timestep, min_timestep
    224226
    225227        self.beta_w = beta_w
     
    237239        self.set_timestepping_method(timestepping_method)
    238240        self.set_beta(beta_w)
     241        self.set_evolve_max_timestep(max_timestep)
     242        self.set_evolve_min_timestep(min_timestep)
    239243        self.boundary_map = None  # Will be populated by set_boundary
    240244
     
    441445        return self.beta
    442446
     447
     448    ##
     449    # @brief Set the max timestep for time evolution
     450    # @param max_timestep The new max timestep value.
     451    def set_evolve_max_timestep(self, max_timestep):
     452        """Set default max_timestep for evolving."""
     453
     454        self.evolve_max_timestep = max_timestep
     455
     456
     457    ##
     458    # @brief Get the max timestep for time evolution
     459    # @return The max timestep value.
     460    def get_evolve_max_timestep(self):
     461        """Set default max_timestep for evolving."""
     462
     463        return self.evolve_max_timestep
     464
     465    ##
     466    # @brief Set the min timestep for time evolution
     467    # @param min_timestep The new min timestep value.
     468    def set_evolve_min_timestep(self, min_timestep):
     469        """Set default min_timestep for evolving."""
     470
     471        self.evolve_min_timestep = min_timestep
     472
     473
     474    ##
     475    # @brief Get the min timestep for time evolution
     476    # @return The min timestep value.
     477    def get_evolve_min_timestep(self):
     478        """Set default max_timestep for evolving."""
     479
     480        return self.evolve_min_timestep     
     481
     482
     483 
    443484    ##
    444485    # @brief Set default (spatial) order.
     
    16341675    # @param finaltime
    16351676    def update_timestep(self, yieldstep, finaltime):
    1636         from anuga.config import min_timestep, max_timestep
     1677        min_timestep = self.get_evolve_min_timestep()
     1678        max_timestep = self.get_evolve_max_timestep()
    16371679
    16381680        # Protect against degenerate timesteps arising from isolated
Note: See TracChangeset for help on using the changeset viewer.