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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1802 - (hide annotations)
Tue Sep 23 01:03:29 2008 UTC (11 years, 1 month ago) by jfenwick
File size: 6257 byte(s)
Added canTag methods to FunctionSpace and AbstractDomain (and its 
offspring).
This checks to see if the domain supports tags for the given type of 
function space.

Constructors for DataTagged now throw exceptions if you attempt to make 
a DataTagged with a FunctionSpace which does not support tags.
To allow the default constructor to work, NullDomain has a single 
functioncode which "supports" tagging.

Fixed a bug in DataTagged::toString and DataTypes::pointToString.

Added FunctionSpace::getListOfTagsSTL.

algorithm(DataTagged, BinaryFunction) in DataAlgorithm now only 
processes tags known to be in use.
This fixes mantis issue #0000186.

Added comment to Data.h intro warning about holding references if the 
underlying DataAbstract changes.

_python_ unit tests have been updated to test TaggedData with invalid 
FunctionSpaces and to give the correct answers to Lsup etc.


1 ksteube 1312
2 jgs 102 /* $Id$ */
3 jgs 82
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16 jgs 474 #include "AbstractDomain.h"
17     #include "DomainException.h"
18 jgs 480 #include "Data.h"
19 ksteube 1800 #include "paso/Paso_MPI.h"
20 jgs 480
21 jgs 121 using namespace std;
22 jgs 149
23 jgs 82 namespace escript {
24    
25     AbstractDomain::AbstractDomain() {
26     }
27    
28     AbstractDomain::~AbstractDomain() {
29     }
30    
31 ksteube 1312 int AbstractDomain::getMPISize() const
32     {
33     return 1;
34     }
35     int AbstractDomain::getMPIRank() const
36     {
37     return 0;
38     }
39    
40    
41 jgs 82 void AbstractDomain::throwStandardException(const std::string& functionName) const
42     {
43 jgs 115 throw DomainException("Error - Base class function: " + functionName + " should not be called. Programming error.");
44 jgs 82 }
45    
46     bool AbstractDomain::isValidFunctionSpaceType(int functionSpaceType) const
47     {
48     throwStandardException("AbstractDomain::isValidFunctionSpaceType");
49     return false;
50     }
51    
52     std::string AbstractDomain::getDescription() const
53     {
54     throwStandardException("AbstractDomain::getDescription");
55     return "";
56     }
57    
58     std::string AbstractDomain::functionSpaceTypeAsString(int functionSpaceType) const
59     {
60     throwStandardException("AbstractDomain::functionSpaceTypeAsString");
61     return "";
62     }
63    
64     int AbstractDomain::getDim() const
65     {
66     throwStandardException("AbstractDomain::getDim");
67     return 0;
68     }
69    
70     void AbstractDomain::write(const std::string& filename) const
71     {
72     throwStandardException("AbstractDomain::write");
73     return;
74     }
75 ksteube 1312 void AbstractDomain::dump(const std::string& filename) const
76     {
77     throwStandardException("AbstractDomain::dump");
78     return;
79     }
80 jgs 82
81     std::pair<int,int> AbstractDomain::getDataShape(int functionSpaceCode) const
82     {
83     throwStandardException("AbstractDomain::getDataShape");
84     return std::pair<int,int>(0,0);
85     }
86    
87     int AbstractDomain::getTagFromSampleNo(int functionSpaceType, int sampleNo) const
88     {
89     throwStandardException("AbstractDomain::getTagFromSampleNo");
90     return 0;
91     }
92    
93 gross 964 int* AbstractDomain::borrowSampleReferenceIDs(int functionSpaceType) const
94 jgs 110 {
95 gross 964 throwStandardException("AbstractDomain::borrowSampleReferenceIDs");
96 jgs 110 return 0;
97     }
98    
99 jgs 82 void AbstractDomain::setNewX(const escript::Data& arg)
100     {
101     throwStandardException("AbstractDomain::setNewX");
102     return;
103     }
104    
105     void AbstractDomain::interpolateOnDomain(escript::Data& target,const escript::Data& source) const
106     {
107     throwStandardException("AbstractDomain::interpolateOnDomain");
108     return;
109     }
110     void AbstractDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
111     {
112     throwStandardException("AbstractDomain::interpolateACross");
113     return;
114     }
115    
116 jgs 102 escript::Data AbstractDomain::getX() const
117     {
118     throwStandardException("AbstractDomain::getX");
119     return Data();
120     }
121    
122     escript::Data AbstractDomain::getNormal() const
123     {
124     throwStandardException("AbstractDomain::getNormal");
125     return Data();
126     }
127 jgs 115
128 jgs 102 escript::Data AbstractDomain::getSize() const
129     {
130     throwStandardException("AbstractDomain::getSize");
131     return Data();
132     }
133 jgs 115
134 jgs 82 void AbstractDomain::setToX(escript::Data& out) const
135     {
136     throwStandardException("AbstractDomain::setToX");
137     return;
138     }
139    
140     void AbstractDomain::setToNormal(escript::Data& out) const
141     {
142     throwStandardException("AbstractDomain::setToNormal");
143     return;
144     }
145 jgs 115
146 jgs 82 void AbstractDomain::setToSize(escript::Data& out) const
147     {
148     throwStandardException("AbstractDomain::setToSize");
149     return;
150     }
151    
152     void AbstractDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
153     {
154     throwStandardException("AbstractDomain::setToGradient");
155     return;
156     }
157    
158 gross 767 void AbstractDomain::setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const
159     {
160     throwStandardException("AbstractDomain::setTags");
161     return;
162     }
163    
164 jgs 153 void AbstractDomain::saveDX(const std::string& filename,const boost::python::dict& arg) const
165 jgs 82 {
166     throwStandardException("AbstractDomain::saveDX");
167     return;
168     }
169    
170 jgs 153 void AbstractDomain::saveVTK(const std::string& filename,const boost::python::dict& arg) const
171 jgs 110 {
172     throwStandardException("AbstractDomain::saveVTK");
173     return;
174     }
175    
176 jgs 82 bool AbstractDomain::probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const
177     {
178     throwStandardException("AbstractDomain::probeInterpolationOnDomain");
179     return false;
180     }
181    
182     bool AbstractDomain::probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const
183     {
184     throwStandardException("AbstractDomain::probeInterpolationACross");
185     return false;
186     }
187    
188     bool AbstractDomain::isCellOriented(int functionSpaceCode) const
189     {
190     throwStandardException("AbstractDomain::isCellOriented");
191     return false;
192     }
193    
194     bool AbstractDomain::operator==(const AbstractDomain& other) const
195     {
196 jgs 121 throwStandardException("AbstractDomain::operator==");
197     return false;
198 jgs 82 }
199     bool AbstractDomain::operator!=(const AbstractDomain& other) const
200     {
201 jgs 121 throwStandardException("AbstractDomain::operator!=");
202     return false;
203 jgs 82 }
204    
205 gross 797 AbstractDomain::StatusType AbstractDomain::getStatus() const
206     {
207     throwStandardException("AbstractDomain::getStatus");
208     return 0;
209     }
210 gross 1044 void AbstractDomain::setTagMap(const std::string& name, int tag)
211     {
212     throwStandardException("AbstractDomain::set TagMap is not implemented.");
213     }
214     int AbstractDomain::getTag(const std::string& name) const
215     {
216     throwStandardException("AbstractDomain::getTag is not implemented.");
217     return 0;
218     }
219 gross 797
220 gross 1044 bool AbstractDomain::isValidTagName(const std::string& name) const
221     {
222     return false;
223     }
224 gross 797
225 gross 1044 std::string AbstractDomain::showTagNames() const
226     {
227     throwStandardException("AbstractDomain::showTagNames is not implemented.");
228     return string();
229     }
230    
231 gross 1716 int AbstractDomain::getNumberOfTagsInUse(int functionSpaceCode) const
232     {
233     throwStandardException("AbstractDomain::getNumberOfTagsInUse is not implemented.");
234     return 0;
235     }
236     int* AbstractDomain::borrowListOfTagsInUse(int functionSpaceCode) const
237     {
238     throwStandardException("AbstractDomain::borrowListOfTagsInUse is not implemented.");
239     return NULL;
240     }
241 gross 1044
242    
243 jfenwick 1802 bool AbstractDomain::canTag(int functionspacecode) const
244     {
245     throwStandardException("AbstractDomain::canTag is not implemented.");
246     return false;
247     }
248 gross 1716
249    
250    
251 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