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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1
2 /*******************************************************
3 *
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
14
15 #include "DataAbstract.h"
16 #include "DataException.h"
17
18 using namespace std;
19
20 namespace escript {
21
22 DataAbstract::DataAbstract(const FunctionSpace& what, const ShapeType& shape, bool isDataEmpty):
23 m_noDataPointsPerSample(what.getNumDPPSample()),
24 m_noSamples(what.getNumSamples()),
25 m_functionSpace(what),
26 m_shape(shape),
27 m_rank(DataTypes::getRank(shape)),
28 m_novalues(DataTypes::noValues(shape))
29 {
30 m_isempty=isDataEmpty;
31 }
32
33 DataAbstract::~DataAbstract()
34 {
35 }
36
37
38 void
39 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 if (!((right.getRank()==0) ||
59 (right.getShape()==getShape())))
60 {
61 stringstream temp;
62 temp << "Error - Right hand argument point data shape: "
63 << DataTypes::shapeToString(right.getShape())
64 << " doesn't match left: "
65 << DataTypes::shapeToString(getShape());
66 throw DataException(temp.str());
67 }
68 }
69
70 void
71 DataAbstract::dump(const std::string fileName) const
72 {
73 throw DataException("Error - DataAbstract::dump: not implemented.");
74 }
75
76
77
78 DataAbstract::ValueType::value_type*
79 DataAbstract::getSampleDataByTag(int tag)
80 {
81 throw DataException("Error - DataAbstract::getSampleDataByTag: Data type does not have tag values.");
82 }
83
84
85 void
86 DataAbstract::setTaggedValue(int tagKey,
87 const DataTypes::ShapeType& pointshape,
88 const DataTypes::ValueType& value,
89 int dataOffset)
90 {
91 throw DataException("Error - DataAbstract::setTaggedValue: Data type does not have tag values.");
92 }
93
94
95 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
103
104 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 void
110 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 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
120 void
121 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 DataAbstract::trace(DataAbstract* ev, int axis_offset)
134 {
135 throw DataException("Error - DataAbstract::trace is not supported.");
136 }
137
138 void
139 DataAbstract::swapaxes(DataAbstract* ev, int axis0, int axis1)
140 {
141 throw DataException("Error - DataAbstract::component swapaxes is not supported.");
142 }
143 void
144 DataAbstract::transpose(DataAbstract* ev, int axis_offset)
145 {
146 throw DataException("Error - DataAbstract::transpose is not supported.");
147 }
148
149 void
150 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 void
161 DataAbstract::setToZero()
162 {
163 throw DataException("Error - DataAbstract:: cannot set values to zero.");
164 }
165
166 void
167 DataAbstract::reorderByReferenceIDs(int *reference_ids)
168 {
169 throw DataException("Error - DataAbstract:: cannot reorder by reference ids.");
170 }
171
172
173 DataTypes::ValueType&
174 DataAbstract::getVector()
175 {
176 throw DataException("Error - DataAbstract:: does not have a DataVector.");
177 }
178
179 const DataTypes::ValueType&
180 DataAbstract::getVector() const
181 {
182 throw DataException("Error - DataAbstract:: does not have a DataVector.");
183 }
184
185
186
187
188 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26