Changeset 4631


Ignore:
Timestamp:
Jul 18, 2007, 6:08:10 PM (10 years ago)
Author:
ole
Message:

Refactored limit2007 to tight_slope_limiters (using eclipse)

Files:
24 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/config.py

    r4502 r4631  
    8181beta_h      = 0.2
    8282
    83 # beta_h can be safely put to zero esp if we are using limit2007 = 1. This will
     83# beta_h can be safely put to zero esp if we are using tight_slope_limiters = 1. This will
    8484# also speed things up.
    8585beta_h = 0.0
     
    9494
    9595# Flag use of new limiters.
    96 # limit2007 = 0 means use old limiters (e.g. for some tests)
    97 # limit2007 = 1 means use new limiters that hug the bathymetry closer
    98 limit2007 = 0
     96# tight_slope_limiters = 0 means use old limiters (e.g. for some tests)
     97# tight_slope_limiters = 1 means use new limiters that hug the bathymetry closer
     98tight_slope_limiters = 0
    9999
    100100
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r4554 r4631  
    100100from anuga.config import minimum_allowed_height, maximum_allowed_speed
    101101from anuga.config import g, beta_h, beta_w, beta_w_dry,\
    102      beta_uh, beta_uh_dry, beta_vh, beta_vh_dry, limit2007
     102     beta_uh, beta_uh_dry, beta_vh, beta_vh_dry, tight_slope_limiters
    103103from anuga.config import alpha_balance
    104104
     
    163163        self.alpha_balance = alpha_balance
    164164
    165         self.limit2007 = limit2007
     165        self.tight_slope_limiters = tight_slope_limiters
    166166
    167167        self.flux_function = flux_function_central
     
    232232
    233233        #FIXME (Ole): rename H0 to minimum_allowed_height_in_flux_computation
    234         #rename limit2007 to tight_slope_limiters.
     234        #rename tight_slope_limiters to tight_slope_limiters.
    235235        #Maybe use histogram to identify isolated extreme speeds and deal with them adaptively
    236236        #similarly to how we used to use 1 order steps to recover.
  • anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r4376 r4631  
    428428                              double* ymomv,
    429429                              double H0,
    430                               int limit2007,
     430                              int tight_slope_limiters,
    431431                              double alpha_balance) {
    432432
     
    451451    hmin = hv[k3];
    452452    for (i=0; i<3; i++) {
    453       if (limit2007 == 0) {
     453      if (tight_slope_limiters == 0) {
    454454        dz = max(dz, fabs(zv[k3+i]-zc[k]));
    455455      }
     
    464464   
    465465   
    466     if (limit2007 == 0) {     
     466    if (tight_slope_limiters == 0) {     
    467467      //If hmin > dz/alpha_balance then alpha = 1 and the bed will have no
    468468      //effect
     
    16391639  double H0;
    16401640
    1641   int N, limit2007; //, err;
     1641  int N, tight_slope_limiters; //, err;
    16421642
    16431643  // Convert Python arguments to C
     
    16701670
    16711671 
    1672   Tmp = PyObject_GetAttrString(domain, "limit2007");
     1672  Tmp = PyObject_GetAttrString(domain, "tight_slope_limiters");
    16731673  if (!Tmp) {
    1674     PyErr_SetString(PyExc_RuntimeError, "shallow_water_ext.c: balance_deep_and_shallow could not obtain object limit2007 from domain");
     1674    PyErr_SetString(PyExc_RuntimeError, "shallow_water_ext.c: balance_deep_and_shallow could not obtain object tight_slope_limiters from domain");
    16751675    return NULL;
    16761676  } 
    1677   limit2007 = PyInt_AsLong(Tmp);
     1677  tight_slope_limiters = PyInt_AsLong(Tmp);
    16781678  Py_DECREF(Tmp);
    16791679   
     
    16961696                            (double*) ymomv -> data,
    16971697                            H0,
    1698                             (int) limit2007,
     1698                            (int) tight_slope_limiters,
    16991699                            alpha_balance);
    17001700
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4615 r4631  
    355355        sww.store_connectivity()
    356356        sww.store_timestep('stage')
    357         #self.domain.limit2007 = 1
     357        #self.domain.tight_slope_limiters = 1
    358358        self.domain.evolve_to_end(finaltime = 0.01)
    359359        sww.store_timestep('stage')
     
    412412        sww.store_connectivity()
    413413        sww.store_timestep('stage')
    414         #self.domain.limit2007 = 1
     414        #self.domain.tight_slope_limiters = 1
    415415        self.domain.evolve_to_end(finaltime = 0.01)
    416416        sww.store_timestep('stage')
     
    464464        self.domain.store = True
    465465        self.domain.beta_h = 0
    466         #self.domain.limit2007 = 1
     466        #self.domain.tight_slope_limiters = 1
    467467
    468468        #Evolution
     
    507507        sww.store_timestep('stage')
    508508
    509         #self.domain.limit2007 = 1
     509        #self.domain.tight_slope_limiters = 1
    510510        self.domain.evolve_to_end(finaltime = 0.01)
    511511        sww.store_timestep('stage')
     
    11371137        sww.store_timestep('stage')
    11381138
    1139         #self.domain.limit2007 = 1
     1139        #self.domain.tight_slope_limiters = 1
    11401140
    11411141        self.domain.evolve_to_end(finaltime = 0.01)
     
    18511851        sww.store_timestep('stage')
    18521852       
    1853         domain.limit2007 = 1
     1853        domain.tight_slope_limiters = 1
    18541854        domain.evolve_to_end(finaltime = 0.01)
    18551855        sww.store_timestep('stage')
     
    20372037        sww.store_timestep('stage')
    20382038
    2039         #domain.limit2007 = 1
     2039        #domain.tight_slope_limiters = 1
    20402040        domain.evolve_to_end(finaltime = 0.01)
    20412041        sww.store_timestep('stage')
     
    21862186        sww.store_timestep('stage')
    21872187
    2188         #self.domain.limit2007 = 1
     2188        #self.domain.tight_slope_limiters = 1
    21892189        self.domain.evolve_to_end(finaltime = 0.01)
    21902190        sww.store_timestep('stage')
     
    22982298        sww.store_timestep('stage')
    22992299
    2300         #self.domain.limit2007 = 1
     2300        #self.domain.tight_slope_limiters = 1
    23012301        self.domain.evolve_to_end(finaltime = 0.01)
    23022302        sww.store_timestep('stage')
     
    25572557        sww.store_timestep('stage')
    25582558
    2559         #self.domain.limit2007 = 1
     2559        #self.domain.tight_slope_limiters = 1
    25602560        self.domain.evolve_to_end(finaltime = 0.01)
    25612561        sww.store_timestep('stage')
     
    26572657        sww.store_timestep('stage')
    26582658
    2659         #self.domain.limit2007 = 1
     2659        #self.domain.tight_slope_limiters = 1
    26602660        self.domain.evolve_to_end(finaltime = 0.01)
    26612661        sww.store_timestep('stage')
     
    34093409        self.domain.reduction = mean
    34103410        self.domain.set_datadir('.')
    3411         #self.domain.limit2007 = 1       
     3411        #self.domain.tight_slope_limiters = 1       
    34123412
    34133413
     
    34813481        domain.check_integrity()
    34823482        #Evolution
    3483         #domain.limit2007 = 1
     3483        #domain.tight_slope_limiters = 1
    34843484        for t in domain.evolve(yieldstep = yiel, finaltime = 0.05):
    34853485            #domain.write_time()
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r4588 r4631  
    976976        domain = Domain(points, vertices, boundary)
    977977        domain.set_name('runup_test')
    978         #domain.limit2007 = 1 #FIXME: This works better with old limiters
     978        #domain.tight_slope_limiters = 1 #FIXME: This works better with old limiters
    979979
    980980        #--------------------------------------------------------------
     
    11691169       
    11701170        # FIXME (Ole): Need tests where this is commented out
    1171         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     1171        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                 
    11721172        domain.H0 = 0 # Backwards compatibility (6/2/7)
    11731173        domain.beta_h = 0.2 # Backwards compatibility (14/2/7)
     
    20842084        domain._order_ = 1
    20852085       
    2086         domain.limit2007 = 0
     2086        domain.tight_slope_limiters = 0
    20872087        domain.distribute_to_vertices_and_edges()
    20882088        assert allclose(L[1], [0.1, 20.1, 20.1])
     
    20902090            assert allclose(volumes[i], sum(L[i])/3)                   
    20912091       
    2092         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2092        domain.tight_slope_limiters = 1 # Allow triangle to be flatter (closer to bed)
    20932093        domain.distribute_to_vertices_and_edges()
    20942094        assert allclose(L[1], [0.298, 20.001, 20.001])
     
    20982098        domain._order_ = 2
    20992099       
    2100         domain.limit2007 = 0
     2100        domain.tight_slope_limiters = 0
    21012101        domain.distribute_to_vertices_and_edges()
    21022102        assert allclose(L[1], [0.1, 20.1, 20.1])       
     
    21042104            assert allclose(volumes[i], sum(L[i])/3)           
    21052105       
    2106         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2106        domain.tight_slope_limiters = 1 # Allow triangle to be flatter (closer to bed)
    21072107        domain.distribute_to_vertices_and_edges()
    21082108        assert allclose(L[1], [0.298, 20.001, 20.001])
     
    21542154        domain._order_ = 1
    21552155       
    2156         domain.limit2007 = 0
     2156        domain.tight_slope_limiters = 0
    21572157        domain.distribute_to_vertices_and_edges()
    21582158        assert allclose(L[1], [4.1, 16.1, 20.1])       
     
    21612161       
    21622162               
    2163         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2163        domain.tight_slope_limiters = 1 # Allow triangle to be flatter (closer to bed)
    21642164        domain.distribute_to_vertices_and_edges()
    21652165        assert allclose(L[1], [4.2386, 16.0604, 20.001])
     
    21702170        domain._order_ = 2
    21712171       
    2172         domain.limit2007 = 0   
     2172        domain.tight_slope_limiters = 0   
    21732173        domain.distribute_to_vertices_and_edges()
    21742174        assert allclose(L[1], [4.1, 16.1, 20.1])
     
    21762176            assert allclose(volumes[i], sum(L[i])/3)   
    21772177       
    2178         domain.limit2007 = 1 # Allow triangle to be flatter (closer to bed)
     2178        domain.tight_slope_limiters = 1 # Allow triangle to be flatter (closer to bed)
    21792179        domain.distribute_to_vertices_and_edges()
    21802180        assert allclose(L[1], [4.23370103, 16.06529897, 20.001])
     
    22342234       
    22352235        # FIXME (Ole): Need tests where this is commented out
    2236         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     2236        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                 
    22372237       
    22382238               
     
    23202320
    23212321        #Also check that Python and C version produce the same
    2322         # No longer applicable if limit2007 == 1
     2322        # No longer applicable if tight_slope_limiters == 1
    23232323        #print stage.vertex_values
    23242324        #assert allclose (stage.vertex_values,
     
    31763176        # FIXME (Ole): Need tests where these two are commented out
    31773177        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3178         domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
     3178        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)         
    31793179
    31803180        #Bed-slope and friction
     
    32483248       
    32493249        # FIXME (Ole): Need tests where this is commented out
    3250         domain.limit2007 = 0 # Backwards compatibility (14/4/7)         
     3250        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)         
    32513251       
    32523252        #Bed-slope and friction at vertices (and interpolated elsewhere)
     
    33443344       
    33453345        # FIXME (Ole): Need tests where this is commented out
    3346         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3346        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                 
    33473347        domain.H0 = 0 # Backwards compatibility (6/2/7)       
    33483348
     
    34463446       
    34473447        # FIXME (Ole): Need tests where this is commented out
    3448         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3448        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                 
    34493449        domain.H0 = 0 # Backwards compatibility (6/2/7)
    34503450
     
    35463546        # FIXME (Ole): Need tests where these two are commented out
    35473547        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3548         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                 
     3548        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                 
    35493549       
    35503550               
     
    36783678        domain.beta_h = 0.0 #Use first order in h-limiter
    36793679        domain.H0 = 0.001
    3680         domain.limit2007 = 1
     3680        domain.tight_slope_limiters = 1
    36813681
    36823682        #Bed-slope and friction at vertices (and interpolated elsewhere)
     
    38063806        # FIXME (Ole): Need tests where these two are commented out
    38073807        domain.H0 = 0        # Backwards compatibility (6/2/7)       
    3808         domain.limit2007 = 0 # Backwards compatibility (14/4/7)                         
     3808        domain.tight_slope_limiters = 0 # Backwards compatibility (14/4/7)                         
    38093809       
    38103810
     
    45374537        domain = Domain(points, vertices, boundary)
    45384538        domain.default_order = 2
    4539         domain.limit2007 = 1
     4539        domain.tight_slope_limiters = 1
    45404540        domain.H0 = 0.01
    45414541       
  • anuga_validation/automated_validation_tests/okushiri_tank_validation/run_okushiri.py

    r4491 r4631  
    6161# (this in planned to be the default!)
    6262domain.beta_h = 0.0
    63 domain.limit2007 = 1 # Run time invariant in this case
     63domain.tight_slope_limiters = 1 # Run time invariant in this case
    6464
    6565#-------------------------
  • anuga_validation/okushiri_2005/run_okushiri.py

    r4260 r4631  
    5757domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
    5858domain.set_maximum_allowed_speed(0.1)     # Allow a little runoff (0.1 is OK)
    59 domain.limit2007 = 1
     59domain.tight_slope_limiters = 1
    6060domain.beta_h = 0.0
    6161
    6262#Timings on AMD64-242 (beta_h=0)
    63 limit2007 = 0:
     63tight_slope_limiters = 0:
    6464#    3035s - 3110s
    65 limit2007 = 1:
     65tight_slope_limiters = 1:
    6666#    3000s - 3008s
    6767#
  • anuga_validation/performance_tests/okushiri/run_okushiri_profile.py

    r4578 r4631  
    6363# (this in planned to be the default!)
    6464domain.beta_h = 0.0
    65 domain.limit2007 = 1 # Run time invariant in this case
     65domain.tight_slope_limiters = 1 # Run time invariant in this case
    6666
    6767#-------------------------
  • anuga_validation/solitary_waves/solitary_wave_runup.py

    r4362 r4631  
    8787#domain.set_minimum_allowed_height(0.01)
    8888domain.beta_h = 0.0
    89 domain.limit2007 = 1
     89domain.tight_slope_limiters = 1
    9090domain.set_name(simulation_name)
    9191
  • anuga_work/development/Rudy_vandrie_2007/run_example.py

    r4440 r4631  
    6161# (this in planned to be the default!)
    6262domain.beta_h = 0.0
    63 domain.limit2007 = 0
     63domain.tight_slope_limiters = 0
    6464
    6565#-------------------------
  • anuga_work/development/Rudy_vandrie_2007/run_hydro_example.py

    r4440 r4631  
    3131domain.set_minimum_storable_height(0.0001)
    3232domain.beta_h = 0.0
    33 domain.limit2007 = 1
     33domain.tight_slope_limiters = 1
    3434
    3535
  • anuga_work/development/dam_test_from_brad_2007/dam_sample.py

    r4258 r4631  
    3030#domain.set_store_vertices_uniquely(True)      # Look at the 'real' triangles
    3131domain.beta_h = 0.0
    32 domain.limit2007 = 1
     32domain.tight_slope_limiters = 1
    3333domain.set_minimum_allowed_height(0.01)
    3434
  • anuga_work/development/demos/island.py

    r4539 r4631  
    6464
    6565domain.beta_h     = 0.0
    66 domain.limit2007 = 1
     66domain.tight_slope_limiters = 1
    6767
    6868#------------------------------------------------------------------------------
  • anuga_work/development/demos/limiter_test.py

    r4539 r4631  
    2727domain.set_store_vertices_uniquely(True)
    2828domain.set_default_order(2)
    29 domain.limit2007 = 1
     29domain.tight_slope_limiters = 1
    3030
    3131#------------------------------------------------------------------------------
  • anuga_work/production/broome_2006/run_broome_urs.py

    r4587 r4631  
    174174    print 'domain id', id(domain)
    175175    domain.beta_h = 0
    176     #domain.limit2007 = 1
     176    #domain.tight_slope_limiters = 1
    177177
    178178    #-------------------------------------------------------------------------
  • anuga_work/production/dampier_2006/run_dampier.py

    r4430 r4631  
    160160print 'domain id', id(domain)
    161161domain.beta_h = 0
    162 #domain.limit2007 = 1
     162#domain.tight_slope_limiters = 1
    163163
    164164#-------------------------------------------------------------------------
  • anuga_work/production/dampier_2006/run_dampier_simple.py

    r4357 r4631  
    233233print 'domain id', id(domain)
    234234domain.beta_h = 0
    235 domain.limit2007 = 1
     235domain.tight_slope_limiters = 1
    236236'''
    237237#-------------------------------------------------------------------------
  • anuga_work/production/dampier_2006/run_dampier_urs.py

    r4587 r4631  
    169169    print 'domain id', id(domain)
    170170    domain.beta_h = 0
    171     #domain.limit2007 = 1
     171    #domain.tight_slope_limiters = 1
    172172
    173173    #-------------------------------------------------------------------------
  • anuga_work/production/exmouth_2006/run_exmouth.py

    r4587 r4631  
    170170    domain.beta_h = 0 #sets the surface of the triangle to follow the bathy
    171171    #domain.H0=0.01 #controls the flux limiter (limiter2007)
    172     #domain.limit2007 = 1 #minimises creep
     172    #domain.tight_slope_limiters = 1 #minimises creep
    173173
    174174    #-------------------------------------------------------------------------
  • anuga_work/production/onslow_2006/run_onslow_urs.py

    r4587 r4631  
    170170    domain.beta_h = 0 #sets the surface of the triangle to follow the bathy
    171171    #domain.H0=0.01 #controls the flux limiter (limiter2007)
    172     #domain.limit2007 = 1 #minimises creep
     172    #domain.tight_slope_limiters = 1 #minimises creep
    173173
    174174    #-------------------------------------------------------------------------
  • anuga_work/production/onslow_2006/ticket160_run.py

    r4506 r4631  
    182182    domain.set_maximum_allowed_speed(0.1) # Allow a little runoff (0.1 is OK)
    183183    domain.beta_h = 0
    184     domain.limit2007 = 1
     184    domain.tight_slope_limiters = 1
    185185    domain.H0=0.01
    186186
  • anuga_work/production/pt_hedland_2006/run_pt_hedland_urs.py

    r4587 r4631  
    162162    domain.beta_h = 0 #sets the surface of the triangle to follow the bathy
    163163    #domain.H0=0.01 #controls the flux limiter (limiter2007)
    164     #domain.limit2007 = 1 #minimises creep
     164    #domain.tight_slope_limiters = 1 #minimises creep
    165165
    166166    #-------------------------------------------------------------------------
  • anuga_work/production/shark_bay_2007/run_shark_bay.py

    r4630 r4631  
    170170    print 'domain id', id(domain)
    171171    domain.beta_h = 0
    172     #domain.limit2007 = 1
     172    #domain.tight_slope_limiters = 1
    173173   
    174174
  • anuga_work/production/shark_bay_2007/run_shark_bay_frequency_sweep.py

    r4625 r4631  
    162162    print 'domain id', id(domain)
    163163    domain.beta_h = 0
    164     #domain.limit2007 = 1
     164    #domain.tight_slope_limiters = 1
    165165   
    166166
Note: See TracChangeset for help on using the changeset viewer.