Ignore:
Timestamp:
Jun 17, 2010, 5:34:13 PM (13 years ago)
Author:
steve
Message:

Changing for loop to numpy.where

File:
1 moved

Legend:

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

    r7851 r7855  
    66
    77
    8 from generic_domain import Generic_domain as Domain
     8from anuga_1d.base.generic_domain import Generic_domain as Domain
    99#from shallow_water_domain import flux_function as domain_flux_function
    1010
    11 from quantity import *
     11from anuga_1d.base.quantity import *
    1212
    1313
     
    3737        self.domain6 = Domain(self.points6)
    3838
    39 
    4039    def tearDown(self):
    4140        pass
     
    4645
    4746        assert self.domain4.boundary  == {(0, 0): 'left', (3, 1): 'right'}
     47
    4848       
    4949    def test_creation(self):
     
    497497
    498498
     499    def test_find_qmax_qmin(self):
     500        quantity = Quantity(self.domain4)
     501
     502
     503        quantity.set_values([1.0, 4.0, 8.0, 2.0],
     504                            location = 'centroids')
     505
     506
     507
     508        quantity.find_qmax_qmin()
     509
     510
     511        assert allclose(quantity.qmax, [4.0, 8.0, 8.0, 8.0])
     512        assert allclose(quantity.qmin, [1.0, 1.0, 2.0, 2.0])
     513
     514
    499515    def test_distribute_first_order(self):
    500516        quantity = Quantity(self.domain4)
Note: See TracChangeset for help on using the changeset viewer.