Changeset 5740


Ignore:
Timestamp:
Sep 5, 2008, 5:11:58 PM (14 years ago)
Author:
steve
Message:
 
Location:
anuga_work/development/anuga_1d
Files:
3 edited

Legend:

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

    r5587 r5740  
    7878beta_w = 1.5
    7979beta_h = 0.2
     80timestepping_method = 'euler'
     81
    8082CFL = 1.0  #FIXME (ole): Is this in use yet??
    8183           #(Steve) yes, change domain.CFL to
  • anuga_work/development/anuga_1d/domain.py

    r5738 r5740  
    2020
    2121        from Numeric import array, zeros, Float, Int
     22
     23        from config import timestepping_method
     24        from config import CFL
     25
     26
    2227       
    2328        #Store Points
     
    3439        self.beta = 1.0
    3540        self.limiter = "minmod_kurganov"
     41        self.CFL = CFL
     42        self.set_timestepping_method(timestepping_method)
     43
    3644        self.wet_nodes = zeros((N,2), Int) # should this be here
    3745
     
    538546        return self.centroids
    539547
     548
     549    def get_timestepping_method(self):
     550        return self.timestepping_method
     551
     552    def set_timestepping_method(self,timestepping_method):
     553       
     554        if timestepping_method in ['euler', 'rk2', 'rk3']:
     555            self.timestepping_method = timestepping_method
     556            return
     557
     558        msg = '%s is an incorrect timestepping type'% timestepping_method
     559        raise Exception, msg
     560
     561
    540562    def set_quantity(self, name, *args, **kwargs):
    541563        """Set values for named quantity
     
    702724    #--------------------------   
    703725
    704     def evolve(self,
    705                yieldstep = None,
    706                finaltime = None,
    707                duration = None,
     726    def evolve(self, yieldstep = None, finaltime = None, duration = None,
    708727               skip_initial_step = False):
    709728        """Evolve model through time starting from self.starttime.
     
    740759
    741760        from config import min_timestep, max_timestep, epsilon
     761
     762        print 'yieldstep', yieldstep
     763        print 'duration', duration
    742764
    743765        # FIXME: Maybe lump into a larger check prior to evolving
  • anuga_work/development/anuga_1d/shallow_water_domain.py

    r5731 r5740  
    168168        distribute_to_vertices_and_edges(self)
    169169       
    170     def evolve(self, yieldstep = None, finaltime = None,
     170    def evolve(self, yieldstep = None, finaltime = None, duration = None,
    171171               skip_initial_step = False):
    172172        """Specialisation of basic evolve method from parent class
     
    207207
    208208        #Call basic machinery from parent class
    209         for t in Generic_Domain.evolve(self, yieldstep, finaltime,
     209        for t in Generic_Domain.evolve(self, yieldstep, finaltime,duration,
    210210                                       skip_initial_step):
    211211            #Real time viz
Note: See TracChangeset for help on using the changeset viewer.