/[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

revision 1358 by gross, Wed Dec 5 03:41:06 2007 UTC revision 1796 by jfenwick, Wed Sep 17 01:45:46 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 64  class DataExpanded : public DataAbstract Line 63  class DataExpanded : public DataAbstract
63    DataExpanded(const boost::python::numeric::array& value,    DataExpanded(const boost::python::numeric::array& value,
64                 const FunctionSpace& what);                 const FunctionSpace& what);
65    
66    /**  //  /**
67       \brief  //      \brief
68       Alternative constructor for DataExpanded.  //      Alternative constructor for DataExpanded.
69    //
70       Description:  //      Description:
71       Alternative Constructor for DataExpanded.  //      Alternative Constructor for DataExpanded.
72    //
73       The given single data value is copied to all the data points in  //      The given single data value is copied to all the data points in
74       this data object, where the number of data points is defined by  //      this data object, where the number of data points is defined by
75       the given function space.  //      the given function space.
76    //
77       \param value - Input - A single data value.  //      \param value - Input - A single data value.
78       \param what - Input - A description of what this data represents.  //      \param what - Input - A description of what this data represents.
79    */  //  */
80    ESCRIPT_DLL_API  //   ESCRIPT_DLL_API
81    DataExpanded(const DataArrayView& value,  //   DataExpanded(const DataArrayView& value,
82                 const FunctionSpace& what);  //                const FunctionSpace& what);
83    
84    /**    /**
85       \brief       \brief
# Line 92  class DataExpanded : public DataAbstract Line 91  class DataExpanded : public DataAbstract
91    */    */
92    ESCRIPT_DLL_API    ESCRIPT_DLL_API
93    DataExpanded(const DataExpanded& other,    DataExpanded(const DataExpanded& other,
94                 const DataArrayView::RegionType& region);                 const DataTypes::RegionType& region);
95    
96    /**    /**
97       \brief       \brief
# Line 103  class DataExpanded : public DataAbstract Line 102  class DataExpanded : public DataAbstract
102       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
103       \param shape - Input - the shape of each data-point.       \param shape - Input - the shape of each data-point.
104       \param data - the array of data values for the data-points.       \param data - the array of data values for the data-points.
105    
106    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.
107    */    */
108    ESCRIPT_DLL_API    ESCRIPT_DLL_API
109    DataExpanded(const FunctionSpace& what,    DataExpanded(const FunctionSpace& what,
110                 const DataArrayView::ShapeType &shape,                 const DataTypes::ShapeType &shape,
111                 const DataArrayView::ValueType &data);                 const DataTypes::ValueType &data);
112    
113    /**    /**
114       \brief       \brief
# Line 178  class DataExpanded : public DataAbstract Line 179  class DataExpanded : public DataAbstract
179    */    */
180    ESCRIPT_DLL_API    ESCRIPT_DLL_API
181    virtual    virtual
182    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
183    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
184                   int dataPointNo) const;                   int dataPointNo) const;
185    
186    /**  //  /**
187       \brief  /*     \brief
188       Return a view into the data array for the data point specified.       Return a view into the data array for the data point specified.
189    
190       NOTE: Construction of the DataArrayView is a relatively expensive       NOTE: Construction of the DataArrayView is a relatively expensive
# Line 191  class DataExpanded : public DataAbstract Line 192  class DataExpanded : public DataAbstract
192    
193       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
194       \param dataPointNo - Input - data point number.       \param dataPointNo - Input - data point number.
195       \return DataArrayView for the data point.       \return DataArrayView for the data point.*/
196    //  */
197    //   ESCRIPT_DLL_API
198    //   DataArrayView
199    //   getDataPoint(int sampleNo,
200    //                int dataPointNo);
201    
202    
203      /**
204         \brief
205         Return a a reference to the underlying DataVector.
206    */    */
207    
208    ESCRIPT_DLL_API    ESCRIPT_DLL_API
209    DataArrayView    DataTypes::ValueType&
210    getDataPoint(int sampleNo,    getVector();
211                 int dataPointNo);  
212      ESCRIPT_DLL_API
213      const DataTypes::ValueType&
214      getVector() const;
215    
216    
217    /**    /**
218       \brief       \brief
# Line 217  class DataExpanded : public DataAbstract Line 233  class DataExpanded : public DataAbstract
233    ESCRIPT_DLL_API    ESCRIPT_DLL_API
234    virtual    virtual
235    DataAbstract*    DataAbstract*
236    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
237    
238    /**    /**
239       \brief       \brief
# Line 230  class DataExpanded : public DataAbstract Line 246  class DataExpanded : public DataAbstract
246    virtual    virtual
247    void    void
248    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
249             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
250    
   /**  
     \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.  
251    
252      The return value indicates success (0) or otherwise (1).  //  /**
253    */  /*     \brief
254    ESCRIPT_DLL_API       setTaggedValue
255    int  
256    archiveData(std::ofstream& archiveFile,       Description:
257                const DataArrayView::ValueType::size_type noValues) const;       uses tag to set a new value
258    
259         \param tagKey - Input - Integer key.
260         \param value - Input - Single DataArrayView value to be assigned to the tag.*/
261    //  */
262    //   ESCRIPT_DLL_API
263    //   virtual
264    //   void
265    //   setTaggedValue(int tagKey,
266    //                  const DataArrayView& value);
267    
   /**  
     \brief  
     Extract the number of values specified by noValues from the file  
     referenced by ifstream to the underlying data structure.  
268    
     The return value indicates success (0) or otherwise (1).  
   */  
   ESCRIPT_DLL_API  
   int  
   extractData(std::ifstream& archiveFile,  
               const DataArrayView::ValueType::size_type noValues);  
