Ignore:
Timestamp:
Oct 30, 2008, 12:20:50 PM (16 years ago)
Author:
ole
Message:

Fixed unit test that broke between changeset:5846 and changeset:5847

I have convinced myself that the problem was that although the test passed
it was wrong.
In changeset:5846 it is clear that the time boundary in the helper function
create_sww_boundary was not evaluated correctly as domain.time got updated
after the call to update_boundary in domain.py.
This caused the boundary evaluation to lag.

However, this lag was not present originally in ANUGA so this error
would have been introduced
somewhere along with the euler stepping - most likely around November 2007.

I added an assert checking that the lag is not present now or in the future.

File:
1 edited

Legend:

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

    r5847 r5878  
    6060        for t in domain.evolve(yieldstep = 10, finaltime = 20.0):
    6161            pass
     62            #print domain.boundary_statistics('stage')
     63            q = Bd.evaluate()
     64   
     65            # FIXME (Ole): This test would not have passed in
     66            # changeset:5846.
     67            msg = 'Time boundary not evaluated correctly'
     68            assert allclose(t, q[0]), msg
     69           
     70            #print domain.get_quantity('stage').get_values()
    6271            #domain.write_time()
    6372            #print "domain.time", domain.time
     73           
    6474        return boundary_filename
    6575   
     
    150160        for t in domain.evolve(yieldstep = 5, finaltime = 9.0):
    151161            pass
     162            #print domain.boundary_statistics()
    152163            #domain.write_time()
    153164            #print "domain.time", domain.time
     
    162173        assert allclose(fid.starttime, new_starttime)
    163174        fid.close()
     175       
    164176        #print "stage[2,0]", stage[2,0]
    165177        msg = "This test is a bit hand crafted, based on the output file. "
    166178        msg += "Not logic. "
    167179        msg += "It's testing that starttime is working"
    168         assert allclose(stage[2,0], 5.959411),msg
     180        assert allclose(stage[2,0], 11.9867153168),msg
    169181       
    170182       
Note: See TracChangeset for help on using the changeset viewer.