/[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 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #if !defined escript_DataExpanded_20040323_H  #if !defined escript_DataExpanded_20040323_H
16  #define escript_DataExpanded_20040323_H  #define escript_DataExpanded_20040323_H
# Line 19  Line 18 
18    
19  #include "DataAbstract.h"  #include "DataAbstract.h"
20  #include "DataBlocks2D.h"  #include "DataBlocks2D.h"
 #include "DataArrayView.h"  
21    
22  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
23    
# Line 66  class DataExpanded : public DataAbstract Line 64  class DataExpanded : public DataAbstract
64    
65    /**    /**
66       \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  
67       Alternative constructor for DataExpanded that copies a slice from       Alternative constructor for DataExpanded that copies a slice from
68       another DataExpanded.       another DataExpanded.
69    
# Line 92  class DataExpanded : public DataAbstract Line 72  class DataExpanded : public DataAbstract
72    */    */
73    ESCRIPT_DLL_API    ESCRIPT_DLL_API
74    DataExpanded(const DataExpanded& other,    DataExpanded(const DataExpanded& other,
75                 const DataArrayView::RegionType& region);                 const DataTypes::RegionType& region);
76    
77    /**    /**
78       \brief       \brief
# Line 103  class DataExpanded : public DataAbstract Line 83  class DataExpanded : public DataAbstract
83       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.
84       \param shape - Input - the shape of each data-point.       \param shape - Input - the shape of each data-point.
85       \param data - the array of data values for the data-points.       \param data - the array of data values for the data-points.
86    
87    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.
88    */    */
89    ESCRIPT_DLL_API    ESCRIPT_DLL_API
90    DataExpanded(const FunctionSpace& what,    DataExpanded(const FunctionSpace& what,
91                 const DataArrayView::ShapeType &shape,                 const DataTypes::ShapeType &shape,
92                 const DataArrayView::ValueType &data);                 const DataTypes::ValueType &data);
93    
94    /**    /**
95       \brief       \brief
# Line 149  class DataExpanded : public DataAbstract Line 131  class DataExpanded : public DataAbstract
131    virtual    virtual
132    std::string    std::string
133    toString() const;    toString() const;
134    
135      /**
136         \brief Return a deep copy of the current object.
137      */
138      ESCRIPT_DLL_API
139      virtual
140      DataAbstract*
141      deepCopy();
142    
143    
144   /**   /**
145       \brief       \brief
146       dumps the object into a netCDF file       dumps the object into a netCDF file
# Line 178  class DataExpanded : public DataAbstract Line 170  class DataExpanded : public DataAbstract
170    */    */
171    ESCRIPT_DLL_API    ESCRIPT_DLL_API
172    virtual    virtual
173    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
174    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
175                   int dataPointNo) const;                   int dataPointNo) const;
176    
177    /**    /**
178       \brief       \brief
179       Return a view into the data array for the data point specified.       Return a a reference to the underlying DataVector.
180      */
181    
182       NOTE: Construction of the DataArrayView is a relatively expensive    ESCRIPT_DLL_API
183       operation.    DataTypes::ValueType&
184      getVector();
185    
      \param sampleNo - Input - sample number.  
      \param dataPointNo - Input - data point number.  
      \return DataArrayView for the data point.  
   */  
186    ESCRIPT_DLL_API    ESCRIPT_DLL_API
187    DataArrayView    const DataTypes::ValueType&
188    getDataPoint(int sampleNo,    getVector() const;
189                 int dataPointNo);  
190    
191    /**    /**
192       \brief       \brief
# Line 217  class DataExpanded : public DataAbstract Line 207  class DataExpanded : public DataAbstract
207    ESCRIPT_DLL_API    ESCRIPT_DLL_API
208    virtual    virtual
209    DataAbstract*    DataAbstract*
210    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
211    
212    /**    /**
213       \brief       \brief
# Line 230  class DataExpanded : public DataAbstract Line 220  class DataExpanded : public DataAbstract
220    virtual    virtual
221    void    void
222    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
223             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);  
224    
225    /**    /**
226       \brief       \brief
# Line 265  class DataExpanded : public DataAbstract Line 230  class DataExpanded : public DataAbstract
230       uses tag to set a new value       uses tag to set a new value
231    
232       \param tagKey - Input - Integer key.       \param tagKey - Input - Integer key.
233       \param value - Input - Single DataArrayView value to be assigned to the tag.       \param pointshape - Input - The shape of the value parameter
234         \param value - Input - .
235    */    */
236    ESCRIPT_DLL_API    void  
   virtual  
   void  
237    setTaggedValue(int tagKey,    setTaggedValue(int tagKey,
238                   const DataArrayView& value);               const DataTypes::ShapeType& pointshape,
239                     const DataTypes::ValueType& value,
240             int dataOffset=0);
241    
242    
243    
244    /**    /**
245       \brief       \brief
# Line 355  class DataExpanded : public DataAbstract Line 323  class DataExpanded : public DataAbstract
323    virtual void    virtual void
324    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);
325    
326    /**
327     *      \brief
328     *           reorders data sample ordered by reference_ids to the ordering of the functions space
329     *
330     *                \param reference_ids - Input - reference_ids used for current ordering
331     *                  */
332      ESCRIPT_DLL_API
333      virtual void
334      reorderByReferenceIDs(int *reference_ids);
335    
336    
337    
338   protected:   protected:
339    
# Line 371  class DataExpanded : public DataAbstract Line 350  class DataExpanded : public DataAbstract
350       given shape and number of data points, and creates the corresponding       given shape and number of data points, and creates the corresponding
351       DataArrayView of this data.       DataArrayView of this data.
352    
      \param shape - Input - The shape of the point data.  
353       \param noSamples - Input - number of samples.       \param noSamples - Input - number of samples.
354       \param noDataPointsPerSample - Input - number of data points per sample.       \param noDataPointsPerSample - Input - number of data points per sample.
355    */    */
356    void    void
357    initialise(const DataArrayView::ShapeType& shape,    initialise(int noSamples,
              int noSamples,  
358               int noDataPointsPerSample);               int noDataPointsPerSample);
359    
360    /**    /**
# Line 390  class DataExpanded : public DataAbstract Line 367  class DataExpanded : public DataAbstract
367       \param value Input - A single data point value.       \param value Input - A single data point value.
368    */    */
369    void    void
370    copy(const DataArrayView& value);    copy(const DataConstant& value);
371    
372    
373    
374    /**    /**
375       \brief       \brief

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

  ViewVC Help
Powered by ViewVC 1.1.26