/[escript]/trunk/escript/src/DataExpanded.h
ViewVC logotype

Diff of /trunk/escript/src/DataExpanded.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

temp/escript/src/DataExpanded.h revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC trunk/escript/src/DataExpanded.h revision 1808 by jfenwick, Thu Sep 25 03:14:56 2008 UTC
# Line 19  Line 19 
19    
20  #include "DataAbstract.h"  #include "DataAbstract.h"
21  #include "DataBlocks2D.h"  #include "DataBlocks2D.h"
 #include "DataArrayView.h"  
22    
23  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
24    
# Line 66  class DataExpanded : public DataAbstract Line 65  class DataExpanded : public DataAbstract
65    
66    /**    /**
67       \brief       \brief
      Alternative constructor for DataExpanded.  
   
      Description:  
      Alternative Constructor for DataExpanded.  
   
      The given single data value is copied to all the data points in  
      this data object, where the number of data points is defined by  
      the given function space.  
   
      \param value - Input - A single data value.  
      \param what - Input - A description of what this data represents.  
   */  
   ESCRIPT_DLL_API  
   DataExpanded(const DataArrayView& value,  
                const FunctionSpace& what);  
   
   /**  
      \brief  
68       Alternative constructor for DataExpanded that copies a slice from       Alternative constructor for DataExpanded that copies a slice from
69       another DataExpanded.       another DataExpanded.
70    
# Line 92  class DataExpanded : public DataAbstract Line 73  class DataExpanded : public DataAbstract
73    */    */
74    ESCRIPT_DLL_API    ESCRIPT_DLL_API
75    DataExpanded(const DataExpanded& other,    DataExpanded(const DataExpanded& other,
76                 const DataArrayView::RegionType& region);                 const DataTypes::RegionType& region);
77    
78    /**    /**
79       \brief       \brief
# Line 103  class DataExpanded : public DataAbstract Line 84  class DataExpanded : public DataAbstract
84       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
85       \param shape - Input - the shape of each data-point.       \param shape - Input - the shape of each data-point.
86       \param data - the array of data values for the data-points.       \param data - the array of data values for the data-points.
87    
88    TODO Note that this constructor will also copy data to all points if it only contains enough elements to hold a single point.  ie this is the merge of two separate constructors.
89    */    */
90    ESCRIPT_DLL_API    ESCRIPT_DLL_API
91    DataExpanded(const FunctionSpace& what,    DataExpanded(const FunctionSpace& what,
92                 const DataArrayView::ShapeType &shape,                 const DataTypes::ShapeType &shape,
93                 const DataArrayView::ValueType &data);                 const DataTypes::ValueType &data);
94    
95    /**    /**
96       \brief       \brief
# Line 149  class DataExpanded : public DataAbstract Line 132  class DataExpanded : public DataAbstract
132    virtual    virtual
133    std::string    std::string
134    toString() const;    toString() const;
135    
136      /**
137         \brief Return a deep copy of the current object.
138      */
139      ESCRIPT_DLL_API
140      virtual
141      DataAbstract*
142      deepCopy();
143    
144    
145   /**   /**
146       \brief       \brief
147       dumps the object into a netCDF file       dumps the object into a netCDF file
# Line 178  class DataExpanded : public DataAbstract Line 171  class DataExpanded : public DataAbstract
171    */    */
172    ESCRIPT_DLL_API    ESCRIPT_DLL_API
173    virtual    virtual
174    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
175    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
176                   int dataPointNo) const;                   int dataPointNo) const;
177    
178    /**    /**
179       \brief       \brief
180       Return a view into the data array for the data point specified.       Return a a reference to the underlying DataVector.
181      */
182    
183       NOTE: Construction of the DataArrayView is a relatively expensive    ESCRIPT_DLL_API
184       operation.    DataTypes::ValueType&
185      getVector();
186    
      \param sampleNo - Input - sample number.  
      \param dataPointNo - Input - data point number.  
      \return DataArrayView for the data point.  
   */  
