Changeset 7914


Ignore:
Timestamp:
Aug 5, 2010, 5:41:58 PM (9 years ago)
Author:
mungkasi
Message:

Modifying debris avalanche codes using s-h-v reconstruction.

Location:
trunk/anuga_work/development/sudi/sw_1d/avalanche/A_velocity
Files:
7 edited

Legend:

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

    r7837 r7914  
    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, zeros
    77from scipy import linspace
    88from parameters import *
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/A_velocity/domain.py

    r7837 r7914  
    2424        """
    2525
    26         from Numeric import array, zeros, Float, Int
    27 
     26        from Numeric import Float, Int
     27        from numpy import array, zeros
    2828        from config import timestepping_method
    2929        from config import CFL
     
    175175          self.vertexlist is built
    176176        """
    177         from Numeric import array
     177        from numpy import array
    178178
    179179        vertexlist = [None]*len(self.coordinates)
     
    322322            self.element_tag is defined
    323323        """
    324         from Numeric import array, Int
     324        from Numeric import Int
     325        from numpy import array       
    325326
    326327        if tagged_elements is None:
     
    393394
    394395        if obj is True:
    395             from Numeric import concatenate, reshape
     396            from numpy import concatenate, reshape
    396397            V = self.vertices
    397398            N = V.shape[0]
     
    412413        """
    413414
    414         from Numeric import zeros, Float
     415        from Numeric import Float
     416        from numpy import zeros       
    415417        q = zeros( len(self.conserved_quantities), Float)
    416418        for i, name in enumerate(self.conserved_quantities):
     
    436438        """
    437439
    438         from Numeric import zeros, Float
     440        from Numeric import Float
     441        from numpy import zeros       
    439442        q = zeros( len(self.evolved_quantities), Float)
    440443
     
    10791082        """
    10801083        import copy
    1081         from Numeric import zeros,Float
     1084        from Numeric import Float
     1085        from numpy import zeros       
    10821086
    10831087        N = self.number_of_elements
     
    11371141        """
    11381142        import copy
    1139         from Numeric import zeros,Float
     1143        from Numeric import Float
     1144        from numpy import zeros       
    11401145
    11411146        N = self.number_of_elements
     
    13521357        """
    13531358
    1354         from Numeric import ones, sum, equal, Float
     1359        from Numeric import Float
     1360        from numpy import ones, sum, equal       
    13551361
    13561362        N = self.number_of_elements
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/A_velocity/generic_boundary_conditions.py

    r7837 r7914  
    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 array       
    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 array     
    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 array, zeros       
    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/A_velocity/parameters.py

    r7837 r7914  
    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/A_velocity/quantity.py

    r7837 r7914  
    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/A_velocity/shallow_water_domain_avalanche.py

    r7837 r7914  
    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
    586591
     
    662667
    663668    import sys
    664     from Numeric import zeros, Float
     669    from Numeric import Float
     670    from numpy import zeros
    665671    from config import epsilon, h0
    666672
     
    766772    """
    767773
    768     from Numeric import zeros, Float
     774    from Numeric import Float
     775    from numpy import zeros   
    769776
    770777    N = domain.number_of_elements
     
    933940
    934941    from util import gradient
    935     from Numeric import zeros, Float, array, sum
     942    from Numeric import Float
     943    from numpy import zeros, array, sum
    936944
    937945    xmom = domain.quantities['xmomentum'].explicit_update
     
    967975
    968976    from util import gradient
    969     from Numeric import zeros, Float, array, sum
     977    from Numeric import Float
     978    from numpy import zeros, array, sum   
    970979    from parameters import F1#This is an additional friction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    971980
     
    10031012
    10041013    from util import gradient
    1005     from Numeric import zeros, Float, array, sum
     1014    from Numeric import Float
     1015    from numpy import zeros, array, sum   
    10061016    from parameters import F2#This is an additional friction!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    10071017
     
    11031113    """
    11041114
    1105     from Numeric import ones, Float, array
     1115    from Numeric import Float
     1116    from numpy import ones, array   
    11061117
    11071118
     
    11851196
    11861197        from config import rho_a, rho_w, eta_w
    1187         from Numeric import array, Float
     1198        from Numeric import Float
     1199        from numpy import array       
    11881200
    11891201        if len(args) == 2:
     
    12161228
    12171229        from math import pi, cos, sin, sqrt
    1218         from Numeric import Float, ones, ArrayType
     1230        from Numeric import Float, ArrayType
     1231        from numpy import ones
    12191232
    12201233        xmom_update = domain.quantities['xmomentum'].explicit_update
  • trunk/anuga_work/development/sudi/sw_1d/avalanche/A_velocity/util.py

    r7837 r7914  
    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.