Ignore:
Timestamp:
Sep 7, 2007, 10:43:46 PM (17 years ago)
Author:
steve
Message:

Working on 2nd order time stepping

File:
1 edited

Legend:

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

    r4704 r4712  
    319319
    320320
    321 
    322 
    323 
     321    def test_setting_timestepping_method(self):
     322        """test_set_quanitities_to_be_monitored
     323        """
     324
     325        a = [0.0, 0.0]
     326        b = [0.0, 2.0]
     327        c = [2.0,0.0]
     328        d = [0.0, 4.0]
     329        e = [2.0, 2.0]
     330        f = [4.0,0.0]
     331
     332        points = [a, b, c, d, e, f]
     333        #bac, bce, ecf, dbe, daf, dae
     334        vertices = [ [1,0,2], [1,2,4], [4,2,5], [3,1,4]]
     335
     336
     337        domain = Domain(points, vertices, boundary=None,
     338                        conserved_quantities =\
     339                        ['stage', 'xmomentum', 'ymomentum'],
     340                        other_quantities = ['elevation', 'friction', 'depth'])
     341
     342
     343        domain.timestepping_method = None
     344
     345
     346        # Check that invalid requests are dealt with
     347        try:
     348            domain.set_timestepping_method('eee')       
     349        except:
     350            pass
     351        else:
     352            msg = 'Should have caught illegal method'
     353            raise Exception, msg
     354
     355
     356        #Should have no trouble with euler or rk2
     357        domain.set_timestepping_method('euler')
     358        domain.set_timestepping_method('rk2')
     359
     360        #test get timestepping method
     361        assert domain.get_timestepping_method() == 'rk2'
    324362
    325363
Note: See TracChangeset for help on using the changeset viewer.