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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26