Ignore:
Timestamp:
Sep 6, 2004, 11:43:36 AM (20 years ago)
Author:
ole
Message:

Implemented protect in c and noted improvement.
Pyvolution is now faster than the previous version.

File:
1 edited

Legend:

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

    r272 r273  
    426426            #Control momentum
    427427            xmomc[k] = ymomc[k] = 0.0
     428           
     429
     430
     431def protect_against_infintesimal_and_negative_heights_c(domain):
     432    """Protect against infinitesimal heights and associated high velocities
     433    """
     434   
     435    #Shortcuts
     436    wc = domain.quantities['level'].centroid_values
     437    zc = domain.quantities['elevation'].centroid_values
     438    xmomc = domain.quantities['xmomentum'].centroid_values
     439    ymomc = domain.quantities['ymomentum'].centroid_values           
     440
     441    from shallow_water_ext import protect
     442
     443    protect(domain.minimum_allowed_height, wc, zc, xmomc, ymomc)
     444   
     445
    428446
    429447def extrapolate_first_order(domain):
     
    954972    gravity = gravity_c
    955973    manning_friction = manning_friction_c
    956     balance_deep_and_shallow = balance_deep_and_shallow_c
     974    balance_deep_and_shallow = balance_deep_and_shallow_c
     975    protect_against_infintesimal_and_negative_heights = protect_against_infintesimal_and_negative_heights_c
    957976   
    958977    #distribute_to_vertices_and_edges = distribute_to_vertices_and_edges_c
Note: See TracChangeset for help on using the changeset viewer.