/[escript]/branches/trilinos_from_5897/escriptcore/src/DataConstant.h
ViewVC logotype

Diff of /branches/trilinos_from_5897/escriptcore/src/DataConstant.h

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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1799 by jfenwick, Wed Sep 17 06:33:18 2008 UTC
# Line 18  Line 18 
18  #include "system_dep.h"  #include "system_dep.h"
19    
20  #include "DataAbstract.h"  #include "DataAbstract.h"
 #include "DataArrayView.h"  
21    
22  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
23    
# Line 58  class DataConstant : public DataAbstract Line 57  class DataConstant : public DataAbstract
57    ESCRIPT_DLL_API    ESCRIPT_DLL_API
58    DataConstant(const DataConstant& other);    DataConstant(const DataConstant& other);
59    
60    /**  //  /**
61       \brief  /*     \brief
62       Alternative constructor for DataConstant objects.       Alternative constructor for DataConstant objects.
63    
64       Description:       Description:
65       Alternative Constructor for DataConstant objects.       Alternative Constructor for DataConstant objects.
66       \param value - Input - Data value for a single point.       \param value - Input - Data value for a single point.
67       \param what - Input - A description of what this data object represents.       \param what - Input - A description of what this data object represents.*/
68    */  //  */
69    ESCRIPT_DLL_API  //   ESCRIPT_DLL_API
70    DataConstant(const DataArrayView& value,  //   DataConstant(const DataArrayView& value,
71                 const FunctionSpace& what);  //                const FunctionSpace& what);
72    
73    /**    /**
74       \brief       \brief
# Line 82  class DataConstant : public DataAbstract Line 81  class DataConstant : public DataAbstract
81    */    */
82    ESCRIPT_DLL_API    ESCRIPT_DLL_API
83    DataConstant(const DataConstant& other,    DataConstant(const DataConstant& other,
84                 const DataArrayView::RegionType& region);                 const DataTypes::RegionType& region);
85    
86    /**    /**
87       \brief       \brief
# Line 96  class DataConstant : public DataAbstract Line 95  class DataConstant : public DataAbstract
95    */    */
96    ESCRIPT_DLL_API    ESCRIPT_DLL_API
97    DataConstant(const FunctionSpace& what,    DataConstant(const FunctionSpace& what,
98                 const DataArrayView::ShapeType &shape,                 const DataTypes::ShapeType &shape,
99                 const DataArrayView::ValueType &data);                 const DataTypes::ValueType &data);
100    
101    /**    /**
102       \brief       \brief
# Line 106  class DataConstant : public DataAbstract Line 105  class DataConstant : public DataAbstract
105    ESCRIPT_DLL_API    ESCRIPT_DLL_API
106    std::string    std::string
107    toString() const;    toString() const;
108    
109      /**
110         \brief Return a deep copy of the current object.
111      */
112      ESCRIPT_DLL_API
113      virtual
114      DataAbstract*
115      deepCopy();
116    
117    
118   /**   /**
119       \brief       \brief
120       dumps the object into a netCDF file       dumps the object into a netCDF file
# Line 135  class DataConstant : public DataAbstract Line 144  class DataConstant : public DataAbstract
144     */     */
145    ESCRIPT_DLL_API    ESCRIPT_DLL_API
146    virtual    virtual
147    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
148    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
149                   int dataPointNo) const;                   int dataPointNo) const;
150    
151    /**  //  /**
152       \brief  /*     \brief
153       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
154       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
155       \param dataPointNo - Input - data point number for the sample.       \param dataPointNo - Input - data point number for the sample.*/
156    */  //  */
157    ESCRIPT_DLL_API  //   ESCRIPT_DLL_API
158    virtual  //   virtual
159    DataArrayView  //   DataArrayView
160    getDataPoint(int sampleNo,  //   getDataPoint(int sampleNo,
161                 int dataPointNo);  //                int dataPointNo);
162    
163    /**    /**
164       \brief       \brief
# Line 157  class DataConstant : public DataAbstract Line 166  class DataConstant : public DataAbstract
166    */    */
167    ESCRIPT_DLL_API    ESCRIPT_DLL_API
168    virtual    virtual
169    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
170    getLength() const;    getLength() const;
171    
172    /**    /**
# Line 170  class DataConstant : public DataAbstract Line 179  class DataConstant : public DataAbstract
179    ESCRIPT_DLL_API    ESCRIPT_DLL_API
180    virtual    virtual
181    DataAbstract*    DataAbstract*
182    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
183    
184    /**    /**
185       \brief       \brief
# Line 182  class DataConstant : public DataAbstract Line 191  class DataConstant : public DataAbstract
191    virtual    virtual
192    void    void
193    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
194             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
195    
   /**  
     \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);  
196    
197    /**    /**
198       \brief       \brief
# Line 292  class DataConstant : public DataAbstract Line 277  class DataConstant : public DataAbstract
277    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);
278    
279    
280      /**
281         \brief
282         Return a reference to the underlying DataVector.
283      */
284      ESCRIPT_DLL_API
285      DataTypes::ValueType&
286      getVector();
287    
288      ESCRIPT_DLL_API
289      const DataTypes::ValueType&
290      getVector() const;
291    
292    
293   protected:   protected:
294    
295   private:   private:
296    //    //
297    // the actual data    // the actual data
298    DataArrayView::ValueType m_data;    DataTypes::ValueType m_data;
299    
300  };  };
301    
302    inline
303    DataTypes::ValueType&
304    DataConstant::getVector()
305    {
306      return m_data;
307    }
308    
309    inline
310    const DataTypes::ValueType&
311    DataConstant::getVector() const
312    {
313      return m_data;
314    }
315    
316    
317  } // end of namespace  } // end of namespace
318  #endif  #endif

Legend:
Removed from v.1388  
changed lines
  Added in v.1799

  ViewVC Help
Powered by ViewVC 1.1.26