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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 117 - (show annotations)
Fri Apr 1 05:48:57 2005 UTC (14 years, 4 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/FunctionSpace.h
File MIME type: text/plain
File size: 4455 byte(s)
*** empty log message ***

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 just 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 reference nomber associated with the given sample number.
134 */
135 int
136 getReferenceNoFromSampleNo(int sampleNo) const;
137
138 /**
139 \brief
140 Return the location of the data points.
141 */
142 escript::Data
143 getX() const;
144
145 /**
146 \brief
147 Return the surface normal field.
148 */
149 escript::Data
150 getNormal() const;
151
152 /**
153 \brief
154 Return the sample size (e.g. the diameter of elements, radius of particles).
155 */
156 escript::Data
157 getSize() const;
158
159 /**
160 \brief
161 Return the number of samples.
162 */
163 inline
164 int
165 getNumSamples() const {
166 return getDataShape().second;
167 }
168
169 /**
170 \brief
171 Return the number of data points per sample.
172 */
173 inline
174 int
175 getNumDPPSample() const {
176 return getNumDataPointsPerSample();
177 }
178 inline
179 int
180 getNumDataPointsPerSample() const {
181 return getDataShape().first;
182 }
183
184 /**
185 \brief
186 Return the spatial dimension of the underlying domain.
187 */
188 inline
189 int
190 getDim() const {
191 return getDomain().getDim();
192 }
193
194 protected:
195
196 private:
197
198 //
199 // static null domain value
200 static NullDomain m_nullDomainValue;
201
202 //
203 // function space domain
204 const AbstractDomain* m_domain;
205 //
206
207 // function space type code.
208 int m_functionSpaceType;
209
210 };
211
212 } // end of namespace
213
214 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26