/[escript]/trunk/escript/src/DataAbstract.cpp
ViewVC logotype

Annotation of /trunk/escript/src/DataAbstract.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (hide annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years, 1 month ago) by ksteube
File size: 5022 byte(s)
Copyright updated in all files

1 jgs 82
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4     * Copyright (c) 2003-2008 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
15 jgs 474 #include "DataAbstract.h"
16     #include "DataException.h"
17 jgs 82
18     using namespace std;
19    
20     namespace escript {
21    
22 jfenwick 1803 DataAbstract::DataAbstract(const FunctionSpace& what, const ShapeType& shape, bool isDataEmpty):
23 jgs 82 m_noDataPointsPerSample(what.getNumDPPSample()),
24     m_noSamples(what.getNumSamples()),
25 jfenwick 1796 m_functionSpace(what),
26     m_shape(shape),
27     m_rank(DataTypes::getRank(shape)),
28     m_novalues(DataTypes::noValues(shape))
29 jgs 82 {
30 jfenwick 1803 m_isempty=isDataEmpty;
31 jgs 82 }
32    
33     DataAbstract::~DataAbstract()
34     {
35     }
36    
37    
38 jgs 119 void
39 jgs 82 DataAbstract::operandCheck(const DataAbstract& right) const
40     {
41     if ((right.getNumDPPSample()!=getNumDPPSample()) ||
42     (right.getNumSamples()!=getNumSamples()) ||
43     (right.getFunctionSpace()!=getFunctionSpace())) {
44     stringstream temp;
45     temp << "Error - Right hand argument sample shape or function space "
46     << "incompatible with left." << endl
47     << "LHS: (" << getNumSamples() << ","
48     << getNumDPPSample() << ") " << getFunctionSpace().toString()
49     << endl
50     << "RHS: (" << right.getNumSamples() << ","
51     << right.getNumDPPSample() << ") "
52     << right.getFunctionSpace().toString();
53     throw DataException(temp.str());
54     }
55    
56     //
57     // Check the shape of the point data, a rank of 0(scalar) is okay
58 jfenwick 1796 if (!((right.getRank()==0) ||
59     (right.getShape()==getShape())))
60 jgs 82 {
61     stringstream temp;
62     temp << "Error - Right hand argument point data shape: "
63 jfenwick 1796 << DataTypes::shapeToString(right.getShape())
64 jgs 82 << " doesn't match left: "
65 jfenwick 1796 << DataTypes::shapeToString(getShape());
66 jgs 82 throw DataException(temp.str());
67     }
68     }
69    
70 gross 950 void
71     DataAbstract::dump(const std::string fileName) const
72     {
73 jfenwick 1803 throw DataException("Error - DataAbstract::dump: not implemented.");
74 gross 950 }
75    
76    
77    
78 jgs 82 DataAbstract::ValueType::value_type*
79     DataAbstract::getSampleDataByTag(int tag)
80     {
81 jgs 110 throw DataException("Error - DataAbstract::getSampleDataByTag: Data type does not have tag values.");
82 jgs 82 }
83    
84 jfenwick 1796
85     void
86 jgs 82 DataAbstract::setTaggedValue(int tagKey,
87 jfenwick 1796 const DataTypes::ShapeType& pointshape,
88     const DataTypes::ValueType& value,
89     int dataOffset)
90 jgs 82 {
91 jgs 110 throw DataException("Error - DataAbstract::setTaggedValue: Data type does not have tag values.");
92 jgs 82 }
93    
94 jfenwick 1796
95 jgs 149 int
96     DataAbstract::getTagNumber(int dpno)
97     {
98     throw DataException("Error - DataAbstract::getTagNumber: Data type cannot be accessed by tag values.");
99     return (0);
100     }
101    
102 jgs 123
103    
104 jgs 126 void
105     DataAbstract::copyAll(const boost::python::numeric::array& value)
106     {
107     throw DataException("Error - DataAbstract::copying data from numarray objects is not supported.");
108     }
109 gross 921 void
110 gross 922 DataAbstract::copyToDataPoint(const int sampleNo, const int dataPointNo, const double value)
111     {
112     throw DataException("Error - DataAbstract::copying data from double value to a single data point is not supported.");
113     }
114     void
115 gross 921 DataAbstract::copyToDataPoint(const int sampleNo, const int dataPointNo, const boost::python::numeric::array& value)
116     {
117     throw DataException("Error - DataAbstract::copying data from numarray objects to a single data point is not supported.");
118     }
119 jgs 126
120 gross 576 void
121 ksteube 775 DataAbstract::symmetric(DataAbstract* ev)
122     {
123     throw DataException("Error - DataAbstract::symmetric is not supported.");
124     }
125    
126     void
127     DataAbstract::nonsymmetric(DataAbstract* ev)
128     {
129     throw DataException("Error - DataAbstract::nonsymmetric is not supported.");
130     }
131    
132     void
133 gross 800 DataAbstract::trace(DataAbstract* ev, int axis_offset)
134 ksteube 775 {
135 gross 800 throw DataException("Error - DataAbstract::trace is not supported.");
136 ksteube 775 }
137    
138     void
139 gross 804 DataAbstract::swapaxes(DataAbstract* ev, int axis0, int axis1)
140 gross 800 {
141 gross 804 throw DataException("Error - DataAbstract::component swapaxes is not supported.");
142 gross 800 }
143     void
144 ksteube 775 DataAbstract::transpose(DataAbstract* ev, int axis_offset)
145     {
146     throw DataException("Error - DataAbstract::transpose is not supported.");
147     }
148    
149     void
150 gross 576 DataAbstract::eigenvalues(DataAbstract* ev)
151     {
152     throw DataException("Error - DataAbstract::eigenvalues is not supported.");
153     }
154     void
155     DataAbstract::eigenvalues_and_eigenvectors(DataAbstract* ev,DataAbstract* V,const double tol)
156     {
157     throw DataException("Error - DataAbstract::eigenvalues_and_eigenvectors is not supported.");
158    
159     }
160 gross 1118 void
161     DataAbstract::setToZero()
162     {
163     throw DataException("Error - DataAbstract:: cannot set values to zero.");
164     }
165 gross 576
166 gross 1487 void
167     DataAbstract::reorderByReferenceIDs(int *reference_ids)
168     {
169 jfenwick 1803 throw DataException("Error - DataAbstract:: cannot reorder by reference ids.");
170 gross 1487 }
171 gross 576
172    
173 jfenwick 1796 DataTypes::ValueType&
174     DataAbstract::getVector()
175     {
176     throw DataException("Error - DataAbstract:: does not have a DataVector.");
177     }
178 gross 1487
179 jfenwick 1796 const DataTypes::ValueType&
180     DataAbstract::getVector() const
181     {
182     throw DataException("Error - DataAbstract:: does not have a DataVector.");
183     }
184 gross 1487
185 jfenwick 1796
186    
187    
188 jgs 82 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26