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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 11 months ago) by ksteube
File size: 5022 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

1 jgs 82
2 ksteube 1312 /* $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 jgs 474 #include "DataAbstract.h"
17     #include "DataException.h"
18 jgs 82
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 jgs 119 DataAbstract::resetPointDataView()
42     {
43     m_pointDataView.reset(new DataArrayView());
44     }
45    
46     void
47 jgs 82 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 gross 950 void
79     DataAbstract::dump(const std::string fileName) const
80     {
81     throw DataException("Error - DataAbstract:: dump: not implemented.");
82     }
83    
84    
85    
86 jgs 82 DataAbstract::ValueType::value_type*
87     DataAbstract::getSampleDataByTag(int tag)
88     {
89 jgs 110 throw DataException("Error - DataAbstract::getSampleDataByTag: Data type does not have tag values.");
90 jgs 82 }
91    
92     void
93     DataAbstract::setTaggedValue(int tagKey,
94     const DataArrayView& value)
95     {
96 jgs 110 throw DataException("Error - DataAbstract::setTaggedValue: Data type does not have tag values.");
97 jgs 82 }
98    
99 jgs 149 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 jgs 123 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 jgs 126 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 gross 921 void
126 gross 922 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 gross 921 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 jgs 126
136 gross 576 void
137 ksteube 775 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 gross 800 DataAbstract::trace(DataAbstract* ev, int axis_offset)
150 ksteube 775 {
151 gross 800 throw DataException("Error - DataAbstract::trace is not supported.");
152 ksteube 775 }
153    
154     void
155 gross 804 DataAbstract::swapaxes(DataAbstract* ev, int axis0, int axis1)
156 gross 800 {
157 gross 804 throw DataException("Error - DataAbstract::component swapaxes is not supported.");
158 gross 800 }
159     void
160 ksteube 775 DataAbstract::transpose(DataAbstract* ev, int axis_offset)
161     {
162     throw DataException("Error - DataAbstract::transpose is not supported.");
163     }
164    
165     void
166 gross 576 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 gross 1118 void
177     DataAbstract::setToZero()
178     {
179     throw DataException("Error - DataAbstract:: cannot set values to zero.");
180     }
181 gross 576
182    
183    
184 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