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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2256 - (show annotations)
Mon Feb 9 06:20:32 2009 UTC (10 years, 11 months ago) by jfenwick
File size: 6717 byte(s)
Throw an exception if AbstractDomain::MPIBarrier is called (This shouldn't happen).
Added Barrier to saveVTK.
Replaced some misused keywords.

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 "AbstractDomain.h"
16 #include "DomainException.h"
17 #include "Data.h"
18 #include "paso/Paso_MPI.h"
19
20 using namespace std;
21
22 namespace escript {
23
24
25 Domain_ptr AbstractDomain::getPtr()
26 {
27 if (_internal_weak_this.expired())
28 {
29 return Domain_ptr(this);
30 }
31 else
32 {
33 return shared_from_this();
34 }
35 }
36
37 const_Domain_ptr AbstractDomain::getPtr() const
38 {
39 if (_internal_weak_this.expired())
40 {
41 return const_Domain_ptr(this);
42 }
43 else
44 {
45 return shared_from_this();
46 }
47 }
48
49 AbstractDomain::AbstractDomain() {
50 }
51
52 AbstractDomain::~AbstractDomain() {
53 }
54
55 int AbstractDomain::getMPISize() const
56 {
57 return 1;
58 }
59 int AbstractDomain::getMPIRank() const
60 {
61 return 0;
62 }
63 void AbstractDomain::MPIBarrier() const
64 {
65 throwStandardException("MPIBarrier");
66 return;
67 }
68 bool AbstractDomain::onMasterProcessor() const
69 {
70 return true;
71 }
72
73
74
75 void AbstractDomain::throwStandardException(const std::string& functionName) const
76 {
77 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
78 }
79
80 bool AbstractDomain::isValidFunctionSpaceType(int functionSpaceType) const
81 {
82 throwStandardException("AbstractDomain::isValidFunctionSpaceType");
83 return false;
84 }
85
86 std::string AbstractDomain::getDescription() const
87 {
88 throwStandardException("AbstractDomain::getDescription");
89 return "";
90 }
91
92 std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const
93 {
94 throwStandardException("AbstractDomain::functionSpaceTypeAsString");
95 return "";
96 }
97
98 int AbstractDomain::getDim() const
99 {
100 throwStandardException("AbstractDomain::getDim");
101 return 0;
102 }
103
104 void AbstractDomain::write(const std::string& filename) const
105 {
106 throwStandardException("AbstractDomain::write");
107 return;
108 }
109 void AbstractDomain::dump(const std::string& filename) const
110 {
111 throwStandardException("AbstractDomain::dump");
112 return;
113 }
114
115 std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const
116 {
117 throwStandardException("AbstractDomain::getDataShape");
118 return std::pair<int,int>(0,0);
119 }
120
121 int AbstractDomain::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
122 {
123 throwStandardException("AbstractDomain::getTagFromSampleNo");
124 return 0;
125 }
126
127 int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
128 {
129 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
130 return 0;
131 }
132
133 void AbstractDomain::setNewX(const escript::Data& arg)
134 {
135 throwStandardException("AbstractDomain::setNewX");
136 return;
137 }
138
139 void AbstractDomain::interpolateOnDomain(escript::Data& target,const escript::Data& source) const
140 {
141 throwStandardException("AbstractDomain::interpolateOnDomain");
142 return;
143 }
144 void AbstractDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
145 {
146 throwStandardException("AbstractDomain::interpolateACross");
147 return;
148 }
149
150 escript::Data AbstractDomain::getX() const
151 {
152 throwStandardException("AbstractDomain::getX");
153 return Data();
154 }
155
156 escript::Data AbstractDomain::getNormal() const
157 {
158 throwStandardException("AbstractDomain::getNormal");
159 return Data();
160 }
161
162 escript::Data AbstractDomain::getSize() const
163 {
164 throwStandardException("AbstractDomain::getSize");
165 return Data();
166 }
167
168 void AbstractDomain::setToX(escript::Data& out) const
169 {
170 throwStandardException("AbstractDomain::setToX");
171 return;
172 }
173
174 void AbstractDomain::setToNormal(escript::Data& out) const
175 {
176 throwStandardException("AbstractDomain::setToNormal");
177 return;
178 }
179
180 void AbstractDomain::setToSize(escript::Data& out) const
181 {
182 throwStandardException("AbstractDomain::setToSize");
183 return;
184 }
185
186 void AbstractDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
187 {
188 throwStandardException("AbstractDomain::setToGradient");
189 return;
190 }
191
192 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
193 {
194 throwStandardException("AbstractDomain::setTags");
195 return;
196 }
197
198 void AbstractDomain::saveDX(const std::string& filename,const boost::python::dict& arg) const
199 {
200 throwStandardException("AbstractDomain::saveDX");
201 return;
202 }
203
204 void AbstractDomain::saveVTK(const std::string& filename,const boost::python::dict& arg) const
205 {
206 throwStandardException("AbstractDomain::saveVTK");
207 return;
208 }
209
210 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
211 {
212 throwStandardException("AbstractDomain::probeInterpolationOnDomain");
213 return false;
214 }
215
216 bool AbstractDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
217 {
218 throwStandardException("AbstractDomain::probeInterpolationACross");
219 return false;
220 }
221
222 bool AbstractDomain::isCellOriented(int functionSpaceCode) const
223 {
224 throwStandardException("AbstractDomain::isCellOriented");
225 return false;
226 }
227
228 bool AbstractDomain::operator==(const AbstractDomain& other) const
229 {
230 throwStandardException("AbstractDomain::operator==");
231 return false;
232 }
233 bool AbstractDomain::operator!=(const AbstractDomain& other) const
234 {
235 throwStandardException("AbstractDomain::operator!=");
236 return false;
237 }
238
239 AbstractDomain::StatusType AbstractDomain::getStatus() const
240 {
241 throwStandardException("AbstractDomain::getStatus");
242 return 0;
243 }
244 void AbstractDomain::setTagMap(const std::string& name, int tag)
245 {
246 throwStandardException("AbstractDomain::set TagMap is not implemented.");
247 }
248 int AbstractDomain::getTag(const std::string& name) const
249 {
250 throwStandardException("AbstractDomain::getTag is not implemented.");
251 return 0;
252 }
253
254 bool AbstractDomain::isValidTagName(const std::string& name) const
255 {
256 return false;
257 }
258
259 std::string AbstractDomain::showTagNames() const
260 {
261 throwStandardException("AbstractDomain::showTagNames is not implemented.");
262 return string();
263 }
264
265 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
266 {
267 throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
268 return 0;
269 }
270 int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
271 {
272 throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
273 return NULL;
274 }
275
276
277 bool AbstractDomain::canTag(int functionspacecode) const
278 {
279 throwStandardException("AbstractDomain::canTag is not implemented.");
280 return false;
281 }
282
283
284
285 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26