Changeset 7915


Ignore:
Timestamp:
Aug 5, 2010, 6:50:49 PM (14 years ago)
Author:
mungkasi
Message:
 
Location:
trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/debris_avalanche_RUN.py

    r7837 r7915  
    22import time
    33from shallow_water_domain_avalanche import *
    4 from Numeric import array, zeros, Float, sqrt
     4from Numeric import Float, sqrt
    55from config import g, epsilon
    6 from numpy import sin, cos, tan
     6from numpy import sin, cos, tan, array, zeroz
    77from scipy import linspace
    88from parameters import *
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/domain.py

    r7837 r7915  
    2424        """
    2525
    26         from Numeric import array, zeros, Float, Int
     26        from Numeric import Float, Int
     27        from numpy import array, zeros
    2728
    2829        from config import timestepping_method
     
    175176          self.vertexlist is built
    176177        """
    177         from Numeric import array
     178        from numpy import array
    178179
    179180        vertexlist = [None]*len(self.coordinates)
     
    322323            self.element_tag is defined
    323324        """
    324         from Numeric import array, Int
     325        from Numeric import Int
     326        from numpy import array
    325327
    326328        if tagged_elements is None:
     
    393395
    394396        if obj is True:
    395             from Numeric import concatenate, reshape
     397            from numpy import concatenate, reshape
    396398            V = self.vertices
    397399            N = V.shape[0]
     
    412414        """
    413415
    414         from Numeric import zeros, Float
     416        from Numeric import Float
     417        from numpy import zeros
    415418        q = zeros( len(self.conserved_quantities), Float)
    416419        for i, name in enumerate(self.conserved_quantities):
     
    436439        """
    437440
    438         from Numeric import zeros, Float
     441        from Numeric import Float
     442        from numpy import zeros
    439443        q = zeros( len(self.evolved_quantities), Float)
    440444
     
    10791083        """
    10801084        import copy
    1081         from Numeric import zeros,Float
     1085        from Numeric import Float
     1086        from numpy import zeros
    10821087
    10831088        N = self.number_of_elements
     
    11371142        """
    11381143        import copy
    1139         from Numeric import zeros,Float
     1144        from Numeric import Float
     1145        from numpy import zeros
    11401146
    11411147        N = self.number_of_elements
     
    13521358        """
    13531359
    1354         from Numeric import ones, sum, equal, Float
     1360        from Numeric import Float
     1361        from numpy import ones, sum, equal     
    13551362
    13561363        N = self.number_of_elements
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/generic_boundary_conditions.py

    r7837 r7915  
    4343        self.velocity = domain.quantities['velocity'].vertex_values
    4444
    45         from Numeric import zeros, Float
     45        from Numeric import Float
     46        from numpy import zeros     
    4647        self.evolved_quantities = zeros(5, Float)
    4748
     
    103104            raise msg
    104105
    105         from Numeric import array, Float
     106        from Numeric import Float
     107        from numpy import zeros
    106108        self.conserved_quantities=array(conserved_quantities).astype(Float)
    107109
     
    132134
    133135
    134         from Numeric import array, Float
     136        from Numeric import Float
     137        from numpy import zeros
    135138        try:
    136139            q = array(q).astype(Float)
     
    173176    def __init__(self, filename, domain):
    174177        import time
    175         from Numeric import array
     178        from numpy import array
    176179        from config import time_format
    177180        from util import File_function
     
    223226    def __init__(self, filename, domain, verbose = False):
    224227        import time
    225         from Numeric import array, zeros, Float
     228        from Numeric import Float
     229        from numpy import zeros, array       
    226230        from config import time_format
    227231        from util import file_function
     
    421425    def __init__(self, domain = None, filename = None):
    422426        import time
    423         from Numeric import array
     427        from numpy import array
    424428        from config import time_format
    425429
     
    479483
    480484    def read_time_boundary(self):
    481         from Numeric import zeros, Float, alltrue
     485        from Numeric import Float
     486        from numpy import zeros, alltrue       
    482487        from config import time_format
    483488        import time
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/parameters.py

    r7837 r7915  
    1 from Numeric import zeros, Float, sqrt
     1from Numeric import Float, sqrt
     2from numpy import zeros
    23from config import g
    34from scipy import sin, cos, tan, arcsin, arccos, arctan, pi
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/quantity.py

    r7837 r7915  
    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 array     
    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
     
    825834
    826835        import sys
    827         from Numeric import zeros, Float
     836        from Numeric import Float
     837        from numpy import zeros 
    828838        from util import minmod, minmod_kurganov, maxmod, vanleer
    829839
     
    950960    #from domain import Domain
    951961    from shallow_water_domain import Domain     
    952     from Numeric import arange
     962    from numpy import arange
    953963   
    954964    points1 = [0.0, 1.0, 2.0, 3.0]
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/shallow_water_domain_avalanche.py

    r7837 r7915  
    218218    """
    219219
    220     from Numeric import zeros, Float
     220    from Numeric import Float
     221    from numpy import zeros
    221222
    222223    assert len(q) == 3,\
     
    266267    from config import g, epsilon, h0
    267268    from math import sqrt
    268     from Numeric import array
     269    from numpy import array
    269270
    270271    #Align momentums with x-axis
     
    336337def compute_timestep(domain):
    337338    import sys
    338     from Numeric import zeros, Float
     339    from Numeric import Float
     340    from numpy import zeros
    339341
    340342    N = domain.number_of_elements
     
    398400def compute_fluxes_C_wellbalanced(domain):
    399401    import sys
    400     from Numeric import zeros, Float
     402    from Numeric import Float
     403    from numpy import zeros
    401404   
    402405    N = domain.number_of_elements
     
    475478def compute_fluxes_C_nonwellbalanced2(domain):
    476479    import sys
    477     from Numeric import zeros, Float
     480    from Numeric import Float
     481    from numpy import zeros
    478482   
    479483    N = domain.number_of_elements
     
    582586
    583587    import sys
    584     from Numeric import zeros, Float
     588    from Numeric import Float
     589    from numpy import zeros
    585590    from config import epsilon, h0, h_min
    586591
     
    667672
    668673    import sys
    669     from Numeric import zeros, Float
     674    from Numeric import Float
     675    from numpy import zeros
    670676    from config import epsilon, h0
    671677
     
    774780    """
    775781
    776     from Numeric import zeros, Float
     782    from Numeric import Float
     783    from numpy import zeros
    777784
    778785    N = domain.number_of_elements
     
    941948
    942949    from util import gradient
    943     from Numeric import zeros, Float, array, sum
     950    from Numeric import Float
     951    from numpy import zeros, array, sum   
    944952
    945953    xmom = domain.quantities['xmomentum'].explicit_update
     
    975983
    976984    from util import gradient
    977     from Numeric import zeros, Float, array, sum
     985    from Numeric import Float
     986    from numpy import zeros, array, sum 
    978987    from parameters import F1#This is an additional friction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    979988
     
    10111020
    10121021    from util import gradient
    1013     from Numeric import zeros, Float, array, sum
     1022    from Numeric import Float
     1023    from numpy import zeros, array, sum 
    10141024    from parameters import F2#This is an additional friction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    10151025
     
    11111121    """
    11121122
    1113     from Numeric import ones, Float, array
     1123    from Numeric import Float
     1124    from numpy import ones, array   
    11141125
    11151126
     
    11931204
    11941205        from config import rho_a, rho_w, eta_w
    1195         from Numeric import array, Float
     1206        from Numeric import Float
     1207        from numpy import array       
    11961208
    11971209        if len(args) == 2:
     
    12241236
    12251237        from math import pi, cos, sin, sqrt
    1226         from Numeric import Float, ones, ArrayType
     1238        from Numeric import Float, ArrayType
     1239        from numpy import ones       
    12271240
    12281241        xmom_update = domain.quantities['xmomentum'].explicit_update
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/B_momentum/util.py

    r7837 r7915  
    44
    55def mean(x):
    6     from Numeric import sum
     6    from numpy import sum
    77    return sum(x)/len(x)
    88
     
    142142
    143143def analytic_cannal(C,t):
    144     from Numeric import zeros, Float,sqrt,sin,cos
     144    from Numeric import Float,sqrt,sin,cos
     145    from numpy import zeros
    145146
    146147   
Note: See TracChangeset for help on using the changeset viewer.