187    ESCRIPT_DLL_API    ESCRIPT_DLL_API
188    DataArrayView    const DataTypes::ValueType&
189    getDataPoint(int sampleNo,    getVector() const;
190                 int dataPointNo);  
191    
192    /**    /**
193       \brief       \brief
# Line 217  class DataExpanded : public DataAbstract Line 208  class DataExpanded : public DataAbstract
208    ESCRIPT_DLL_API    ESCRIPT_DLL_API
209    virtual    virtual
210    DataAbstract*    DataAbstract*
211    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
212    
213    /**    /**
214       \brief       \brief
# Line 230  class DataExpanded : public DataAbstract Line 221  class DataExpanded : public DataAbstract
221    virtual    virtual
222    void    void
223    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
224             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
   
   /**  
     \brief  
     Archive the underlying data values to the file referenced  
     by ofstream. A count of the number of values expected to be written  
     is provided as a cross-check.  
   
     The return value indicates success (0) or otherwise (1).  
   */  
   ESCRIPT_DLL_API  
   int  
   archiveData(std::ofstream& archiveFile,  
               const DataArrayView::ValueType::size_type noValues) const;  
   
   /**  
     \brief  
     Extract the number of values specified by noValues from the file  
     referenced by ifstream to the underlying data structure.  
   
     The return value indicates success (0) or otherwise (1).  
   */  
   ESCRIPT_DLL_API  
   int  
   extractData(std::ifstream& archiveFile,  
               const DataArrayView::ValueType::size_type noValues);  
225    
226    /**    /**
227       \brief       \brief
# Line 265  class DataExpanded : public DataAbstract Line 231  class DataExpanded : public DataAbstract
231       uses tag to set a new value       uses tag to set a new value
232    
233       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
234       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param pointshape - Input - The shape of the value parameter
235         \param value - Input - .
236    */    */
237    ESCRIPT_DLL_API    void  
   virtual  
   void  
238    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
239                   const DataArrayView& value);               const DataTypes::ShapeType& pointshape,
240                     const DataTypes::ValueType& value,
241             int dataOffset=0);
242    
243    
244    
245    /**    /**
246       \brief       \brief
# Line 355  class DataExpanded : public DataAbstract Line 324  class DataExpanded : public DataAbstract
324    virtual void    virtual void
325    eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);    eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol=1.e-13);
326    
327    /**
328     *      \brief
329     *           reorders data sample ordered by reference_ids to the ordering of the functions space
330     *
331     *                \param reference_ids - Input - reference_ids used for current ordering
332     *                  */
333      ESCRIPT_DLL_API
334      virtual void
335      reorderByReferenceIDs(int *reference_ids);
336    
337    
338    
339   protected:   protected:
340    
# Line 371  class DataExpanded : public DataAbstract Line 351  class DataExpanded : public DataAbstract
351       given shape and number of data points, and creates the corresponding       given shape and number of data points, and creates the corresponding
352       DataArrayView of this data.       DataArrayView of this data.
353    
      \param shape - Input - The shape of the point data.  
354       \param noSamples - Input - number of samples.       \param noSamples - Input - number of samples.
355       \param noDataPointsPerSample - Input - number of data points per sample.       \param noDataPointsPerSample - Input - number of data points per sample.
356    */    */
357    void    void
358    initialise(const DataArrayView::ShapeType& shape,    initialise(int noSamples,
              int noSamples,  
359               int noDataPointsPerSample);               int noDataPointsPerSample);
360    
361    /**    /**
# Line 390  class DataExpanded : public DataAbstract Line 368  class DataExpanded : public DataAbstract
368       \param value Input - A single data point value.       \param value Input - A single data point value.
369    */    */
370    void    void
371    copy(const DataArrayView& value);    copy(const DataConstant& value);
372    
373    
374    
375    /**    /**
376       \brief       \brief

Legend:
Removed from v.1387  
changed lines
  Added in v.1808

  ViewVC Help
Powered by ViewVC 1.1.26