Changeset 269
- Timestamp:
- Sep 3, 2004, 10:51:58 AM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/HUSK.txt
r234 r269 18 18 19 19 Don't use default conserved qs - hardwire into shallow_water.py 20 Even hardwire pertinent arrays from cons quan into shallow_water and use directly with flux etc 20 21 21 22 -
inundation/ga/storm_surge/pyvolution/domain.py
r263 r269 91 91 self.filename = 'domain' 92 92 self.checkpoint = False 93 94 #Realtime visualisation95 self.visualise = False96 97 #Stored output98 self.store=False99 self.format = 'dat'100 self.smooth = True101 102 #Reduction operation for get_vertex_values103 #from pytools.stats import mean104 #self.reduction = mean105 self.reduction = min #Looks better near steep slopes106 93 107 94 … … 277 264 if self.checkpoint is True: 278 265 self.goto_latest_checkpoint() 279 280 281 #Store model data, e.g. for visualisation 282 if self.store is True and self.time == 0.0: 283 self.store_bathymetry() 284 self.store_conserved_quantities() 285 286 if self.visualise is True and self.time == 0.0: 287 import realtime_visualisation as visualise 288 visualise.create_surface(self) 289 290 266 267 291 268 yield(self.time) #Yield initial values 292 269 … … 294 271 #Update boundary values 295 272 self.update_boundary() 296 297 #print 298 #for name in self.conserved_quantities: 299 # Q = self.quantities[name] 300 # #print 'Vertices (%s):' %name, Q.vertex_values[:] 301 # print 'B_val (%s):' %name, Q.boundary_values[:] 302 303 304 #print 305 #for name in self.conserved_quantities: 306 # Q = self.quantities[name] 307 # print 'Edges (%s):' %name, Q.edge_values[:4] 308 309 #Compute all fluxes and timestep suitable for all volumes 273 274 #Compute fluxes across each element edge 310 275 self.compute_fluxes() 311 ##print312 ##for name in self.conserved_quantities:313 ## Q = self.quantities[name]314 ## print 'EU:', Q.explicit_update[:4]315 276 316 277 #Update timestep to fit yieldstep and finaltime … … 320 281 self.update_conserved_quantities() 321 282 322 #print323 #print 'Centroids'324 #print self.quantities['level'].centroid_values[1:4],\325 # self.quantities['level'].centroid_values[13]326 #print self.quantities['xmomentum'].centroid_values[1:4],\327 # self.quantities['xmomentum'].centroid_values[13]328 #print self.quantities['ymomentum'].centroid_values[1:4],\329 # self.quantities['ymomentum'].centroid_values[13]330 331 332 283 #Update vertex and edge values 333 284 self.distribute_to_vertices_and_edges() 334 285 335 #print336 #for name in self.conserved_quantities:337 # Q = self.quantities[name]338 # print 'Vertices (%s):' %name, Q.vertex_values[1:4], Q.vertex_values[13]339 340 341 342 343 286 #Update time 344 287 self.time += self.timestep … … 348 291 self.number_of_first_order_steps += 1 349 292 350 351 #print 'Time=', self.time, self.timestep352 #print self.quantities['level'].centroid_values[:4]353 #print self.quantities['xmomentum'].centroid_values[:4]354 #print self.quantities['ymomentum'].centroid_values[:4]355 #print356 357 293 #Yield results 358 294 if finaltime is not None and abs(self.time - finaltime) < epsilon: 359 # Yield final time and allow inspection of domain295 # Yield final time and stop 360 296 yield(self.time) 361 297 break 298 362 299 363 300 if abs(self.yieldtime - yieldstep) < epsilon: … … 368 305 self.delete_old_checkpoints() 369 306 370 #Store model data, e.g. for subsequent visualisation 371 if self.store is True: 372 self.store_conserved_quantities() 373 374 #Real time viz 375 if self.visualise is True: 376 visualise.update(self) 377 307 #Pass control on to outer loop for more specific actions 378 308 yield(self.time) 379 309 -
inundation/ga/storm_surge/pyvolution/shallow_water.py
r268 r269 36 36 self.forcing_terms.append(gravity) 37 37 self.forcing_terms.append(manning_friction) 38 39 #Realtime visualisation 40 self.visualise = False 41 42 43 #Stored output 44 self.store=False 45 self.format = 'dat' 46 self.smooth = True 47 48 #Reduction operation for get_vertex_values 49 #from pytools.stats import mean 50 #self.reduction = mean 51 self.reduction = min #Looks better near steep slopes 52 38 53 39 54 #Establish shortcuts to relevant quantities (for efficiency) … … 84 99 #(either from this module or C-extension) 85 100 distribute_to_vertices_and_edges(self) 101 102 103 def evolve(self, yieldstep = None, finaltime = None): 104 #Call basic machinery from parent class 105 106 107 if self.visualise is True and self.time == 0.0: 108 import realtime_visualisation as visualise 109 visualise.create_surface(self) 110 111 #Store model data, e.g. for visualisation 112 if self.store is True and self.time == 0.0: 113 self.store_bathymetry() 114 ###self.store_conserved_quantities() 115 116 for t in Generic_domain.evolve(self, yieldstep, finaltime): 117 #Real time viz 118 if self.visualise is True: 119 visualise.update(self) 120 121 #Store model data, e.g. for subsequent visualisation 122 if self.store is True: 123 self.store_conserved_quantities() 124 125 #Pass control on to outer loop for more specific actions 126 yield(t) 86 127 87 128 -
inundation/ga/storm_surge/pyvolution/show_balanced_limiters.py
r265 r269 31 31 origin=(-0.07, 0)) 32 32 33 print 'Number of elements', len(vertices) 33 34 #Create shallow water domain 34 35 domain = Domain(points, vertices, boundary) … … 80 81 81 82 #Evolve 82 for t in domain.evolve(yieldstep = 0.1, finaltime = 50):83 for t in domain.evolve(yieldstep = 0.1, finaltime = 30): 83 84 domain.write_time() 84 85 #print domain.quantities['level'].centroid_values[:6] 85 86 print 'Done' 86 87 88 raw_input()
Note: See TracChangeset
for help on using the changeset viewer.