Ignore:
Timestamp:
Jun 18, 2010, 5:49:57 PM (12 years ago)
Author:
steve
Message:

Continuing to numpy the for loops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/2010-projects/anuga_1d/base/test_generic_domain.py

    r7855 r7860  
    4646            [[-1.,  1.],[-1.,  1.],[-1.,  1.]])
    4747
     48    def test_set_timestepping_method(self):
     49
     50        domain = Generic_domain(self.points)
     51
     52        domain.set_timestepping_method('euler')
     53        assert domain.timestepping_method == 'euler'
     54
     55        domain.set_timestepping_method('rk2')
     56        assert domain.timestepping_method == 'rk2'
     57
     58        domain.set_timestepping_method('rk3')
     59        assert domain.timestepping_method == 'rk3'
     60
     61        domain.set_timestepping_method(1)
     62        assert domain.timestepping_method == 'euler'
     63
     64        domain.set_timestepping_method(2)
     65        assert domain.timestepping_method == 'rk2'
     66
     67        domain.set_timestepping_method(3)
     68        assert domain.timestepping_method == 'rk3'
     69
     70        try:
     71            domain.set_timestepping_method(4)
     72        except:
     73            pass
     74        else:
     75            raise Exception,  'Should have raised "wrong method" error'
     76
     77    def test_set_spatial_order(self):
     78
     79        domain = Generic_domain(self.points)
     80
     81        domain.set_spatial_order(1)
     82        assert domain.order == 1
     83
     84        domain.set_spatial_order(2)
     85        assert  domain.order == 2
     86
     87
     88        try:
     89            domain.set_spatial_order(3)
     90        except:
     91            pass
     92        else:
     93            raise Exception,  'Should have raised "wrong order" error'
    4894
    4995
Note: See TracChangeset for help on using the changeset viewer.