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

Annotation of /trunk/escript/src/DataConstant.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 100 - (hide annotations)
Wed Dec 15 03:48:48 2004 UTC (14 years, 11 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/DataConstant.h
File MIME type: text/plain
File size: 4600 byte(s)
*** empty log message ***

1 jgs 82 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14    
15 jgs 100 #if !defined escript_DataConstant_20040323_H
16 jgs 82 #define escript_DataConstant_20040323_H
17    
18     #include "escript/Data/DataAbstract.h"
19     #include "escript/Data/DataArray.h"
20     #include "escript/Data/DataArrayView.h"
21    
22     #include <boost/python/numeric.hpp>
23    
24     namespace escript {
25     /**
26     \brief
27 jgs 100 DataConstant stores single data point which represents the entire
28 jgs 82 function space.
29    
30     Description:
31 jgs 100 DataConstant stores single data point which represents the entire
32 jgs 82 function space.
33     */
34 jgs 100 class DataConstant:public DataAbstract {
35 jgs 82
36     public:
37    
38     /**
39     \brief
40 jgs 100 Default constructor for DataConstant
41 jgs 82
42     Description:
43 jgs 100 Default constructor for DataConstant
44 jgs 82
45 jgs 100 \param value Input - Data value for a single point.
46     \param noSamples Input - number of samples.
47     \param noDataPointsPerSample Input - Input.
48     \param what Input - A description of what this data represents.
49    
50 jgs 97 */
51 jgs 100 DataConstant(const boost::python::numeric::array& value, const FunctionSpace& what);
52 jgs 82 /**
53     \brief
54     Copy constructor. Performs a deep copy.
55     */
56     DataConstant(const DataConstant& other);
57     /**
58     \brief
59 jgs 100 Alternative constructor for DataConstant
60 jgs 82
61     Description:
62 jgs 100 Alternative Constructor for DataConstant
63     \param value Input - Data value for a single point.
64     \param noSamples Input - number of samples.
65     \param noDataPointsPerSample Input - Input.
66     \param what Input - A description of what this data represents.
67 jgs 82 */
68 jgs 100 DataConstant(const DataArrayView& value, const FunctionSpace& what);
69 jgs 82 /**
70     \brief
71 jgs 100 Alternative constructor for DataConstant
72 jgs 82
73     Description:
74 jgs 100 Alternative Constructor for DataConstant
75     \param other Input - Other DataConstant
76     \param region Input - region to copy
77 jgs 82 */
78 jgs 100 DataConstant(const DataConstant& other, const DataArrayView::RegionType& region);
79 jgs 82 /**
80     \brief
81     Write the data as a string.
82     */
83 jgs 100 std::string toString() const;
84 jgs 82 /**
85     \brief
86 jgs 100 Return the offset for the given sample. This is somewhat artificial notion
87 jgs 82 but returns the offset in bytes for the given point into the container
88     holding the point data. Only really necessary to avoid many DataArrayView
89     objects.
90 jgs 100 \param sampleNo - Input, sample number.
91     \param dataPointNo - Input, data point number for the sample.
92 jgs 82 */
93 jgs 100 virtual DataArrayView::ValueType::size_type getPointOffset(int sampleNo, int dataPointNo) const;
94 jgs 82 /**
95     \brief
96     Return a view into the data for the data point specified.
97 jgs 100 NOTE: Construction of the DataArrayView is a relatively expensive
98     operation
99     \param sampleNo Input
100     \param dataPointNo Input
101 jgs 82 */
102 jgs 100 virtual DataArrayView getDataPoint(int sampleNo, int dataPointNo);
103 jgs 82 /**
104     \brief
105 jgs 100 Return the number of doubles stored for the Data
106 jgs 82 */
107 jgs 100 virtual ValueType::size_type getLength() const;
108 jgs 82 /**
109     \brief
110 jgs 100 Factory method that returns a newly created DataConstant.
111 jgs 82 The caller is reponsible for managing the object created.
112     */
113 jgs 100 virtual DataAbstract* getSlice(const DataArrayView::RegionType& region) const; /**
114 jgs 82 \brief
115     Copy the specified region from the given value.
116 jgs 100 \param value Input - Data to copy from
117     \param region Input - Region to copy.
118 jgs 82 */
119 jgs 100 virtual void setSlice(const DataAbstract* value, const DataArrayView::RegionType& region);
120 jgs 82 /**
121     \brief
122     Reshape the data point if the data point is currently rank 0.
123     The original data point value is used for all values of the new
124     data point.
125     */
126 jgs 100 void reshapeDataPoint(const DataArrayView::ShapeType& shape);
127 jgs 82 protected:
128    
129     private:
130     //
131 jgs 100 // data
132 jgs 82 DataArrayView::ValueType m_data;
133     };
134    
135     } // end of namespace
136     #endif
137 jgs 100

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26