Ignore:
Timestamp:
Apr 24, 2009, 5:22:14 PM (16 years ago)
Author:
rwilson
Message:

Back-merge from Numeric trunk to numpy branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/abstract_2d_finite_volumes/domain.py

    r6553 r6902  
    9292        """
    9393
     94        number_of_full_nodes=None
     95        number_of_full_triangles=None
     96       
    9497        # Determine whether source is a mesh filename or coordinates
    9598        if type(source) == types.StringType:
     
    117120
    118121        # Expose Mesh attributes (FIXME: Maybe turn into methods)
     122        self.triangles = self.mesh.triangles       
    119123        self.centroid_coordinates = self.mesh.centroid_coordinates
    120124        self.vertex_coordinates = self.mesh.vertex_coordinates
     
    205209        # the ghost triangles.
    206210        if not num.allclose(self.tri_full_flag[:self.number_of_full_nodes], 1):
    207             print ('WARNING:  '
    208                    'Not all full triangles are store before ghost triangles')
     211            if self.numproc>1:
     212                print ('WARNING:  '
     213                       'Not all full triangles are store before ghost triangles')
    209214
    210215        # Defaults
     
    306311    def get_normal(self, *args, **kwargs):
    307312        return self.mesh.get_normal(*args, **kwargs)
     313    def get_triangle_containing_point(self, *args, **kwargs):
     314        return self.mesh.get_triangle_containing_point(*args, **kwargs)
    308315
    309316    def get_intersecting_segments(self, *args, **kwargs):
     
    17451752
    17461753    ##
    1747     # @brief ??
     1754    # @brief Sequential update of ghost cells
    17481755    def update_ghosts(self):
    1749         pass
    1750 
     1756        # We must send the information from the full cells and
     1757        # receive the information for the ghost cells
     1758        # We have a list with ghosts expecting updates
     1759
     1760        from Numeric import take,put
     1761
     1762
     1763        #Update of ghost cells
     1764        iproc = self.processor
     1765        if self.full_send_dict.has_key(iproc):
     1766
     1767            # now store full as local id, global id, value
     1768            Idf  = self.full_send_dict[iproc][0]
     1769
     1770            # now store ghost as local id, global id, value
     1771            Idg = self.ghost_recv_dict[iproc][0]
     1772
     1773            for i, q in enumerate(self.conserved_quantities):
     1774                Q_cv =  self.quantities[q].centroid_values
     1775                put(Q_cv,     Idg, take(Q_cv,     Idf))
     1776
     1777 
    17511778    ##
    17521779    # @brief Extrapolate conserved quantities from centroid to vertices
Note: See TracChangeset for help on using the changeset viewer.