Ignore:
Timestamp:
Jun 26, 2008, 1:21:05 PM (15 years ago)
Author:
ole
Message:

Retired h-limiter and beta_h as per ticket:194.
All unit tests and validation tests pass.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r5436 r5442  
    9999from anuga.config import minimum_storable_height
    100100from anuga.config import minimum_allowed_height, maximum_allowed_speed
    101 from anuga.config import g, epsilon, beta_h, beta_w, beta_w_dry,\
     101from anuga.config import g, epsilon, beta_w, beta_w_dry,\
    102102     beta_uh, beta_uh_dry, beta_vh, beta_vh_dry, tight_slope_limiters
    103103from anuga.config import alpha_balance
     
    169169        self.beta_vh     = beta_vh
    170170        self.beta_vh_dry = beta_vh_dry
    171         self.beta_h      = beta_h
    172171        self.alpha_balance = alpha_balance
    173172
     
    209208        self.quantities['ymomentum'].beta = beta
    210209       
    211         self.beta_h      = beta
    212210       
    213211
     
    420418        # self.check_integrity()
    421419
    422         msg = 'Parameter beta_h must be in the interval [0, 2['
    423         assert 0 <= self.beta_h <= 2.0, msg
    424420        msg = 'Parameter beta_w must be in the interval [0, 2['
    425421        assert 0 <= self.beta_w <= 2.0, msg
     
    859855
    860856
    861 def h_limiter(domain):
    862     """Limit slopes for each volume to eliminate artificial variance
    863     introduced by e.g. second order extrapolator
    864 
    865     limit on h = w-z
    866 
    867     This limiter depends on two quantities (w,z) so it resides within
    868     this module rather than within quantity.py
    869 
    870     Wrapper for c-extension
    871     """
    872 
    873     N = len(domain) # number_of_triangles
    874     beta_h = domain.beta_h
    875 
    876     # Shortcuts
    877     wc = domain.quantities['stage'].centroid_values
    878     zc = domain.quantities['elevation'].centroid_values
    879     hc = wc - zc
    880 
    881     wv = domain.quantities['stage'].vertex_values
    882     zv = domain.quantities['elevation'].vertex_values
    883     hv = wv - zv
    884 
    885     #Call C-extension
    886     from shallow_water_ext import h_limiter_sw
    887     hvbar = h_limiter_sw(domain, hc, hv)
    888 
    889     return hvbar
    890 
    891857
    892858def balance_deep_and_shallow(domain):
     
    904870    """
    905871
    906     # FIXME (Ole): I reckon this can be simplified significantly:
    907     #
    908     # Always use beta_h == 0, and phase it out.
    909     # Compute hc and hv in the c-code
    910     # Omit updating xmomv
    911     #
    912872    from shallow_water_ext import balance_deep_and_shallow as balance_deep_and_shallow_c
    913873
    914874
    915     #print 'calling balance depth and shallow'
    916875    # Shortcuts
    917876    wc = domain.quantities['stage'].centroid_values
     
    929888    ymomv = domain.quantities['ymomentum'].vertex_values
    930889
    931     # Limit h
    932     if domain.beta_h > 0:
    933         hvbar = h_limiter(domain)
    934        
    935         balance_deep_and_shallow_c(domain, domain.beta_h,
    936                                    wc, zc, wv, zv, hvbar,
    937                                    xmomc, ymomc, xmomv, ymomv)       
    938     else:
    939         # print 'Using first order h-limiter'
    940         # FIXME: Pass wc in for now - it will be ignored.
    941        
    942         # This is how one would make a first order h_limited value
    943         # as in the old balancer (pre 17 Feb 2005):
    944         #  If we wish to hard wire this, one should modify the C-code
    945         # from Numeric import zeros, Float
    946         # hvbar = zeros( (len(wc), 3), Float)
    947         # for i in range(3):
    948         #     hvbar[:,i] = wc[:] - zc[:]
    949 
    950         balance_deep_and_shallow_c(domain, domain.beta_h,
    951                                    wc, zc, wv, zv, wc,
    952                                    xmomc, ymomc, xmomv, ymomv)
     890    balance_deep_and_shallow_c(domain,
     891                               wc, zc, wv, zv, wc,
     892                               xmomc, ymomc, xmomv, ymomv)
    953893
    954894
Note: See TracChangeset for help on using the changeset viewer.