/[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 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 10 months ago) by ksteube
Original Path: trunk/escript/src/FunctionSpace.h
File MIME type: text/plain
File size: 4710 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26