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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2640 - (hide annotations)
Mon Aug 31 06:22:10 2009 UTC (13 years ago) by jfenwick
File size: 7215 byte(s)
Adding getMPIComm

1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * 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 ksteube 1312
14 ksteube 1811
15 jgs 474 #include "AbstractDomain.h"
16     #include "DomainException.h"
17 jgs 480 #include "Data.h"
18 ksteube 1800 #include "paso/Paso_MPI.h"
19 jgs 480
20 jgs 121 using namespace std;
21 jgs 149
22 jgs 82 namespace escript {
23    
24 jfenwick 2436 // Please see the discusion in DataAbstract's version of this method
25     // and why I squash the exception
26 jfenwick 1872 Domain_ptr AbstractDomain::getPtr()
27     {
28 jfenwick 2436 try
29 jfenwick 1872 {
30 jfenwick 2436 return shared_from_this();
31 jfenwick 1872 }
32 jfenwick 2436 catch (boost::bad_weak_ptr p)
33 jfenwick 1872 {
34 jfenwick 2436 return Domain_ptr(this);
35 jfenwick 1872 }
36     }
37    
38     const_Domain_ptr AbstractDomain::getPtr() const
39 jfenwick 2436 {
40     try
41 jfenwick 1872 {
42 jfenwick 2436 return shared_from_this();
43 jfenwick 1872 }
44 jfenwick 2436 catch (boost::bad_weak_ptr p)
45 jfenwick 1872 {
46 jfenwick 2436 return const_Domain_ptr(this);
47 jfenwick 1872 }
48     }
49    
50 jgs 82 AbstractDomain::AbstractDomain() {
51     }
52    
53     AbstractDomain::~AbstractDomain() {
54     }
55    
56 ksteube 1312 int AbstractDomain::getMPISize() const
57     {
58     return 1;
59     }
60     int AbstractDomain::getMPIRank() const
61     {
62     return 0;
63     }
64 ksteube 1877 void AbstractDomain::MPIBarrier() const
65     {
66 jfenwick 2256 throwStandardException("MPIBarrier");
67 ksteube 1877 return;
68     }
69     bool AbstractDomain::onMasterProcessor() const
70     {
71     return true;
72     }
73 ksteube 1312
74 jfenwick 2640 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 ksteube 1312
86 ksteube 1877
87 jgs 82 void AbstractDomain::throwStandardException(const std::string& functionName) const
88     {
89 jgs 115 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
90 jgs 82 }
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 ksteube 1312 void AbstractDomain::dump(const std::string& filename) const
122     {
123     throwStandardException("AbstractDomain::dump");
124     return;
125     }
126 jgs 82
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 jfenwick 2487 const int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
140 jgs 110 {
141 gross 964 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
142 jgs 110 return 0;
143     }
144    
145 jgs 82 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 jgs 102 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 jgs 115
174 jgs 102 escript::Data AbstractDomain::getSize() const
175     {
176     throwStandardException("AbstractDomain::getSize");
177     return Data();
178     }
179 jgs 115
180 jgs 82 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 jgs 115
192 jgs 82 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 gross 767 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
205     {
206     throwStandardException("AbstractDomain::setTags");
207     return;
208     }
209    
210 jgs 153 void AbstractDomain::saveDX(const std::string& filename,const boost::python::dict& arg) const
211 jgs 82 {
212     throwStandardException("AbstractDomain::saveDX");
213     return;
214     }
215    
216 gross 2421 void AbstractDomain::saveVTK(const std::string& filename,const boost::python::dict& arg, const std::string& metadata, const std::string& metadata_schema) const
217 jgs 110 {
218     throwStandardException("AbstractDomain::saveVTK");
219     return;
220     }
221    
222 jgs 82 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
223     {
224     throwStandardException("AbstractDomain::probeInterpolationOnDomain");
225     return false;
226     }
227    
228 jfenwick 2635 bool AbstractDomain::commonFunctionSpace(const std::vector<int>& fs, int& resultcode) const
229     {
230     throwStandardException("AbstractDomain::commonFunctionSpace");
231     return false;
232     }
233    
234    
235 jgs 82 bool AbstractDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
236     {
237     throwStandardException("AbstractDomain::probeInterpolationACross");
238     return false;
239     }
240    
241     bool AbstractDomain::isCellOriented(int functionSpaceCode) const
242     {
243     throwStandardException("AbstractDomain::isCellOriented");
244     return false;
245     }
246    
247     bool AbstractDomain::operator==(const AbstractDomain& other) const
248     {
249 jgs 121 throwStandardException("AbstractDomain::operator==");
250     return false;
251 jgs 82 }
252     bool AbstractDomain::operator!=(const AbstractDomain& other) const
253     {
254 jgs 121 throwStandardException("AbstractDomain::operator!=");
255     return false;
256 jgs 82 }
257    
258 gross 797 AbstractDomain::StatusType AbstractDomain::getStatus() const
259     {
260     return 0;
261     }
262 gross 1044 void AbstractDomain::setTagMap(const std::string& name, int tag)
263     {
264     throwStandardException("AbstractDomain::set TagMap is not implemented.");
265     }
266     int AbstractDomain::getTag(const std::string& name) const
267     {
268     throwStandardException("AbstractDomain::getTag is not implemented.");
269     return 0;
270     }
271 gross 797
272 gross 1044 bool AbstractDomain::isValidTagName(const std::string& name) const
273     {
274     return false;
275     }
276 gross 797
277 gross 1044 std::string AbstractDomain::showTagNames() const
278     {
279     throwStandardException("AbstractDomain::showTagNames is not implemented.");
280     return string();
281     }
282    
283 gross 1716 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
284     {
285     throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
286     return 0;
287     }
288 jfenwick 2487
289     const int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
290 gross 1716 {
291     throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
292     return NULL;
293     }
294 gross 1044
295    
296 jfenwick 1802 bool AbstractDomain::canTag(int functionspacecode) const
297     {
298     throwStandardException("AbstractDomain::canTag is not implemented.");
299     return false;
300     }
301 gross 1716
302    
303 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