Changeset 1748


Ignore:
Timestamp:
Aug 23, 2005, 5:23:25 PM (19 years ago)
Author:
ole
Message:

Work on new set_quantity

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/pyvolution/quantity.py

    r1743 r1748  
    8282
    8383    #New leaner interface to setting values
    84     #def set_quantity(self,
    85     #                 numeric = None,  #List, numeric array or constant
    86     #                 function = None, #Callable object: f(x,y) where x any are arrays
    87     #                 points = None, values = None, alpha = None, #Input for least squares
    88     #                 filename, attribute_name,                   #Input from file
    89     #                 location
     84    def set_quantity(self,
     85                     numeric = None,  #List, numeric array or constant
     86                     quantity = None, #Another quantity
     87                     function = None, #Callable object: f(x,y) 
     88                     points = None, values = None, #Input for least squares
     89                     filename = None, attribute_name = None, #Input from file
     90                     alpha = None,
     91                     location = None,
     92                     verbose = None):
     93       
     94        """Set values for quantity based on different sources.
     95
     96        numeric:
     97       
     98          Compatible list, Numeric array (see below) or constant
     99
     100        quantity:
     101
     102          Another quantity (compatible quantity, e.g. obtained as a
     103          linear combination of quantities)
     104
     105
     106        function:
     107          Any callable object that takes two 1d arrays x and y
     108          each of length N and returns an array also of length N.
     109
     110        points:
     111          Nx2 array of data points for use with least squares fit
     112          If points are present, an N array of attribute
     113          values corresponding to
     114          each data point must be present.
     115
     116        filename:
     117          Name of pts file containing data points and attributes for
     118          use with least squares.
     119          If attribute_name is specified, any array matching that name
     120          will be used. Otherwise the first available one will be used.
     121         
     122        alpha:
     123          Smoothing parameter to be used with least squares fits.
     124          See module least_squares for further details about alpha.
     125               
     126         
     127         
     128        location: Where values are to be stored.
     129                  Permissible options are: vertices, edges, centroids
     130                  Default is "vertices"
     131
     132        In case of location == 'centroids' the dimension values must
     133        be a list of a Numerical array of length N, N being the number
     134        of elements. Otherwise it must be of dimension Nx3
     135
     136        The values will be stored in elements following their
     137        internal ordering.
     138
     139        If values are described a function, it will be evaluated at
     140        specified points
     141
     142        If indexex is not 'unique vertices' Indexes is the set of element ids
     143        that the operation applies to.
     144        If indexex is 'unique vertices' Indexes is the set of vertex ids
     145        that the operation applies to.
     146
     147
     148        If selected location is vertices, values for centroid and edges
     149        will be assigned interpolated values.
     150        In any other case, only values for the specified locations
     151        will be assigned and the others will be left undefined.
     152       
     153        """
     154        pass
     155
     156   
     157   
    90158   
    91159
Note: See TracChangeset for help on using the changeset viewer.