Changeset 1953


Ignore:
Timestamp:
Oct 17, 2005, 9:50:08 PM (19 years ago)
Author:
steve
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/euler/euler.py

    r1951 r1953  
    5454
    5555from domain import *
    56 from region import *#
     56from region import *
    5757
    5858Generic_domain = Domain #Rename
     
    139139
    140140
    141     #FIXME: Under construction
    142 #     def set_defaults(self):
    143 #         """Set default values for uninitialised quantities.
    144 #         This is specific to the shallow water wave equation
    145 #         Defaults for 'elevation', 'friction', 'xmomentum' and 'ymomentum'
    146 #         are 0.0. Default for 'stage' is whatever the value of 'elevation'.
    147 #         """
    148 
    149 #         for name in self.other_quantities + self.conserved_quantities:
    150 #             print name
    151 #             print self.quantities.keys()
    152 #             if not self.quantities.has_key(name):
    153 #                 if name == 'stage':
    154 
    155 #                     if self.quantities.has_key('elevation'):
    156 #                         z = self.quantities['elevation'].vertex_values
    157 #                         self.set_quantity(name, z)
    158 #                     else:
    159 #                         self.set_quantity(name, 0.0)
    160 #                 else:
    161 #                     self.set_quantity(name, 0.0)
    162 
    163 
    164 
    165 #         #Lift negative heights up
    166 #         #z = self.quantities['elevation'].vertex_values
    167 #         #w = self.quantities['stage'].vertex_values
    168 
    169 #         #h = w-z
    170 
    171 #         #for k in range(h.shape[0]):
    172 #         #    for i in range(3):
    173 #         #        if h[k, i] < 0.0:
    174 #         #            w[k, i] = z[k, i]
    175 
    176 
    177 #         #self.quantities['stage'].interpolate()
    178 
    179 
    180141    def evolve(self, yieldstep = None, finaltime = None,
    181142               skip_initial_step = False):
     
    186147        #self.check_integrity()
    187148
    188         msg = 'Parameter beta_h must be in the interval [0, 1['
    189         assert 0 <= self.beta_h < 1.0, msg
    190         msg = 'Parameter beta_w must be in the interval [0, 1['
    191         assert 0 <= self.beta_w < 1.0, msg
    192 
     149        msg = 'Parameter beta must be in the interval [0, 1['
     150        assert 0 <= self.beta < 1.0, msg
    193151
    194152        #Initial update of vertex and edge values before any storage
     
    199157        #Initialise real time viz if requested
    200158        if self.visualise is True and self.time == 0.0:
    201             #pass
     159
    202160            import realtime_visualisation_new as visualise
    203             #visualise.create_surface(self)
    204161            self.initialise_visualiser()
    205162            self.visualiser.setup_all()
     
    209166        if self.store is True and self.time == 0.0:
    210167            self.initialise_storage()
    211             #print 'Storing results in ' + self.writer.filename
    212168        else:
    213169            pass
    214             #print 'Results will not be stored.'
    215             #print 'To store results set domain.store = True'
    216             #FIXME: Diagnostic output should be controlled by
    217             # a 'verbose' flag living in domain (or in a parent class)
    218170
    219171        #Call basic machinery from parent class
     
    222174            #Real time viz
    223175            if self.visualise is True:
    224                 #pass
    225176                self.visualiser.update_all()
    226177                self.visualiser.update_timer()
     
    238189
    239190    def initialise_storage(self):
    240         """Create and initialise self.writer object for storing data.
     191        """
     192        Create and initialise self.writer object for storing data.
    241193        Also, save x,y and bed elevation
    242194        """
Note: See TracChangeset for help on using the changeset viewer.