Changeset 2730


Ignore:
Timestamp:
Apr 19, 2006, 6:34:07 PM (18 years ago)
Author:
ole
Message:

More explanation of flux calculations in test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/test_shallow_water.py

    r2709 r2730  
    437437
    438438        #Flux across right edge of volume 1
    439         normal = domain.get_normal(1,0)
     439        normal = domain.get_normal(1,0) #Get normal 0 of triangle 1
     440        assert allclose(normal, [1, 0])
     441       
    440442        ql = domain.get_conserved_quantities(vol_id=1, edge=0)
     443        assert allclose(ql, [val1, 0, 0])
     444       
    441445        qr = domain.get_conserved_quantities(vol_id=2, edge=2)
     446        assert allclose(qr, [val2, 0, 0])
     447       
    442448        flux0, max_speed = flux_function(normal, ql, qr, zl, zr)
     449
     450        #Flux across edge in the east direction (as per normal vector)
    443451        assert allclose(flux0, [-15.3598804, 253.71111111, 0.])
    444452        assert allclose(max_speed, 9.21592824046)
    445453
     454
     455        #Flux across edge in the west direction (opposite sign for xmomentum)
     456        normal_opposite = domain.get_normal(2,2) #Get normal 2 of triangle 2
     457        assert allclose(normal_opposite, [-1, 0])
     458        flux_opposite, max_speed = flux_function([-1, 0], ql, qr, zl, zr)
     459        assert allclose(flux_opposite, [-15.3598804, -253.71111111, 0.])
     460       
    446461
    447462        #Flux across upper edge of volume 1
Note: See TracChangeset for help on using the changeset viewer.