269    
270    /**    /**
271       \brief       \brief
# Line 265  class DataExpanded : public DataAbstract Line 275  class DataExpanded : public DataAbstract
275       uses tag to set a new value       uses tag to set a new value
276    
277       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
278       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param pointshape - Input - The shape of the value parameter
279         \param value - Input - .
280    */    */
281    ESCRIPT_DLL_API    void  
   virtual  
   void  
282    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
283                   const DataArrayView& value);               const DataTypes::ShapeType& pointshape,
284                     const DataTypes::ValueType& value,
285             int dataOffset=0);
286    
287    
288    
289    /**    /**
290       \brief       \brief
# Line 355  class DataExpanded : public DataAbstract Line 368  class DataExpanded : public DataAbstract
368    virtual void    virtual void
369    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);
370    
371    /**
372     *      \brief
373     *           reorders data sample ordered by reference_ids to the ordering of the functions space
374     *
375     *                \param reference_ids - Input - reference_ids used for current ordering
376     *                  */
377      ESCRIPT_DLL_API
378      virtual void
379      reorderByReferenceIDs(int *reference_ids);
380    
381    
382    
383   protected:   protected:
384    
# Line 371  class DataExpanded : public DataAbstract Line 395  class DataExpanded : public DataAbstract
395       given shape and number of data points, and creates the corresponding       given shape and number of data points, and creates the corresponding
396       DataArrayView of this data.       DataArrayView of this data.
397    
      \param shape - Input - The shape of the point data.  
398       \param noSamples - Input - number of samples.       \param noSamples - Input - number of samples.
399       \param noDataPointsPerSample - Input - number of data points per sample.       \param noDataPointsPerSample - Input - number of data points per sample.
400    */    */
401    void    void
402    initialise(const DataArrayView::ShapeType& shape,    initialise(int noSamples,
              int noSamples,  
403               int noDataPointsPerSample);               int noDataPointsPerSample);
404    
405    /**    /**
# Line 390  class DataExpanded : public DataAbstract Line 412  class DataExpanded : public DataAbstract
412       \param value Input - A single data point value.       \param value Input - A single data point value.
413    */    */
414    void    void
415    copy(const DataArrayView& value);    copy(const DataConstant& value);
416    
417    
418    
419    /**    /**
420       \brief       \brief

Legend:
Removed from v.1358  
changed lines
  Added in v.1796

  ViewVC Help
Powered by ViewVC 1.1.26