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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 ksteube 1312
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 3911 * Copyright (c) 2003-2012 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
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 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 ksteube 1312
16 ksteube 1811
17 jgs 474 #include "AbstractDomain.h"
18     #include "DomainException.h"
19 jgs 480 #include "Data.h"
20 jfenwick 3259 #include "esysUtils/Esys_MPI.h"
21 jgs 480
22 jgs 121 using namespace std;
23 jgs 149
24 jgs 82 namespace escript {
25    
26 jfenwick 2436 // Please see the discusion in DataAbstract's version of this method
27     // and why I squash the exception
28 jfenwick 1872 Domain_ptr AbstractDomain::getPtr()
29     {
30 jfenwick 2436 try
31 jfenwick 1872 {
32 jfenwick 2436 return shared_from_this();
33 jfenwick 1872 }
34 jfenwick 2436 catch (boost::bad_weak_ptr p)
35 jfenwick 1872 {
36 jfenwick 2436 return Domain_ptr(this);
37 jfenwick 1872 }
38     }
39    
40     const_Domain_ptr AbstractDomain::getPtr() const
41 jfenwick 2436 {
42     try
43 jfenwick 1872 {
44 jfenwick 2436 return shared_from_this();
45 jfenwick 1872 }
46 jfenwick 2436 catch (boost::bad_weak_ptr p)
47 jfenwick 1872 {
48 jfenwick 2436 return const_Domain_ptr(this);
49 jfenwick 1872 }
50     }
51    
52 jgs 82 AbstractDomain::AbstractDomain() {
53     }
54    
55     AbstractDomain::~AbstractDomain() {
56     }
57    
58 ksteube 1312 int AbstractDomain::getMPISize() const
59     {
60     return 1;
61     }
62     int AbstractDomain::getMPIRank() const
63     {
64     return 0;
65     }
66 ksteube 1877 void AbstractDomain::MPIBarrier() const
67     {
68 jfenwick 2256 throwStandardException("MPIBarrier");
69 ksteube 1877 return;
70     }
71     bool AbstractDomain::onMasterProcessor() const
72     {
73     return true;
74     }
75 ksteube 1312
76 jfenwick 2640 ESCRIPT_DLL_API
77 jfenwick 3259 #ifdef ESYS_MPI
78 jfenwick 2640 MPI_Comm
79     #else
80     unsigned int
81     #endif
82     AbstractDomain::getMPIComm() const
83     {
84     throwStandardException("AbstractDomain::getMPIComm");
85 jfenwick 3919 return 0;
86 jfenwick 2640 }
87 ksteube 1312
88 ksteube 1877
89 jgs 82 void AbstractDomain::throwStandardException(const std::string& functionName) const
90     {
91 jgs 115 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
92 jgs 82 }
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 ksteube 1312 void AbstractDomain::dump(const std::string& filename) const
124     {
125     throwStandardException("AbstractDomain::dump");
126     return;
127     }
128 jgs 82
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 jfenwick 2487 const int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
142 jgs 110 {
143 gross 964 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
144 jgs 110 return 0;
145     }
146    
147 jgs 82 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 jgs 102 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 jgs 115
176 jgs 102 escript::Data AbstractDomain::getSize() const
177     {
178     throwStandardException("AbstractDomain::getSize");
179     return Data();
180     }
181 jgs 115
182 jgs 82 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 jgs 115
194 jgs 82 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 gross 767 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
207     {
208     throwStandardException("AbstractDomain::setTags");
209     return;
210     }
211    
212 jfenwick 2642 bool AbstractDomain::ownSample(int fs_code, index_t id) const
213     {
214     throwStandardException("AbstractDomain::ownSample");
215     return false;
216     }
217    
218 jgs 82 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
219     {
220     throwStandardException("AbstractDomain::probeInterpolationOnDomain");
221     return false;
222     }
223    
224 jfenwick 2635 bool AbstractDomain::commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const
225     {
226     throwStandardException("AbstractDomain::commonFunctionSpace");
227     return false;
228     }
229    
230    
231 jgs 82 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 jgs 121 throwStandardException("AbstractDomain::operator==");
246     return false;
247 jgs 82 }
248     bool AbstractDomain::operator!=(const AbstractDomain& other) const
249     {
250 jgs 121 throwStandardException("AbstractDomain::operator!=");
251     return false;
252 jgs 82 }
253    
254 gross 797 AbstractDomain::StatusType AbstractDomain::getStatus() const
255     {
256     return 0;
257     }
258 gross 1044 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 gross 797
268 gross 1044 bool AbstractDomain::isValidTagName(const std::string& name) const
269     {
270     return false;
271     }
272 gross 797
273 gross 1044 std::string AbstractDomain::showTagNames() const
274     {
275     throwStandardException("AbstractDomain::showTagNames is not implemented.");
276     return string();
277     }
278    
279 gross 1716 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
280     {
281     throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
282     return 0;
283     }
284 jfenwick 2487
285     const int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
286 gross 1716 {
287     throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
288     return NULL;
289     }
290 gross 1044
291    
292 jfenwick 1802 bool AbstractDomain::canTag(int functionspacecode) const
293     {
294     throwStandardException("AbstractDomain::canTag is not implemented.");
295     return false;
296     }
297 gross 1716
298 gross 2856 int AbstractDomain::getApproximationOrder(const int functionSpaceCode) const
299     {
300 jfenwick 3259 throwStandardException("AbstractDomain::getApproximationOrder");
301 gross 2856 return 0;
302     }
303 gross 1716
304 jfenwick 3259 bool AbstractDomain::supportsContactElements() const
305     {
306     throwStandardException("AbstractDomain::supportsContactElements");
307     return false;
308     }
309 gross 2856
310 jgs 115 } // end of namespace

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26