Ignore:
Timestamp:
Aug 5, 2010, 8:20:47 PM (14 years ago)
Author:
mungkasi
Message:

Modifying codes so that arrays are compatible with numpy instead of Numeric.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/sudi/sw_1d/periodic_waves/cg/quantity.py

    r7837 r7922  
    2424
    2525        from domain import Domain
    26         from Numeric import array, zeros, Float
     26        from Numeric import Float
     27        from numpy import array, zeros
    2728
    2829        msg = 'First argument in Quantity.__init__ '
     
    6061
    6162
    62         from Numeric import zeros, Float
     63        from Numeric import Float
     64        from numpy import zeros
    6365       
    6466        #Allocate space for boundary values
     
    194196        """
    195197
    196         from Numeric import array, Float
     198        from Numeric import Float
     199        from numpy import zeros
    197200
    198201        values = array(values).astype(Float)
     
    237240
    238241        """
    239         from Numeric import take
     242        from numpy import take
    240243
    241244        if location not in ['vertices', 'centroids', 'unique vertices']:
     
    310313        """
    311314
    312         from Numeric import concatenate, zeros, Float, Int, array, reshape
     315        from Numeric import Float, Int
     316        from numpy import concatenate, zeros, array, reshape       
    313317
    314318
     
    402406        """
    403407
    404         from Numeric import sum, equal, ones, Float
     408        from Numeric import Float
     409        from numpy import sum, equal, ones
    405410
    406411        N = self.centroid_values.shape[0]
     
    427432        #print 'compute_gradient'
    428433
    429         from Numeric import array, zeros, Float
     434        from Numeric import Float
     435        from numpy import array, zeros
    430436
    431437        N = self.centroid_values.shape[0]
     
    518524        #print 'compute_minmod_gradients'
    519525       
    520         from Numeric import array, zeros, Float,sign
     526        from Numeric import Float,sign
     527        from numpy import array, zeros
    521528       
    522529        def xmin(a,b):
     
    712719        vertex values are updated
    713720        """
    714         from Numeric import zeros, Float
     721        from Numeric import Float
     722        from numpy import zeros
    715723
    716724        N = self.domain.number_of_elements
     
    763771    def limit_range(self):
    764772        import sys
    765         from Numeric import zeros, Float
     773        from Numeric import Float
     774        from numpy import zeros
    766775        from util import minmod, minmod_kurganov, maxmod, vanleer, vanalbada
    767776        limiter = self.domain.limiter
     
    822831
    823832        import sys
    824         from Numeric import zeros, Float
     833        from Numeric import Float
     834        from numpy import zeros
    825835        from util import minmod, minmod_kurganov, maxmod, vanleer
    826836
     
    950960    #from domain import Domain
    951961    from domain_cg import Domain   
    952     from Numeric import arange
     962    from numpy import arange
    953963   
    954964    points1 = [0.0, 1.0, 2.0, 3.0]
Note: See TracChangeset for help on using the changeset viewer.