Changeset 3804


Ignore:
Timestamp:
Oct 16, 2006, 10:06:55 PM (17 years ago)
Author:
steve
Message:

Changed the calculation of last timestep

Location:
anuga_core/source/anuga
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py

    r3773 r3804  
    756756
    757757            #Yield results
    758             if finaltime is not None and self.time >= finaltime:
     758            from anuga.config import epsilon
     759            if finaltime is not None and self.time >= finaltime-epsilon:
    759760
    760761                if self.time > finaltime:
     
    764765
    765766                # Yield final time and stop
     767                self.time = finaltime
    766768                yield(self.time)
    767769                break
     
    859861
    860862        #Ensure that final time is not exceeded
    861         if finaltime is not None and self.time + timestep > finaltime:
     863        if finaltime is not None and self.time + timestep > finaltime :
    862864            timestep = finaltime-self.time
    863865
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r3803 r3804  
    10311031        G3 = [-0.45000000000000001, -0.37713945714588398, -0.33029565026933816, -0.30598209033945367, -0.28847101155177313, -0.27211191064563195, -0.25701544058818926, -0.24298945948410997, -0.23010402733784807, -0.21820351802867713, -0.20709938367218383, -0.19719881806182216, -0.18568281604361933, -0.16828653906676322, -0.16977310768235579, -0.1832707289594605, -0.19483524345250974, -0.20233480051649216, -0.20630757214159207, -0.20763927857964531, -0.20724458160595791, -0.20599191745446047, -0.20438329669495012, -0.20256105512496606, -0.20071269486729407, -0.19934403619901719, -0.19866860191898347, -0.19849975056296071, -0.19860870923007437, -0.19885838217851401, -0.19916422433758982, -0.19946861981642039, -0.19972267778871666, -0.19993013816258154, -0.20011063428833351, -0.20024891930311628, -0.20031882555219671, -0.20031326268593497, -0.20024881068472311, -0.20015443214902759, -0.20005669097631221, -0.19997542564643309, -0.19992564006223304, -0.19990746148869892, -0.19990923999172872, -0.19991956416813192, -0.19993484556273733, -0.1999538628054662, -0.19997381636620407, -0.19999130900268777, -0.20000388227457688]
    10321032
    1033         #assert allclose(gauge_values[0], G0)
    1034         print len(G0), len(gauge_values[0])
    1035         print len(G1), len(gauge_values[1])
     1033##         print len(G0), len(gauge_values[0])
     1034##         print len(G1), len(gauge_values[1])
     1035##         print gauge_values[0]
     1036##         print G0
    10361037
    10371038       
     1039
     1040
     1041        assert allclose(gauge_values[0], G0)
    10381042        assert allclose(gauge_values[1], G1)
    10391043        assert allclose(gauge_values[2], G2)
Note: See TracChangeset for help on using the changeset viewer.