Ignore:
Timestamp:
Mar 5, 2009, 10:57:08 AM (15 years ago)
Author:
rwilson
Message:

Modified General_mesh.get_node(absolute=True) to return a copy if modifying the object node data.

File:
1 edited

Legend:

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

    r6428 r6463  
     1import copy
    12import numpy as num
    23
     
    252253        Default is False as many parts of ANUGA expects relative coordinates.
    253254        (To see which, switch to default absolute=True and run tests).
     255
     256        Note: This method returns a modified _copy_ of the nodes slice if
     257              absolute is True.  If absolute is False, just return the slice.
     258              This is related to the ensure_numeric() returning a copy problem.
    254259        """
    255260
     
    257262        if absolute is True:
    258263            if not self.geo_reference.is_absolute():
     264                # get a copy so as not to modify the internal self.nodes array
     265                V = copy.copy(V)
    259266                V += num.array([self.geo_reference.get_xllcorner(),
    260267                                self.geo_reference.get_yllcorner()], num.float)
Note: See TracChangeset for help on using the changeset viewer.