/[escript]/branches/numpy/escript/src/AbstractDomain.cpp
ViewVC logotype

Contents of /branches/numpy/escript/src/AbstractDomain.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2441 - (show annotations)
Fri May 29 00:22:42 2009 UTC (9 years, 10 months ago) by jfenwick
File size: 6897 byte(s)
Branch now current with Trunk revision 2440
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 // 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
75
76 void AbstractDomain::throwStandardException(const std::string& functionName) const
77 {
78 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
79 }
80
81 bool AbstractDomain::isValidFunctionSpaceType(int functionSpaceType) const
82 {
83 throwStandardException("AbstractDomain::isValidFunctionSpaceType");
84 return false;
85 }
86
87 std::string AbstractDomain::getDescription() const
88 {
89 throwStandardException("AbstractDomain::getDescription");
90 return "";
91 }
92
93 std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const
94 {
95 throwStandardException("AbstractDomain::functionSpaceTypeAsString");
96 return "";
97 }
98
99 int AbstractDomain::getDim() const
100 {
101 throwStandardException("AbstractDomain::getDim");
102 return 0;
103 }
104
105 void AbstractDomain::write(const std::string& filename) const
106 {
107 throwStandardException("AbstractDomain::write");
108 return;
109 }
110 void AbstractDomain::dump(const std::string& filename) const
111 {
112 throwStandardException("AbstractDomain::dump");
113 return;
114 }
115
116 std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const
117 {
118 throwStandardException("AbstractDomain::getDataShape");
119 return std::pair<int,int>(0,0);
120 }
121
122 int AbstractDomain::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
123 {
124 throwStandardException("AbstractDomain::getTagFromSampleNo");
125 return 0;
126 }
127
128 int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
129 {
130 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
131 return 0;
132 }
133
134 void AbstractDomain::setNewX(const escript::Data& arg)
135 {
136 throwStandardException("AbstractDomain::setNewX");
137 return;
138 }
139
140 void AbstractDomain::interpolateOnDomain(escript::Data& target,const escript::Data& source) const
141 {
142 throwStandardException("AbstractDomain::interpolateOnDomain");
143 return;
144 }
145 void AbstractDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
146 {
147 throwStandardException("AbstractDomain::interpolateACross");
148 return;
149 }
150
151 escript::Data AbstractDomain::getX() const
152 {
153 throwStandardException("AbstractDomain::getX");
154 return Data();
155 }
156
157 escript::Data AbstractDomain::getNormal() const
158 {
159 throwStandardException("AbstractDomain::getNormal");
160 return Data();
161 }
162
163 escript::Data AbstractDomain::getSize() const
164 {
165 throwStandardException("AbstractDomain::getSize");
166 return Data();
167 }
168
169 void AbstractDomain::setToX(escript::Data& out) const
170 {
171 throwStandardException("AbstractDomain::setToX");
172 return;
173 }
174
175 void AbstractDomain::setToNormal(escript::Data& out) const
176 {
177 throwStandardException("AbstractDomain::setToNormal");
178 return;
179 }
180
181 void AbstractDomain::setToSize(escript::Data& out) const
182 {
183 throwStandardException("AbstractDomain::setToSize");
184 return;
185 }
186
187 void AbstractDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
188 {
189 throwStandardException("AbstractDomain::setToGradient");
190 return;
191 }
192
193 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
194 {
195 throwStandardException("AbstractDomain::setTags");
196 return;
197 }
198
199 void AbstractDomain::saveDX(const std::string& filename,const boost::python::dict& arg) const
200 {
201 throwStandardException("AbstractDomain::saveDX");
202 return;
203 }
204
205 void AbstractDomain::saveVTK(const std::string& filename,const boost::python::dict& arg, const std::string& metadata, const std::string& metadata_schema) const
206 {
207 throwStandardException("AbstractDomain::saveVTK");
208 return;
209 }
210
211 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
212 {
213 throwStandardException("AbstractDomain::probeInterpolationOnDomain");
214 return false;
215 }
216
217 bool AbstractDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
218 {
219 throwStandardException("AbstractDomain::probeInterpolationACross");
220 return false;
221 }
222
223 bool AbstractDomain::isCellOriented(int functionSpaceCode) const
224 {
225 throwStandardException("AbstractDomain::isCellOriented");
226 return false;
227 }
228
229 bool AbstractDomain::operator==(const AbstractDomain& other) const
230 {
231 throwStandardException("AbstractDomain::operator==");
232 return false;
233 }
234 bool AbstractDomain::operator!=(const AbstractDomain& other) const
235 {
236 throwStandardException("AbstractDomain::operator!=");
237 return false;
238 }
239
240 AbstractDomain::StatusType AbstractDomain::getStatus() const
241 {
242 throwStandardException("AbstractDomain::getStatus");
243 return 0;
244 }
245 void AbstractDomain::setTagMap(const std::string& name, int tag)
246 {
247 throwStandardException("AbstractDomain::set TagMap is not implemented.");
248 }
249 int AbstractDomain::getTag(const std::string& name) const
250 {
251 throwStandardException("AbstractDomain::getTag is not implemented.");
252 return 0;
253 }
254
255 bool AbstractDomain::isValidTagName(const std::string& name) const
256 {
257 return false;
258 }
259
260 std::string AbstractDomain::showTagNames() const
261 {
262 throwStandardException("AbstractDomain::showTagNames is not implemented.");
263 return string();
264 }
265
266 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
267 {
268 throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
269 return 0;
270 }
271 int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
272 {
273 throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
274 return NULL;
275 }
276
277
278 bool AbstractDomain::canTag(int functionspacecode) const
279 {
280 throwStandardException("AbstractDomain::canTag is not implemented.");
281 return false;
282 }
283
284
285
286 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26