Ignore:
Timestamp:
Nov 9, 2004, 10:41:43 PM (20 years ago)
Author:
ole
Message:

Identified potential optimisation in Manning friction using Taylor expansion

File:
1 edited

Legend:

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

    r514 r515  
    819819   
    820820    for k in range(N):
    821         if h[k] >= eps:
    822             S = -g * eta[k]**2 * sqrt((uh[k]**2 + vh[k]**2))
    823             S /= h[k]**(7.0/3)
    824 
    825             #Update momentum
    826             xmom_update[k] += S*uh[k]
    827             ymom_update[k] += S*vh[k]
     821        if eta[k] >= eps:
     822            if h[k] >= eps:
     823                S = -g * eta[k]**2 * sqrt((uh[k]**2 + vh[k]**2))
     824                S /= h[k]**(7.0/3)
     825
     826                #Update momentum
     827                xmom_update[k] += S*uh[k]
     828                ymom_update[k] += S*vh[k]
    828829           
    829830       
     
    838839    w = domain.quantities['level'].centroid_values
    839840    z = domain.quantities['elevation'].centroid_values
    840     h = w-z
     841   
    841842    uh = xmom.centroid_values
    842843    vh = ymom.centroid_values
     
    851852
    852853    from shallow_water_ext import manning_friction
    853     manning_friction(g, eps, h, uh, vh, eta, xmom_update, ymom_update)
     854    manning_friction(g, eps, w, z, uh, vh, eta, xmom_update, ymom_update)
    854855       
    855856
Note: See TracChangeset for help on using the changeset viewer.