Changeset 4553


Ignore:
Timestamp:
Jun 21, 2007, 11:57:19 AM (17 years ago)
Author:
ole
Message:

Untabified test in accordance with style guide

File:
1 edited

Legend:

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

    r4551 r4553  
    11051105        domain.set_quantities_to_be_stored(None)
    11061106        domain.set_maximum_allowed_speed(100) #
    1107        
    1108         # FIXME (Ole): Need tests where this is commented out
    1109         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     1107       
     1108        # FIXME (Ole): Need tests where this is commented out
     1109        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
    11101110        domain.H0 = 0 # Backwards compatibility (6/2/7)
    11111111        domain.beta_h = 0.2 # Backwards compatibility (14/2/7)
     
    12311231        domain.set_quantity('stage', stage)
    12321232
    1233         # Allow slope limiters to work (FIXME (Ole): Shouldn't this be automatic in ANUGA?)     
    1234         domain.distribute_to_vertices_and_edges()       
     1233        # Allow slope limiters to work (FIXME (Ole): Shouldn't this be automatic in ANUGA?)     
     1234        domain.distribute_to_vertices_and_edges()       
    12351235
    12361236        initial_stage = copy.copy(domain.quantities['stage'].vertex_values)
     
    20132013        L = domain.quantities['stage'].vertex_values
    20142014
    2015         # Get reference values
    2016         volumes = []
    2017         for i in range(len(L)):
    2018             volumes.append(sum(L[i])/3)
    2019             assert allclose(volumes[i], domain.quantities['stage'].centroid_values[i]) 
    2020        
    2021        
    2022         domain._order_ = 1
    2023        
    2024         domain.limit2007 = 0
     2015        # Get reference values
     2016        volumes = []
     2017        for i in range(len(L)):
     2018            volumes.append(sum(L[i])/3)
     2019            assert allclose(volumes[i], domain.quantities['stage'].centroid_values[i]) 
     2020       
     2021       
     2022        domain._order_ = 1
     2023       
     2024        domain.limit2007 = 0
    20252025        domain.distribute_to_vertices_and_edges()
    20262026        assert allclose(L[1], [0.1, 20.1, 20.1])
    2027         for i in range(len(L)):
    2028             assert allclose(volumes[i], sum(L[i])/3)                   
    2029        
    2030         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2027        for i in range(len(L)):
     2028            assert allclose(volumes[i], sum(L[i])/3)                   
     2029       
     2030        domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
    20312031        domain.distribute_to_vertices_and_edges()
    20322032        assert allclose(L[1], [0.298, 20.001, 20.001])
    2033         for i in range(len(L)):
    2034             assert allclose(volumes[i], sum(L[i])/3)   
     2033        for i in range(len(L)):
     2034            assert allclose(volumes[i], sum(L[i])/3)   
    20352035
    20362036        domain._order_ = 2
    2037        
    2038         domain.limit2007 = 0
     2037       
     2038        domain.limit2007 = 0
    20392039        domain.distribute_to_vertices_and_edges()
    2040         assert allclose(L[1], [0.1, 20.1, 20.1])       
    2041         for i in range(len(L)):
    2042             assert allclose(volumes[i], sum(L[i])/3)           
    2043        
    2044         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2040        assert allclose(L[1], [0.1, 20.1, 20.1])       
     2041        for i in range(len(L)):
     2042            assert allclose(volumes[i], sum(L[i])/3)           
     2043       
     2044        domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
    20452045        domain.distribute_to_vertices_and_edges()
    20462046        assert allclose(L[1], [0.298, 20.001, 20.001])
    2047         for i in range(len(L)):
    2048             assert allclose(volumes[i], sum(L[i])/3)   
    2049        
     2047        for i in range(len(L)):
     2048            assert allclose(volumes[i], sum(L[i])/3)   
     2049       
    20502050
    20512051
     
    20842084
    20852085        # Get reference values
    2086         volumes = []
    2087         for i in range(len(L)):
    2088             volumes.append(sum(L[i])/3)
    2089             assert allclose(volumes[i], domain.quantities['stage'].centroid_values[i]) 
    2090        
     2086        volumes = []
     2087        for i in range(len(L)):
     2088            volumes.append(sum(L[i])/3)
     2089            assert allclose(volumes[i], domain.quantities['stage'].centroid_values[i]) 
     2090       
    20912091        #print E
    20922092        domain._order_ = 1
    2093        
    2094         domain.limit2007 = 0
     2093       
     2094        domain.limit2007 = 0
    20952095        domain.distribute_to_vertices_and_edges()
    2096         assert allclose(L[1], [4.1, 16.1, 20.1])       
    2097         for i in range(len(L)):
     2096        assert allclose(L[1], [4.1, 16.1, 20.1])       
     2097        for i in range(len(L)):
    20982098            assert allclose(volumes[i], sum(L[i])/3)
    2099        
    2100                 
    2101         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2099       
     2100                
     2101        domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
    21022102        domain.distribute_to_vertices_and_edges()
    21032103        assert allclose(L[1], [4.2386, 16.0604, 20.001])
    2104         for i in range(len(L)):
    2105             assert allclose(volumes[i], sum(L[i])/3)   
    2106        
     2104        for i in range(len(L)):
     2105            assert allclose(volumes[i], sum(L[i])/3)   
     2106       
    21072107
    21082108        domain._order_ = 2
    2109        
    2110         domain.limit2007 = 0   
     2109       
     2110        domain.limit2007 = 0   
    21112111        domain.distribute_to_vertices_and_edges()
    21122112        assert allclose(L[1], [4.1, 16.1, 20.1])
    2113         for i in range(len(L)):
    2114             assert allclose(volumes[i], sum(L[i])/3)   
    2115        
    2116         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2113        for i in range(len(L)):
     2114            assert allclose(volumes[i], sum(L[i])/3)   
     2115       
     2116        domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
    21172117        domain.distribute_to_vertices_and_edges()
    21182118        assert allclose(L[1], [4.23370103, 16.06529897, 20.001])
    2119         for i in range(len(L)):
     2119        for i in range(len(L)):
    21202120            assert allclose(volumes[i], sum(L[i])/3)
    21212121
     
    21702170        domain.beta_vh_dry = 0.9
    21712171        domain.beta_h = 0.0 #Use first order in h-limiter
    2172        
    2173         # FIXME (Ole): Need tests where this is commented out
    2174         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
    2175        
    2176                
     2172       
     2173        # FIXME (Ole): Need tests where this is commented out
     2174        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     2175       
     2176               
    21772177        domain.distribute_to_vertices_and_edges()
    21782178
     
    22582258
    22592259        #Also check that Python and C version produce the same
    2260         # No longer applicable if limit2007 == 1
    2261         #print stage.vertex_values
     2260        # No longer applicable if limit2007 == 1
     2261        #print stage.vertex_values
    22622262        #assert allclose (stage.vertex_values,
    22632263        #                 [[2,2,2],
     
    30913091
    30923092        # FIXME (Ole): Need some other assertion here!
    3093         #print domain.min_timestep, domain.max_timestep   
     3093        #print domain.min_timestep, domain.max_timestep   
    30943094        #assert allclose(domain.min_timestep, 0.050010003001)
    30953095        #assert allclose(domain.max_timestep, 0.050010003001)
     
    31113111        domain.default_order = 1
    31123112        domain.beta_h = 0.0 # Use first order in h-limiter
    3113        
    3114         # FIXME (Ole): Need tests where these two are commented out
     3113       
     3114        # FIXME (Ole): Need tests where these two are commented out
    31153115        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3116         domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
     3116        domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
    31173117
    31183118        #Bed-slope and friction
     
    31843184        domain.beta_vh_dry = 0.9
    31853185
    3186        
    3187         # FIXME (Ole): Need tests where this is commented out
    3188         domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
    3189        
     3186       
     3187        # FIXME (Ole): Need tests where this is commented out
     3188        domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
     3189       
    31903190        #Bed-slope and friction at vertices (and interpolated elsewhere)
    31913191        def x_slope(x, y):
     
    32803280        domain.beta_vh_dry = 0.9
    32813281        domain.beta_h = 0.0 #Use first order in h-limiter
    3282        
    3283         # FIXME (Ole): Need tests where this is commented out
    3284         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3282       
     3283        # FIXME (Ole): Need tests where this is commented out
     3284        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
    32853285        domain.H0 = 0 # Backwards compatibility (6/2/7)       
    32863286
     
    33823382        domain.beta_vh_dry = 0.9
    33833383        domain.beta_h = 0.0 #Use first order in h-limiter
    3384        
    3385         # FIXME (Ole): Need tests where this is commented out
    3386         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3384       
     3385        # FIXME (Ole): Need tests where this is commented out
     3386        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
    33873387        domain.H0 = 0 # Backwards compatibility (6/2/7)
    33883388
     
    34803480        domain.beta_vh_dry = 0.9
    34813481        domain.beta_h = 0.0 #Use first order in h-limiter
    3482        
    3483        
    3484         # FIXME (Ole): Need tests where these two are commented out
     3482       
     3483       
     3484        # FIXME (Ole): Need tests where these two are commented out
    34853485        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3486         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
    3487        
    3488                
     3486        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3487       
     3488               
    34893489
    34903490        #Bed-slope and friction at vertices (and interpolated elsewhere)
     
    35953595
    35963596        Test shallow water finite volumes, using parameters from
    3597         feb 2007 rather than backward compatibility ad infinitum
     3597        feb 2007 rather than backward compatibility ad infinitum
    35983598       
    35993599        """
     
    36163616        domain.beta_h = 0.0 #Use first order in h-limiter
    36173617        domain.H0 = 0.001
    3618         domain.limit2007 = 1
     3618        domain.limit2007 = 1
    36193619
    36203620        #Bed-slope and friction at vertices (and interpolated elsewhere)
     
    36683668
    36693669
    3670            
     3670           
    36713671        assert allclose(domain.quantities['stage'].centroid_values,
    3672         [-0.03348416, -0.01749303, -0.03299091, -0.01739241, -0.03246447, -0.01732016,
    3673           -0.03205390, -0.01717833, -0.03146383, -0.01699831, -0.03076577, -0.01671795,
    3674           -0.07952656, -0.06684763, -0.07721455, -0.06668388, -0.07632976, -0.06600113,
    3675           -0.07523678, -0.06546373, -0.07447040, -0.06508861, -0.07438723, -0.06359288,
    3676           -0.12526729, -0.11205668, -0.12179433, -0.11068104, -0.12048395, -0.10968948,
    3677           -0.11912023, -0.10862628, -0.11784090, -0.10803744, -0.11790629, -0.10742354,
    3678           -0.16859613, -0.15427413, -0.16664444, -0.15464452, -0.16570816, -0.15327556,
    3679           -0.16409162, -0.15204092, -0.16264608, -0.15102139, -0.16162736, -0.14969205,
    3680           -0.18736511, -0.19874036, -0.18811230, -0.19758289, -0.18590182, -0.19580301,
    3681           -0.18234588, -0.19423215, -0.18100376, -0.19380116, -0.18509710, -0.19501636,
    3682           -0.13982382, -0.14166819, -0.14132775, -0.14528694, -0.14096905, -0.14351126,
    3683           -0.13800356, -0.14027920, -0.13613538, -0.13936795, -0.13621902, -0.14204982])
     3672        [-0.03348416, -0.01749303, -0.03299091, -0.01739241, -0.03246447, -0.01732016,
     3673          -0.03205390, -0.01717833, -0.03146383, -0.01699831, -0.03076577, -0.01671795,
     3674          -0.07952656, -0.06684763, -0.07721455, -0.06668388, -0.07632976, -0.06600113,
     3675          -0.07523678, -0.06546373, -0.07447040, -0.06508861, -0.07438723, -0.06359288,
     3676          -0.12526729, -0.11205668, -0.12179433, -0.11068104, -0.12048395, -0.10968948,
     3677          -0.11912023, -0.10862628, -0.11784090, -0.10803744, -0.11790629, -0.10742354,
     3678          -0.16859613, -0.15427413, -0.16664444, -0.15464452, -0.16570816, -0.15327556,
     3679          -0.16409162, -0.15204092, -0.16264608, -0.15102139, -0.16162736, -0.14969205,
     3680          -0.18736511, -0.19874036, -0.18811230, -0.19758289, -0.18590182, -0.19580301,
     3681          -0.18234588, -0.19423215, -0.18100376, -0.19380116, -0.18509710, -0.19501636,
     3682          -0.13982382, -0.14166819, -0.14132775, -0.14528694, -0.14096905, -0.14351126,
     3683          -0.13800356, -0.14027920, -0.13613538, -0.13936795, -0.13621902, -0.14204982])
    36843684
    36853685                     
     
    37413741        domain.beta_vh_dry = 0.9
    37423742        domain.beta_h = 0.0 #Use first order in h-limiter
    3743        
    3744         # FIXME (Ole): Need tests where these two are commented out
     3743       
     3744        # FIXME (Ole): Need tests where these two are commented out
    37453745        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3746         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                         
     3746        domain.limit2007 = 0 # Backwards compatibility (14/4/7)                         
    37473747       
    37483748
     
    43834383
    43844384
    4385         domain.distribute_to_vertices_and_edges()               
     4385        domain.distribute_to_vertices_and_edges()               
    43864386
    43874387       
     
    44004400        for t in domain.evolve(yieldstep = 0.1, finaltime = 0.3):
    44014401           
    4402             #domain.write_time(track_speeds=True)
     4402            #domain.write_time(track_speeds=True)
    44034403            stage = domain.quantities['stage'].vertex_values
    44044404
Note: See TracChangeset for help on using the changeset viewer.