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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4114 - (show annotations)
Fri Dec 14 04:24:46 2012 UTC (6 years, 9 months ago) by caltinay
File size: 7385 byte(s)
Time to remove deprecated saveVTK/DX methods from Data and Domain.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26