Ignore:
Timestamp:
Nov 11, 2010, 11:55:52 AM (14 years ago)
Author:
habili
Message:

Fixed bug where starttime and duration in the evolve function did not produce correct results. Starttime is now set in the constructor of Domain and is 0 by default. time is is to starttime. Also a bug was fixed where duration did not correctly calculate the finaltime. Associated unit tests have also been fixed to reflect the change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water/test_forcing.py

    r7844 r8068  
    591591        domain.forcing_terms.append(R)
    592592
    593         # This will test that time used in the forcing function takes
    594         # startime into account.
    595         domain.starttime = 5.0
    596 
    597         domain.time = 7.
     593        # This will test that time is set to starttime in set_starttime
     594        domain.set_starttime(5.0)
    598595
    599596        domain.compute_forcing_terms()
     
    602599                            (3*domain.get_time() + 7)/1000)
    603600        assert num.allclose(domain.quantities['stage'].explicit_update[1],
    604                             (3*(domain.time + domain.starttime) + 7)/1000)
    605 
    606         # Using internal time her should fail
    607         assert not num.allclose(domain.quantities['stage'].explicit_update[1],
    608                                 (3*domain.time + 7)/1000)
     601                            (3*domain.get_starttime() + 7)/1000)
    609602
    610603        assert num.allclose(domain.quantities['stage'].explicit_update[0], 0)
     
    657650        domain.forcing_terms.append(R)
    658651
    659         # This will test that time used in the forcing function takes
    660         # startime into account.
    661         domain.starttime = 5.0
    662 
    663         domain.time = 7.
     652        # This will test that time is set to starttime in set_starttime
     653        domain.set_starttime(5.0)
    664654
    665655        domain.compute_forcing_terms()
     
    668658                            (3*domain.get_time() + 7)/1000)
    669659        assert num.allclose(domain.quantities['stage'].explicit_update[1],
    670                             (3*(domain.time + domain.starttime) + 7)/1000)
    671 
    672         # Using internal time her should fail
    673         assert not num.allclose(domain.quantities['stage'].explicit_update[1],
    674                                 (3*domain.time + 7)/1000)
     660                            (3*domain.get_starttime() + 7)/1000)
    675661
    676662        assert num.allclose(domain.quantities['stage'].explicit_update[0], 0)
Note: See TracChangeset for help on using the changeset viewer.