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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1802 - (show annotations)
Tue Sep 23 01:03:29 2008 UTC (11 years, 6 months ago) by jfenwick
File MIME type: text/plain
File size: 4557 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
2 /* $Id$ */
3
4 /*******************************************************
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 #if !defined escript_NullDomain_20040604_H
17 #define escript_NullDomain_20040604_H
18 #include "system_dep.h"
19
20 #include "AbstractDomain.h"
21
22 #include <string>
23
24 namespace escript {
25
26 /**
27 \brief
28 NullDomain provides a null value for domain. Needed for the construction
29 of a default FunctionSpace.
30
31 Description:
32 NullDomain provides a null value for domain. Needed for the construction
33 of a default FunctionSpace. Inherits from AbstractDomain and overrides its
34 methods.
35 This domain supports a single type of FunctionSpace for which canTag is true.
36 This compromise is needed to allow the default contructor of DataTagged to
37 have a FunctionSpace which supports tagging.
38 See notes on the borrowListOfTagsInUse() method.
39 */
40
41 class NullDomain : public AbstractDomain {
42
43 public:
44
45 /**
46 \brief
47 Default constructor for NullDomain.
48
49 Description:
50 Default constructor for NullDomain.
51
52 */
53 ESCRIPT_DLL_API
54 NullDomain();
55
56 /**
57 \brief
58 Returns true if the given integer is a valid function space type
59 for this domain.
60 */
61 ESCRIPT_DLL_API
62 virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
63
64 /**
65 \brief
66 Return a description for this domain.
67 */
68 ESCRIPT_DLL_API
69 virtual std::string getDescription() const;
70
71 /**
72 \brief
73 Return a continuous FunctionSpace.
74 */
75 ESCRIPT_DLL_API
76 virtual int getContinuousFunctionCode() const;
77
78 /**
79 \brief
80 Return a function FunctionSpace.
81 */
82 ESCRIPT_DLL_API
83 virtual int getFunctionCode() const;
84
85 /**
86 \brief
87 Return a function on boundary FunctionSpace.
88 */
89 ESCRIPT_DLL_API
90 virtual int getFunctionOnBoundaryCode() const;
91
92 /**
93 \brief
94 Return a FunctionSpace.
95 */
96 ESCRIPT_DLL_API
97 virtual int getFunctionOnContactZeroCode() const;
98
99 /**
100 \brief
101 Return a FunctionSpace.
102 */
103 ESCRIPT_DLL_API
104 virtual int getFunctionOnContactOneCode() const;
105
106 /**
107 \brief
108 Return a FunctionSpace.
109 */
110 ESCRIPT_DLL_API
111 virtual int getSolutionCode() const;
112
113 /**
114 \brief
115 Return a FunctionSpace.
116 */
117 ESCRIPT_DLL_API
118 virtual int getReducedSolutionCode() const;
119
120 /**
121 \brief
122 Return a FunctionSpace.
123 */
124 ESCRIPT_DLL_API
125 virtual int getDiracDeltaFunctionCode() const;
126
127 /**
128 \brief
129 Return the number of data points per sample, and the number of samples as a pair.
130 \param functionSpaceCode Input - Code for the function space type.
131 \return pair, first - number of data points per sample, second - number of samples
132 */
133 ESCRIPT_DLL_API
134 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
135
136 /**
137 \brief
138 Return the tag key for the given sample number.
139 \param functionSpaceType Input - The function space type.
140 \param sampleNo Input - The sample number.
141 */
142 ESCRIPT_DLL_API
143 virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
144
145 /**
146 \brief
147 Return a borrowed pointer to the sample reference number id list
148 \param functionSpaceType Input - The function space type.
149 */
150 ESCRIPT_DLL_API
151 virtual int* borrowSampleReferenceIDs(int functionSpaceType) const;
152
153 /**
154 \brief
155 */
156 ESCRIPT_DLL_API
157 virtual int getDim() const;
158
159 /**
160 \brief
161 Return true if given domains are equal.
162 */
163 ESCRIPT_DLL_API
164 virtual bool operator==(const AbstractDomain& other) const;
165 ESCRIPT_DLL_API
166 virtual bool operator!=(const AbstractDomain& other) const;
167
168 /**
169 \brief Checks if this domain allows tags for the specified functionSpaceCode.
170 */
171 ESCRIPT_DLL_API
172 virtual
173 bool canTag(int functionSpaceCode) const;
174
175 /**
176 \brief
177 return the number of tags in use.
178 For this class the answer is always 1(the default tag).
179 */
180 ESCRIPT_DLL_API
181 virtual int getNumberOfTagsInUse(int functionSpaceCode) const;
182
183 /**
184 \brief returns a pointer to an array with the tags used.
185 For this class the answer will always be {0}
186 */
187 ESCRIPT_DLL_API
188 virtual int* borrowListOfTagsInUse(int functionSpaceCode) const;
189
190 protected:
191
192 private:
193
194 };
195
196 } // end of namespace
197
198 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26