Changeset 1953
- Timestamp:
- Oct 17, 2005, 9:50:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/euler/euler.py
r1951 r1953 54 54 55 55 from domain import * 56 from region import * #56 from region import * 57 57 58 58 Generic_domain = Domain #Rename … … 139 139 140 140 141 #FIXME: Under construction142 # def set_defaults(self):143 # """Set default values for uninitialised quantities.144 # This is specific to the shallow water wave equation145 # 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 name151 # 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_values157 # 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 up166 # #z = self.quantities['elevation'].vertex_values167 # #w = self.quantities['stage'].vertex_values168 169 # #h = w-z170 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 180 141 def evolve(self, yieldstep = None, finaltime = None, 181 142 skip_initial_step = False): … … 186 147 #self.check_integrity() 187 148 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 193 151 194 152 #Initial update of vertex and edge values before any storage … … 199 157 #Initialise real time viz if requested 200 158 if self.visualise is True and self.time == 0.0: 201 #pass 159 202 160 import realtime_visualisation_new as visualise 203 #visualise.create_surface(self)204 161 self.initialise_visualiser() 205 162 self.visualiser.setup_all() … … 209 166 if self.store is True and self.time == 0.0: 210 167 self.initialise_storage() 211 #print 'Storing results in ' + self.writer.filename212 168 else: 213 169 pass 214 #print 'Results will not be stored.'215 #print 'To store results set domain.store = True'216 #FIXME: Diagnostic output should be controlled by217 # a 'verbose' flag living in domain (or in a parent class)218 170 219 171 #Call basic machinery from parent class … … 222 174 #Real time viz 223 175 if self.visualise is True: 224 #pass225 176 self.visualiser.update_all() 226 177 self.visualiser.update_timer() … … 238 189 239 190 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. 241 193 Also, save x,y and bed elevation 242 194 """
Note: See TracChangeset
for help on using the changeset viewer.