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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2856 - (show annotations)
Mon Jan 18 04:14:37 2010 UTC (9 years, 7 months ago) by gross
File size: 7525 byte(s)
FunctionSpaces provide now some information about their approximation order.
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 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 // Please see the discusion in DataAbstract's version of this method
25 // and why I squash the exception
26 Domain_ptr AbstractDomain::getPtr()
27 {
28 try
29 {
30 return shared_from_this();
31 }
32 catch (boost::bad_weak_ptr p)
33 {
34 return Domain_ptr(this);
35 }
36 }
37
38 const_Domain_ptr AbstractDomain::getPtr() const
39 {
40 try
41 {
42 return shared_from_this();
43 }
44 catch (boost::bad_weak_ptr p)
45 {
46 return const_Domain_ptr(this);
47 }
48 }
49
50 AbstractDomain::AbstractDomain() {
51 }
52
53 AbstractDomain::~AbstractDomain() {
54 }
55
56 int AbstractDomain::getMPISize() const
57 {
58 return 1;
59 }
60 int AbstractDomain::getMPIRank() const
61 {
62 return 0;
63 }
64 void AbstractDomain::MPIBarrier() const
65 {
66 throwStandardException("MPIBarrier");
67 return;
68 }
69 bool AbstractDomain::onMasterProcessor() const
70 {
71 return true;
72 }
73
74 ESCRIPT_DLL_API
75 #ifdef PASO_MPI
76 MPI_Comm
77 #else
78 unsigned int
79 #endif
80 AbstractDomain::getMPIComm() const
81 {
82 throwStandardException("AbstractDomain::getMPIComm");
83 return false;
84 }
85
86
87 void AbstractDomain::throwStandardException(const std::string& functionName) const
88 {
89 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
90 }
91
92 bool AbstractDomain::isValidFunctionSpaceType(int functionSpaceType) const
93 {
94 throwStandardException("AbstractDomain::isValidFunctionSpaceType");
95 return false;
96 }
97
98 std::string AbstractDomain::getDescription() const
99 {
100 throwStandardException("AbstractDomain::getDescription");
101 return "";
102 }
103
104 std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const
105 {
106 throwStandardException("AbstractDomain::functionSpaceTypeAsString");
107 return "";
108 }
109
110 int AbstractDomain::getDim() const
111 {
112 throwStandardException("AbstractDomain::getDim");
113 return 0;
114 }
115
116 void AbstractDomain::write(const std::string& filename) const
117 {
118 throwStandardException("AbstractDomain::write");
119 return;
120 }
121 void AbstractDomain::dump(const std::string& filename) const
122 {
123 throwStandardException("AbstractDomain::dump");
124 return;
125 }
126
127 std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const
128 {
129 throwStandardException("AbstractDomain::getDataShape");
130 return std::pair<int,int>(0,0);
131 }
132
133 int AbstractDomain::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
134 {
135 throwStandardException("AbstractDomain::getTagFromSampleNo");
136 return 0;
137 }
138
139 const int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
140 {
141 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
142 return 0;
143 }
144
145 void AbstractDomain::setNewX(const escript::Data& arg)
146 {
147 throwStandardException("AbstractDomain::setNewX");
148 return;
149 }
150
151 void AbstractDomain::interpolateOnDomain(escript::Data& target,const escript::Data& source) const
152 {
153 throwStandardException("AbstractDomain::interpolateOnDomain");
154 return;
155 }
156 void AbstractDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
157 {
158 throwStandardException("AbstractDomain::interpolateACross");
159 return;
160 }
161
162 escript::Data AbstractDomain::getX() const
163 {
164 throwStandardException("AbstractDomain::getX");
165 return Data();
166 }
167
168 escript::Data AbstractDomain::getNormal() const
169 {
170 throwStandardException("AbstractDomain::getNormal");
171 return Data();
172 }
173
174 escript::Data AbstractDomain::getSize() const
175 {
176 throwStandardException("AbstractDomain::getSize");
177 return Data();
178 }
179
180 void AbstractDomain::setToX(escript::Data& out) const
181 {
182 throwStandardException("AbstractDomain::setToX");
183 return;
184 }
185
186 void AbstractDomain::setToNormal(escript::Data& out) const
187 {
188 throwStandardException("AbstractDomain::setToNormal");
189 return;
190 }
191
192 void AbstractDomain::setToSize(escript::Data& out) const
193 {
194 throwStandardException("AbstractDomain::setToSize");
195 return;
196 }
197
198 void AbstractDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
199 {
200 throwStandardException("AbstractDomain::setToGradient");
201 return;
202 }
203
204 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
205 {
206 throwStandardException("AbstractDomain::setTags");
207 return;
208 }
209
210 void AbstractDomain::saveDX(const std::string& filename,const boost::python::dict& arg) const
211 {
212 throwStandardException("AbstractDomain::saveDX");
213 return;
214 }
215
216 void AbstractDomain::saveVTK(const std::string& filename,const boost::python::dict& arg, const std::string& metadata, const std::string& metadata_schema) const
217 {
218 throwStandardException("AbstractDomain::saveVTK");
219 return;
220 }
221
222 bool AbstractDomain::ownSample(int fs_code, index_t id) const
223 {
224 throwStandardException("AbstractDomain::ownSample");
225 return false;
226 }
227
228 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
229 {
230 throwStandardException("AbstractDomain::probeInterpolationOnDomain");
231 return false;
232 }
233
234 bool AbstractDomain::commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const
235 {
236 throwStandardException("AbstractDomain::commonFunctionSpace");
237 return false;
238 }
239
240
241 bool AbstractDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
242 {
243 throwStandardException("AbstractDomain::probeInterpolationACross");
244 return false;
245 }
246
247 bool AbstractDomain::isCellOriented(int functionSpaceCode) const
248 {
249 throwStandardException("AbstractDomain::isCellOriented");
250 return false;
251 }
252
253 bool AbstractDomain::operator==(const AbstractDomain& other) const
254 {
255 throwStandardException("AbstractDomain::operator==");
256 return false;
257 }
258 bool AbstractDomain::operator!=(const AbstractDomain& other) const
259 {
260 throwStandardException("AbstractDomain::operator!=");
261 return false;
262 }
263
264 AbstractDomain::StatusType AbstractDomain::getStatus() const
265 {
266 return 0;
267 }
268 void AbstractDomain::setTagMap(const std::string& name, int tag)
269 {
270 throwStandardException("AbstractDomain::set TagMap is not implemented.");
271 }
272 int AbstractDomain::getTag(const std::string& name) const
273 {
274 throwStandardException("AbstractDomain::getTag is not implemented.");
275 return 0;
276 }
277
278 bool AbstractDomain::isValidTagName(const std::string& name) const
279 {
280 return false;
281 }
282
283 std::string AbstractDomain::showTagNames() const
284 {
285 throwStandardException("AbstractDomain::showTagNames is not implemented.");
286 return string();
287 }
288
289 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
290 {
291 throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
292 return 0;
293 }
294
295 const int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
296 {
297 throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
298 return NULL;
299 }
300
301
302 bool AbstractDomain::canTag(int functionspacecode) const
303 {
304 throwStandardException("AbstractDomain::canTag is not implemented.");
305 return false;
306 }
307
308 int AbstractDomain::getApproximationOrder(const int functionSpaceCode) const
309 {
310 throwStandardException("AbstractContinuousDomain::getApproximationOrder");
311 return 0;
312 }
313
314
315
316 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26