/[escript]/trunk/escript/src/NullDomain.h
ViewVC logotype

Contents of /trunk/escript/src/NullDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2087 - (show annotations)
Mon Nov 24 04:51:30 2008 UTC (10 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 5658 byte(s)
Addressing mantis issue #221.
Interpolation.. and probeInterpolation.. now "work" for the NullDomain.
Work means throw a descriptive exception if you try to move into or out 
of the NullDomain.
The bad_cast exception related to this has been fixed.


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 #if !defined escript_NullDomain_20040604_H
16 #define escript_NullDomain_20040604_H
17 #include "system_dep.h"
18
19 #include "AbstractDomain.h"
20
21 #include <string>
22
23 namespace escript {
24
25 /**
26 \brief
27 NullDomain provides a null value for domain. Needed for the construction
28 of a default FunctionSpace.
29
30 Description:
31 NullDomain provides a null value for domain. Needed for the construction
32 of a default FunctionSpace. Inherits from AbstractDomain and overrides its
33 methods.
34 This domain supports a single type of FunctionSpace for which canTag is true.
35 This compromise is needed to allow the default contructor of DataTagged to
36 have a FunctionSpace which supports tagging.
37 See notes on the borrowListOfTagsInUse() method.
38 */
39
40 class NullDomain : public AbstractDomain {
41
42 public:
43
44 /**
45 \brief
46 Default constructor for NullDomain.
47
48 Description:
49 Default constructor for NullDomain.
50
51 */
52 ESCRIPT_DLL_API
53 NullDomain();
54
55 /**
56 \brief
57 Returns true if the given integer is a valid function space type
58 for this domain.
59 */
60 ESCRIPT_DLL_API
61 virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
62
63 /**
64 \brief
65 Return a description for this domain.
66 */
67 ESCRIPT_DLL_API
68 virtual std::string getDescription() const;
69
70 /**
71 \brief
72 Return a description for the given function space type code.
73 */
74 ESCRIPT_DLL_API
75 virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
76
77 /**
78 \brief
79 Interpolates data given on source onto target where source and target have to be given on the same domain.
80 NullDomain only has one FunctionSpace so this makes target a shallow copy of source.
81 */
82 ESCRIPT_DLL_API
83 virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
84 ESCRIPT_DLL_API
85 virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
86
87 /**
88 \brief
89 Interpolates data given on source onto target where source and target are given on different domains.
90 We do not permit interpolation into the NullDomain so this method always throws.
91 */
92 ESCRIPT_DLL_API
93 virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
94 ESCRIPT_DLL_API
95 virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
96
97 /**
98 \brief
99 Return a continuous FunctionSpace.
100 */
101 ESCRIPT_DLL_API
102 virtual int getContinuousFunctionCode() const;
103
104 /**
105 \brief
106 Return a function FunctionSpace.
107 */
108 ESCRIPT_DLL_API
109 virtual int getFunctionCode() const;
110
111 /**
112 \brief
113 Return a function on boundary FunctionSpace.
114 */
115 ESCRIPT_DLL_API
116 virtual int getFunctionOnBoundaryCode() const;
117
118 /**
119 \brief
120 Return a FunctionSpace.
121 */
122 ESCRIPT_DLL_API
123 virtual int getFunctionOnContactZeroCode() const;
124
125 /**
126 \brief
127 Return a FunctionSpace.
128 */
129 ESCRIPT_DLL_API
130 virtual int getFunctionOnContactOneCode() const;
131
132 /**
133 \brief
134 Return a FunctionSpace.
135 */
136 ESCRIPT_DLL_API
137 virtual int getSolutionCode() const;
138
139 /**
140 \brief
141 Return a FunctionSpace.
142 */
143 ESCRIPT_DLL_API
144 virtual int getReducedSolutionCode() const;
145
146 /**
147 \brief
148 Return a FunctionSpace.
149 */
150 ESCRIPT_DLL_API
151 virtual int getDiracDeltaFunctionCode() const;
152
153 /**
154 \brief
155 Return the number of data points per sample, and the number of samples as a pair.
156 \param functionSpaceCode Input - Code for the function space type.
157 \return pair, first - number of data points per sample, second - number of samples
158 */
159 ESCRIPT_DLL_API
160 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
161
162 /**
163 \brief
164 Return the tag key for the given sample number.
165 \param functionSpaceType Input - The function space type.
166 \param sampleNo Input - The sample number.
167 */
168 ESCRIPT_DLL_API
169 virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
170
171 /**
172 \brief
173 Return a borrowed pointer to the sample reference number id list
174 \param functionSpaceType Input - The function space type.
175 */
176 ESCRIPT_DLL_API
177 virtual int* borrowSampleReferenceIDs(int functionSpaceType) const;
178
179 /**
180 \brief
181 */
182 ESCRIPT_DLL_API
183 virtual int getDim() const;
184
185 /**
186 \brief
187 Return true if given domains are equal.
188 */
189 ESCRIPT_DLL_API
190 virtual bool operator==(const AbstractDomain& other) const;
191 ESCRIPT_DLL_API
192 virtual bool operator!=(const AbstractDomain& other) const;
193
194 /**
195 \brief Checks if this domain allows tags for the specified functionSpaceCode.
196 */
197 ESCRIPT_DLL_API
198 virtual
199 bool canTag(int functionSpaceCode) const;
200
201 /**
202 \brief
203 return the number of tags in use.
204 For this class the answer is always 1(the default tag).
205 */
206 ESCRIPT_DLL_API
207 virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
208
209 /**
210 \brief returns a pointer to an array with the tags used.
211 For this class the answer will always be {0}
212 */
213 ESCRIPT_DLL_API
214 virtual int* borrowListOfTagsInUse(int functionSpaceCode) const;
215
216 protected:
217
218 private:
219
220 };
221
222 } // end of namespace
223
224 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26