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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26