Changeset 243
- Timestamp:
- Aug 30, 2004, 4:58:48 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/shallow_water.py
r242 r243 339 339 def distribute_to_vertices_and_edges(domain): 340 340 341 protect_against_ negative_heights_centroid(domain)341 protect_against_infintesimal_and_negative_heights(domain) 342 342 if domain.order == 1: 343 343 extrapolate_first_order(domain) … … 353 353 354 354 355 def protect_against_infinitesimal_heights(domain): 356 """Protect against infinitesimal heights and high speeds 357 Adjust height and momentum at centroid if height is less than 358 minimum allowed height 359 """ 360 361 #FIXME: May be unnecessary 362 #Shortcuts 363 wv = domain.quantities['level'].vertex_values 364 zv = domain.quantities['elevation'].vertex_values 365 wc = domain.quantities['level'].centroid_values 366 zc = domain.quantities['elevation'].centroid_values 367 hv = wv-zv 368 hc = wc - zc 369 370 for k in range(domain.number_of_elements): 371 hmax = max(hv[k,:]) 372 373 if hmax < domain.minimum_allowed_height: 374 375 #Reset negative heights to bed elevation 376 if hc[k] < 0.0: 377 print 'C' 378 wc[k] = zc[k] 379 for i in range(3): 380 if hv[k,i] < 0.0: 381 print 'V' 382 wv[k,i] = zv[k,i] 383 384 385 def protect_against_negative_heights_centroid(domain): 355 356 def protect_against_infintesimal_and_negative_heights(domain): 386 357 """Protect against infinitesimal heights and associated high velocities 387 358 """ 388 389 #FIXME: Change name appropriately390 359 391 360 #Shortcuts … … 501 470 502 471 balance_deep_and_shallow(domain) 503 ##protect_against_infinitesimal_heights(domain) #FIXME: Probably not necessary504 505 472 506 473
Note: See TracChangeset
for help on using the changeset viewer.