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