Changeset 7825


Ignore:
Timestamp:
Jun 11, 2010, 7:46:04 PM (14 years ago)
Author:
steve
Message:

anuga_1d works with numeric on 64bit machine

Location:
anuga_work/development/anuga_1d
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/anuga_1d/domain.py

    r7793 r7825  
    661661
    662662
    663         #Do the expression stuff
    664         if kwargs.has_key('expression'):
    665             expression = kwargs['expression']
    666             del kwargs['expression']
    667 
    668             Q = self.create_quantity_from_expression(expression)
    669             kwargs['quantity'] = Q
     663#        #Do the expression stuff
     664#        if kwargs.has_key('expression'):
     665#            expression = kwargs['expression']
     666#            del kwargs['expression']
     667#
     668#            Q = self.create_quantity_from_expression(expression)
     669#            kwargs['quantity'] = Q
    670670       
    671671        #Assign values
     
    15701570            for name in self.conserved_quantities:
    15711571                Q = self.quantities[name]
    1572                 Q.explicit_update[:] = 0.0
     1572                Q.explicit_update[:,] = 0.0
    15731573
    15741574        for f in self.forcing_terms:
  • anuga_work/development/anuga_1d/quantity.py

    r7818 r7825  
    237237    def set_values_from_constant(self,numeric):
    238238
    239         self.vertex_values[:]   = numeric
    240         self.centroid_values[:] = numeric
     239        self.vertex_values[:,:]   = numeric
     240        self.centroid_values[:,] = numeric
    241241
    242242
    243243    def set_values_from_array(self,numeric):
    244244
    245         self.vertex_values[:]   = numeric
     245        self.vertex_values[:,:]   = numeric
    246246        self.interpolate()
    247247
     
    249249    def set_values_from_quantity(self,quantity):
    250250
    251         self.vertex_values[:]   = quantity.vertex_values
    252         self.centroid_values[:] = quantity.centroid_values
     251        self.vertex_values[:,:]   = quantity.vertex_values
     252        self.centroid_values[:,] = quantity.centroid_values
    253253
    254254    def set_values_from_function(self,function):
    255255
    256         self.vertex_values[:]   = map(function, self.domain.vertices)
    257         self.centroid_values[:] = map(function, self.domain.centroids)
     256        self.vertex_values[:,:]   = map(function, self.domain.vertices)
     257        self.centroid_values[:,] = map(function, self.domain.centroids)
    258258
    259259
     
    10971097        #backup_centroid_values(self)
    10981098
    1099         self.centroid_backup_values[:] = (self.centroid_values).astype('f')
     1099        self.centroid_backup_values[:,] = (self.centroid_values).astype('f')
    11001100
    11011101    def saxpy_centroid_values(self,a,b):
    11021102        # Call correct module function
    11031103        # (either from this module or C-extension)
    1104         self.centroid_values[:] = (a*self.centroid_values + b*self.centroid_backup_values).astype('f')
     1104        self.centroid_values[:,] = (a*self.centroid_values + b*self.centroid_backup_values).astype('f')
    11051105       
    11061106
  • anuga_work/development/anuga_1d/shallow_water_domain.py

    r5832 r7825  
    412412    for k in range(N):
    413413
    414         flux[:] = 0.  #Reset work array
     414        flux[:,] = 0.  #Reset work array
    415415        for i in range(2):
    416416            #Quantities inside volume facing neighbour i
     
    507507    for k in range(N):
    508508
    509         flux[:] = 0.  #Reset work array
     509        flux[:,] = 0.  #Reset work array
    510510        #for i in range(3):
    511511        for i in range(2):
  • anuga_work/development/anuga_1d/shallow_water_vel_domain.py

    r6042 r7825  
    264264    uh_V = domain.quantities['xmomentum'].vertex_values
    265265
    266     h_V[:]    = w_V - z_V
     266    #print w_V
     267    #print z_V
     268   
     269    h_V[:,:]    = w_V - z_V
    267270    for i in range(len(h_C)):
    268271        for j in range(2):
     
    275278                w_V[i,(j+1)%2] = w_V[i,(j+1)%2] + dh
    276279               
    277     uh_V[:] = u_V * h_V
     280    uh_V[:,:] = u_V * h_V
    278281
    279282   
     
    341344    uh_V = domain.quantities['xmomentum'].vertex_values
    342345
    343     h_V[:]    = w_V - z_V
     346    h_V[:,:]    = w_V - z_V
    344347
    345348    for i in range(len(h_C)):
  • anuga_work/development/anuga_1d/test_quantity.py

    r7818 r7825  
    578578        #Set explicit_update
    579579        explicit_update = array( [4.,3.,2.,1.] )
    580         quantity.explicit_update[:] = explicit_update
     580        quantity.explicit_update[:,] = explicit_update
    581581
    582582        #Set semi implicit update
    583583        semi_implicit_update = array( [1.,1.,1.,1.] )
    584         quantity.semi_implicit_update[:] = semi_implicit_update
     584        quantity.semi_implicit_update[:,] = semi_implicit_update
    585585
    586586        #Update with given timestep
  • anuga_work/development/anuga_1d/test_shallow_water_domain.py

    r5844 r7825  
    275275    for k in range(N):
    276276
    277         flux[:] = 0.  #Reset work array
     277        flux[:,] = 0.  #Reset work array
    278278        #for i in range(3):
    279279        for i in range(2):
  • anuga_work/development/anuga_1d/test_shallow_water_vel_domain.py

    r6042 r7825  
    114114        domain.compute_fluxes()
    115115       
    116         print domain.quantities['stage'].vertex_values
    117         print domain.quantities['xmomentum'].vertex_values
    118         print domain.quantities['elevation'].vertex_values
    119         print domain.quantities['height'].vertex_values
    120         print domain.quantities['velocity'].vertex_values
    121 
    122         print domain.quantities['stage'].boundary_values
    123         print domain.quantities['xmomentum'].boundary_values
    124         print domain.quantities['elevation'].boundary_values
    125         print domain.quantities['height'].boundary_values
    126         print domain.quantities['velocity'].boundary_values
     116#        print domain.quantities['stage'].vertex_values
     117#        print domain.quantities['xmomentum'].vertex_values
     118#        print domain.quantities['elevation'].vertex_values
     119#        print domain.quantities['height'].vertex_values
     120#        print domain.quantities['velocity'].vertex_values
     121#
     122#        print domain.quantities['stage'].boundary_values
     123#        print domain.quantities['xmomentum'].boundary_values
     124#        print domain.quantities['elevation'].boundary_values
     125#        print domain.quantities['height'].boundary_values
     126#        print domain.quantities['velocity'].boundary_values
    127127       
    128128        print domain.quantities['stage'].explicit_update
    129129        print domain.quantities['xmomentum'].explicit_update
     130
    130131        print stage_ud
    131132        print xmom_ud
     
    343344    for k in range(N):
    344345
    345         flux[:] = 0.  #Reset work array
     346        flux[:,] = 0.  #Reset work array
    346347        #for i in range(3):
    347348        for i in range(2):
Note: See TracChangeset for help on using the changeset viewer.