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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 615 - (hide annotations)
Wed Mar 22 02:12:00 2006 UTC (13 years, 5 months ago) by elspeth
File MIME type: text/plain
File size: 4250 byte(s)
More copyright information.

1 jgs 82 /*
2 elspeth 615 ************************************************************
3     * Copyright 2006 by ACcESS MNRF *
4     * *
5     * http://www.access.edu.au *
6     * Primary Business: Queensland, Australia *
7     * Licensed under the Open Software License version 3.0 *
8     * http://www.opensource.org/licenses/osl-3.0.php *
9     * *
10     ************************************************************
11 jgs 82 */
12 jgs 115
13     #if !defined escript_FunctionSpace_20040323_H
14 jgs 82 #define escript_FunctionSpace_20040323_H
15    
16 jgs 474 #include "AbstractDomain.h"
17     #include "NullDomain.h"
18 jgs 82
19     #include <string>
20    
21     namespace escript {
22    
23 jgs 117 //
24     // Forward declaration for class Data.
25     class Data;
26 jgs 82
27     /**
28     \brief
29     Give a short description of what FunctionSpace does.
30    
31     Description:
32 jgs 117 Give a detailed description of FunctionSpace.
33 jgs 82
34     Template Parameters:
35     For templates describe any conditions that the parameters used in the
36 jgs 117 template must satisfy.
37 jgs 82 */
38    
39     class FunctionSpace {
40    
41     public:
42     /**
43     \brief
44 jgs 117 Default constructor for FunctionSpace.
45 jgs 82
46     Description:
47     Default constructor for FunctionSpace
48     Generates a function space with a null domain.
49    
50     Preconditions:
51 jgs 117 Describe any preconditions.
52 jgs 82
53     Throws:
54 jgs 117 Describe any exceptions thrown.
55 jgs 82 */
56     FunctionSpace();
57    
58     /**
59     \brief
60 jgs 117 Constructor for FunctionSpace.
61 jgs 82
62     Description:
63     Constructor for FunctionSpace.
64 jgs 115
65 jgs 82 NOTE: The FunctionSpace class relies on the domain existing
66 jgs 115 for the lifetime of the FunctionSpace object. ie: domain must
67     be an externally managed object (!).
68 jgs 82 */
69 jgs 117 FunctionSpace(const AbstractDomain& domain,
70     int functionSpaceType);
71 jgs 82
72     /**
73     \brief
74     Return the function space type code.
75     */
76 jgs 117 int
77     getTypeCode() const;
78 jgs 82
79     /**
80     \brief
81     Return the function space domain.
82     */
83 jgs 117 const
84     AbstractDomain&
85     getDomain() const;
86 jgs 82
87     /**
88     \brief
89     Assignment operator.
90 jgs 149 NOTE: Assignment copies the domain object pointer
91 jgs 82 as this object is managed externally to this class.
92     */
93 jgs 117 FunctionSpace&
94     operator=(const FunctionSpace& other);
95 jgs 82
96     /**
97     \brief
98     Return the shape of the data needed to represent the function space.
99     */
100 jgs 117 std::pair<int,int>
101     getDataShape() const;
102 jgs 82
103     /**
104     \brief
105     Comparison operator.
106     Return true if function spaces are equal.
107     ie: Same domain and same function space type.
108     */
109 jgs 117 bool
110     operator==(const FunctionSpace& other) const;
111 jgs 82
112 jgs 117 bool
113     operator!=(const FunctionSpace& other) const;
114    
115 jgs 82 /**
116     \brief
117 jgs 115 Return a text description of the function space.
118 jgs 82 */
119 jgs 117 std::string
120     toString() const;
121 jgs 82
122     /**
123     \brief
124     Return the tag associated with the given sample number.
125     */
126 jgs 117 int
127     getTagFromSampleNo(int sampleNo) const;
128 jgs 115
129 jgs 110 /**
130     \brief
131 jgs 149 Return the tag associated with the given data-point number.
132 jgs 110 */
133 jgs 117 int
134 jgs 149 getTagFromDataPointNo(int dataPointNo) const;
135    
136     /**
137     \brief
138     Return the reference number associated with the given sample number.
139     */
140     int
141 jgs 117 getReferenceNoFromSampleNo(int sampleNo) const;
142 jgs 82
143     /**
144     \brief
145 jgs 149 Return the spatial locations of the data points.
146 jgs 82 */
147 jgs 117 escript::Data
148     getX() const;
149 jgs 149
150 jgs 82 /**
151     \brief
152     Return the surface normal field.
153     */
154 jgs 117 escript::Data
155     getNormal() const;
156 jgs 82
157     /**
158     \brief
159     Return the sample size (e.g. the diameter of elements, radius of particles).
160     */
161 jgs 117 escript::Data
162     getSize() const;
163 jgs 82
164     /**
165     \brief
166 jgs 115 Return the number of samples.
167 jgs 82 */
168 jgs 117 inline
169     int
170     getNumSamples() const {
171 jgs 82 return getDataShape().second;
172     }
173    
174     /**
175     \brief
176     Return the number of data points per sample.
177     */
178 jgs 117 inline
179     int
180     getNumDPPSample() const {
181 jgs 82 return getNumDataPointsPerSample();
182     }
183 jgs 149
184 jgs 117 inline
185     int
186     getNumDataPointsPerSample() const {
187 jgs 82 return getDataShape().first;
188     }
189    
190     /**
191     \brief
192     Return the spatial dimension of the underlying domain.
193     */
194 jgs 117 inline
195     int
196     getDim() const {
197 jgs 82 return getDomain().getDim();
198     }
199 jgs 115
200 jgs 82 protected:
201    
202     private:
203    
204     //
205     // static null domain value
206     static NullDomain m_nullDomainValue;
207    
208     //
209     // function space domain
210     const AbstractDomain* m_domain;
211 jgs 149
212 jgs 82 //
213     // function space type code.
214     int m_functionSpaceType;
215    
216     };
217    
218     } // end of namespace
219 jgs 117
220 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26