Ignore:
Timestamp:
Jun 30, 2009, 2:07:41 PM (15 years ago)
Author:
ole
Message:

Merged numpy branch back into the trunk.

In ~/sandpit/anuga/anuga_core/source
svn merge -r 6246:HEAD ../../branches/numpy .

In ~/sandpit/anuga/anuga_validation
svn merge -r 6417:HEAD ../branches/numpy_anuga_validation .

In ~/sandpit/anuga/misc
svn merge -r 6809:HEAD ../branches/numpy_misc .

For all merges, I used numpy version where conflicts existed

The suites test_all.py (in source/anuga) and validate_all.py passed using Python2.5 with numpy on my Ubuntu Linux box.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py

    r7053 r7276  
    2626from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\
    2727     import Transmissive_boundary
    28 
    2928from anuga.abstract_2d_finite_volumes.pmesh2domain import pmesh_to_domain
    3029from anuga.abstract_2d_finite_volumes.region\
     
    3433from quantity import Quantity
    3534
    36 import Numeric as num
     35import numpy as num
    3736
    3837
     
    9594        """
    9695
    97 
    9896        number_of_full_nodes=None
    9997        number_of_full_triangles=None
     
    193191            buffer_shape = self.full_send_dict[key][0].shape[0]
    194192            self.full_send_dict[key].append(num.zeros((buffer_shape, self.nsys),
    195                                                       num.Float))
     193                                                      num.float))
    196194
    197195        for key in self.ghost_recv_dict:
    198196            buffer_shape = self.ghost_recv_dict[key][0].shape[0]
    199197            self.ghost_recv_dict[key].append(num.zeros((buffer_shape, self.nsys),
    200                                              num.Float))
     198                                             num.float))
    201199
    202200        # Setup cell full flag
     
    205203        N = len(self) #number_of_elements
    206204        self.number_of_elements = N
    207         self.tri_full_flag = num.ones(N, num.Int)
     205        self.tri_full_flag = num.ones(N, num.int)
    208206        for i in self.ghost_recv_dict.keys():
    209207            for id in self.ghost_recv_dict[i][0]:
     
    267265        # (boolean) array, to be used during the flux calculation.
    268266        N = len(self) # Number_of_triangles
    269         self.already_computed_flux = num.zeros((N, 3), num.Int)
     267        self.already_computed_flux = num.zeros((N, 3), num.int)
    270268
    271269        # Storage for maximal speeds computed for each triangle by
    272270        # compute_fluxes.
    273271        # This is used for diagnostics only (reset at every yieldstep)
    274         self.max_speed = num.zeros(N, num.Float)
     272        self.max_speed = num.zeros(N, num.float)
    275273
    276274        if mesh_filename is not None:
     
    391389            raise Exception, msg
    392390
    393         q = num.zeros(len(self.conserved_quantities), num.Float)
     391        q = num.zeros(len(self.conserved_quantities), num.float)
    394392
    395393        for i, name in enumerate(self.conserved_quantities):
     
    463461
    464462        name:  Name of quantity
    465         value: Compatible list, Numeric array, const or function (see below)
     463        value: Compatible list, numeric array, const or function (see below)
    466464
    467465        The values will be stored in elements following their internal ordering.
     
    895893
    896894            msg += '------------------------------------------------\n'
    897             msg += '  Speeds in [%f, %f]\n' % (min(self.max_speed),
    898                                                max(self.max_speed))
     895            msg += '  Speeds in [%f, %f]\n' % (num.min(self.max_speed),
     896                                               num.max(self.max_speed))
    899897            msg += '  Histogram:\n'
    900898
     
    908906                else:
    909907                    # Closed upper interval
    910                     hi = max(self.max_speed)
     908                    hi = num.max(self.max_speed)
    911909                    msg += '    [%f, %f]: %d\n' % (lo, hi, count)
    912910
    913             N = len(self.max_speed)
     911            N = len(self.max_speed.flat)
    914912            if N > 10:
    915913                msg += '  Percentiles (10%):\n'
     
    13731371                self.number_of_steps = 0
    13741372                self.number_of_first_order_steps = 0
    1375                 self.max_speed = num.zeros(N, num.Float)
     1373                self.max_speed = num.zeros(N, num.float)
    13761374
    13771375    ##
     
    16421640        # momentum
    16431641        if self.protect_against_isolated_degenerate_timesteps is True and \
    1644                self.max_speed > 10.0: # FIXME (Ole): Make this configurable
     1642               num.max(self.max_speed) > 10.0: # FIXME (Ole): Make this configurable
    16451643
    16461644            # Setup 10 bins for speed histogram
     
    16571655
    16581656                    # Find triangles in last bin
    1659                     # FIXME - speed up using Numeric
     1657                    # FIXME - speed up using numeric package
    16601658                    d = 0
    16611659                    for i in range(self.number_of_full_triangles):
     
    17631761        # We have a list with ghosts expecting updates
    17641762
    1765 
    1766         from Numeric import take,put
    1767 
    1768 
    17691763        #Update of ghost cells
    17701764        iproc = self.processor
     
    17791773            for i, q in enumerate(self.conserved_quantities):
    17801774                Q_cv =  self.quantities[q].centroid_values
    1781                 put(Q_cv,     Idg, take(Q_cv,     Idf))
     1775                num.put(Q_cv, Idg, num.take(Q_cv, Idf, axis=0))
    17821776
    17831777 
Note: See TracChangeset for help on using the changeset viewer.