/[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 1795 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1796 by jfenwick, Wed Sep 17 01:45:46 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 135  class DataConstant : public DataAbstract Line 134  class DataConstant : public DataAbstract
134     */     */
135    ESCRIPT_DLL_API    ESCRIPT_DLL_API
136    virtual    virtual
137    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
138    getPointOffset(int sampleNo,    getPointOffset(int sampleNo,
139                   int dataPointNo) const;                   int dataPointNo) const;
140    
141    /**  //  /**
142       \brief  /*     \brief
143       Return a view into the data for the data point specified.       Return a view into the data for the data point specified.
144       \param sampleNo - Input - sample number.       \param sampleNo - Input - sample number.
145       \param dataPointNo - Input - data point number for the sample.       \param dataPointNo - Input - data point number for the sample.*/
146    */  //  */
147    ESCRIPT_DLL_API  //   ESCRIPT_DLL_API
148    virtual  //   virtual
149    DataArrayView  //   DataArrayView
150    getDataPoint(int sampleNo,  //   getDataPoint(int sampleNo,
151                 int dataPointNo);  //                int dataPointNo);
152    
153    /**    /**
154       \brief       \brief
# Line 157  class DataConstant : public DataAbstract Line 156  class DataConstant : public DataAbstract
156    */    */
157    ESCRIPT_DLL_API    ESCRIPT_DLL_API
158    virtual    virtual
159    DataArrayView::ValueType::size_type    DataTypes::ValueType::size_type
160    getLength() const;    getLength() const;
161    
162    /**    /**
# Line 170  class DataConstant : public DataAbstract Line 169  class DataConstant : public DataAbstract
169    ESCRIPT_DLL_API    ESCRIPT_DLL_API
170    virtual    virtual
171    DataAbstract*    DataAbstract*
172    getSlice(const DataArrayView::RegionType& region) const;    getSlice(const DataTypes::RegionType& region) const;
173    
174    /**    /**
175       \brief       \brief
# Line 182  class DataConstant : public DataAbstract Line 181  class DataConstant : public DataAbstract
181    virtual    virtual
182    void    void
183    setSlice(const DataAbstract* value,    setSlice(const DataAbstract* value,
184             const DataArrayView::RegionType& region);             const DataTypes::RegionType& region);
185    
   /**  
     \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);  
186    
187    /**    /**
188       \brief       \brief
# Line 292  class DataConstant : public DataAbstract Line 267  class DataConstant : public DataAbstract
267    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);
268    
269    
270      /**
271         \brief
272         Return a reference to the underlying DataVector.
273      */
274      ESCRIPT_DLL_API
275      DataTypes::ValueType&
276      getVector();
277    
278      ESCRIPT_DLL_API
279      const DataTypes::ValueType&
280      getVector() const;
281    
282    
283   protected:   protected:
284    
285   private:   private:
286    //    //
287    // the actual data    // the actual data
288    DataArrayView::ValueType m_data;    DataTypes::ValueType m_data;
289    
290  };  };
291    
292    inline
293    DataTypes::ValueType&
294    DataConstant::getVector()
295    {
296      return m_data;
297    }
298    
299    inline
300    const DataTypes::ValueType&
301    DataConstant::getVector() const
302    {
303      return m_data;
304    }
305    
306    
307  } // end of namespace  } // end of namespace
308  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.26