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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1802 - (hide 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 jgs 115
2 ksteube 1312 /* $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 jgs 115 #if !defined escript_NullDomain_20040604_H
17 jgs 82 #define escript_NullDomain_20040604_H
18 woo409 757 #include "system_dep.h"
19 jgs 82
20 jgs 474 #include "AbstractDomain.h"
21 jgs 82
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 jgs 115 of a default FunctionSpace. Inherits from AbstractDomain and overrides its
34     methods.
35 jfenwick 1802 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 jgs 82 */
40 jgs 115
41 jgs 82 class NullDomain : public AbstractDomain {
42    
43     public:
44    
45     /**
46     \brief
47 jgs 117 Default constructor for NullDomain.
48 jgs 82
49     Description:
50 jgs 117 Default constructor for NullDomain.
51 jgs 82
52     */
53 woo409 757 ESCRIPT_DLL_API
54 jgs 82 NullDomain();
55 jgs 115
56 jgs 82 /**
57     \brief
58     Returns true if the given integer is a valid function space type
59     for this domain.
60     */
61 woo409 757 ESCRIPT_DLL_API
62 jgs 82 virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
63 jgs 115
64 jgs 82 /**
65     \brief
66 jgs 117 Return a description for this domain.
67 jgs 82 */
68 woo409 757 ESCRIPT_DLL_API
69 jgs 82 virtual std::string getDescription() const;
70 jgs 115
71 jgs 82 /**
72     \brief
73 jgs 117 Return a continuous FunctionSpace.
74 jgs 82 */
75 woo409 757 ESCRIPT_DLL_API
76 jgs 82 virtual int getContinuousFunctionCode() const;
77 jgs 115
78 jgs 82 /**
79     \brief
80 jgs 117 Return a function FunctionSpace.
81 jgs 82 */
82 woo409 757 ESCRIPT_DLL_API
83 jgs 82 virtual int getFunctionCode() const;
84 jgs 115
85 jgs 82 /**
86     \brief
87 jgs 117 Return a function on boundary FunctionSpace.
88 jgs 82 */
89 woo409 757 ESCRIPT_DLL_API
90 jgs 82 virtual int getFunctionOnBoundaryCode() const;
91 jgs 115
92 jgs 82 /**
93     \brief
94 jgs 117 Return a FunctionSpace.
95 jgs 82 */
96 woo409 757 ESCRIPT_DLL_API
97 jgs 82 virtual int getFunctionOnContactZeroCode() const;
98 jgs 115
99 jgs 82 /**
100     \brief
101 jgs 117 Return a FunctionSpace.
102 jgs 82 */
103 woo409 757 ESCRIPT_DLL_API
104 jgs 82 virtual int getFunctionOnContactOneCode() const;
105 jgs 115
106 jgs 82 /**
107     \brief
108 jgs 117 Return a FunctionSpace.
109 jgs 82 */
110 woo409 757 ESCRIPT_DLL_API
111 jgs 82 virtual int getSolutionCode() const;
112 jgs 115
113 jgs 82 /**
114     \brief
115 jgs 117 Return a FunctionSpace.
116 jgs 82 */
117 woo409 757 ESCRIPT_DLL_API
118 jgs 82 virtual int getReducedSolutionCode() const;
119 jgs 115
120 jgs 82 /**
121     \brief
122 jgs 117 Return a FunctionSpace.
123 jgs 82 */
124 woo409 757 ESCRIPT_DLL_API
125 jgs 82 virtual int getDiracDeltaFunctionCode() const;
126 jgs 115
127     /**
128 jgs 82 \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 woo409 757 ESCRIPT_DLL_API
134 jgs 82 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
135 jgs 115
136 jgs 82 /**
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 woo409 757 ESCRIPT_DLL_API
143 jgs 82 virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
144 jgs 115
145 jgs 82 /**
146     \brief
147 gross 964 Return a borrowed pointer to the sample reference number id list
148 jgs 110 \param functionSpaceType Input - The function space type.
149 jgs 82 */
150 woo409 757 ESCRIPT_DLL_API
151 gross 964 virtual int* borrowSampleReferenceIDs(int functionSpaceType) const;
152 jgs 115
153 jgs 110 /**
154     \brief
155     */
156 woo409 757 ESCRIPT_DLL_API
157 jgs 82 virtual int getDim() const;
158 jgs 115
159 jgs 121 /**
160     \brief
161     Return true if given domains are equal.
162     */
163 woo409 757 ESCRIPT_DLL_API
164 jgs 121 virtual bool operator==(const AbstractDomain& other) const;
165 woo409 757 ESCRIPT_DLL_API
166 jgs 121 virtual bool operator!=(const AbstractDomain& other) const;
167    
168 jfenwick 1802 /**
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 jgs 82 protected:
191    
192     private:
193 jfenwick 1802
194 jgs 82 };
195    
196     } // end of namespace
197 jgs 117
198 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26