Changeset 1591


Ignore:
Timestamp:
Jul 11, 2005, 11:40:37 AM (19 years ago)
Author:
ole
Message:

Introduced flag for new hardwired gradient-limiter

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

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

    r1581 r1591  
    9595
    9696
     97optimised_gradient_limiter = True #Use hardwired gradient limiter
     98
    9799#Specific to shallow water W.E.
    98100minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r1581 r1591  
    574574    """
    575575
     576    from config import optimised_gradient_limiter
     577
    576578    #Remove very thin layers of water
    577579    protect_against_infinitesimal_and_negative_heights(domain)
    578580
    579581    #Extrapolate all conserved quantities
    580     #MH090605 if second order, perform the extrapolation and limiting on all of the conserved quantities
    581     if (domain.order == 1):
     582    if optimised_gradient_limiter:
     583        #MH090605 if second order,
     584        #perform the extrapolation and limiting on
     585        #all of the conserved quantitie
     586       
     587        if (domain.order == 1):
     588            for name in domain.conserved_quantities:
     589                Q = domain.quantities[name]
     590                Q.extrapolate_first_order()
     591        elif domain.order == 2:
     592            domain.extrapolate_second_order_sw()
     593        else:
     594            raise 'Unknown order'
     595    else:   
     596        #old code:
    582597        for name in domain.conserved_quantities:
    583598            Q = domain.quantities[name]
    584             Q.extrapolate_first_order()
    585     elif domain.order == 2:
    586         domain.extrapolate_second_order_sw()
    587     else:
    588         raise 'Unknown order'
    589 
    590     #old code:
    591     #for name in domain.conserved_quantities:
    592     #    Q = domain.quantities[name]
    593     #    if domain.order == 1:
    594     #        Q.extrapolate_first_order()
    595     #    elif domain.order == 2:
    596     #        #Q.extrapolate_second_order()
    597     #        Q.limit()
    598     #    else:
    599     #        raise 'Unknown order'
     599            if domain.order == 1:
     600                Q.extrapolate_first_order()
     601            elif domain.order == 2:
     602                Q.extrapolate_second_order()
     603                Q.limit()
     604            else:
     605                raise 'Unknown order'
     606           
    600607
    601608    #Take bed elevation into account when water heights are small
Note: See TracChangeset for help on using the changeset viewer.