Changeset 243


Ignore:
Timestamp:
Aug 30, 2004, 4:58:48 PM (21 years ago)
Author:
ole
Message:

Clean up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r242 r243  
    339339def distribute_to_vertices_and_edges(domain):
    340340
    341     protect_against_negative_heights_centroid(domain)
     341    protect_against_infintesimal_and_negative_heights(domain)   
    342342    if domain.order == 1:
    343343        extrapolate_first_order(domain)
     
    353353
    354354
    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
     356def protect_against_infintesimal_and_negative_heights(domain):
    386357    """Protect against infinitesimal heights and associated high velocities
    387358    """
    388 
    389     #FIXME: Change name appropriately
    390359   
    391360    #Shortcuts
     
    501470
    502471    balance_deep_and_shallow(domain)
    503     ##protect_against_infinitesimal_heights(domain)  #FIXME: Probably not necessary
    504 
    505472
    506473
Note: See TracChangeset for help on using the changeset viewer.