/[escript]/branches/windows_from_1383_trunk/escript/src/FunctionSpace.h
ViewVC logotype

Contents of /branches/windows_from_1383_trunk/escript/src/FunctionSpace.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 9 months ago) by jgs
Original Path: trunk/escript/src/Data/FunctionSpace.h
File MIME type: text/plain
File size: 4598 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26