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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (show annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 4 months ago) by woo409
File MIME type: text/plain
File size: 4290 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26