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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (show annotations)
Mon Feb 14 04:14:42 2005 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/FunctionSpace.h
File MIME type: text/plain
File size: 4368 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 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
40 class 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 NOTE: The FunctionSpace class relies on the domain existing
66 for the lifetime of the FunctionSpace object.
67 */
68 FunctionSpace(const AbstractDomain& domain, int functionSpaceType);
69
70 /**
71 \brief
72 Return the function space type code.
73 */
74 int getTypeCode() const;
75
76 /**
77 \brief
78 Return the function space domain.
79 */
80 const AbstractDomain& getDomain() const;
81
82 /**
83 \brief
84 Assignment operator.
85 NOTE: Assignment just copies the domain object pointer
86 as this object is managed externally to this class.
87 */
88 FunctionSpace& operator=(const FunctionSpace& other);
89
90 /**
91 \brief
92 Return the shape of the data needed to represent the function space.
93 */
94 std::pair<int,int> getDataShape() const;
95
96 /**
97 \brief
98 Comparison operator.
99 Return true if function spaces are equal.
100 ie: Same domain and same function space type.
101 */
102 bool operator==(const FunctionSpace& other) const;
103 bool operator!=(const FunctionSpace& other) const;
104
105 /**
106 \brief
107 Return a test description of the function space.
108 */
109 std::string toString() const;
110
111 /**
112 \brief
113 Return the tag associated with the given sample number.
114 */
115 int getTagFromSampleNo(int sampleNo) const;
116 /**
117 \brief
118 Return the reference nomber associated with the given sample number.
119 */
120 int getReferenceNoFromSampleNo(int sampleNo) const;
121
122 /**
123 \brief
124 Return the location of the data points.
125 */
126 escript::Data getX() const;
127
128 /**
129 \brief
130 Return the surface normal field.
131 */
132 escript::Data getNormal() const;
133
134 /**
135 \brief
136 Return the sample size (e.g. the diameter of elements, radius of particles).
137 */
138 escript::Data getSize() const;
139
140 /**
141 \brief
142 Return the number of samples:
143 */
144 inline int getNumSamples() const {
145 return getDataShape().second;
146 }
147
148 /**
149 \brief
150 Return the number of data points per sample.
151 */
152 inline int getNumDPPSample() const {
153 return getNumDataPointsPerSample();
154 }
155 inline int getNumDataPointsPerSample() const {
156 return getDataShape().first;
157 }
158
159 /**
160 \brief
161 Return the spatial dimension of the underlying domain.
162 */
163 inline int getDim() const {
164 return getDomain().getDim();
165 }
166
167 protected:
168
169 private:
170
171 //
172 // static null domain value
173 static NullDomain m_nullDomainValue;
174
175 //
176 // function space domain
177 const AbstractDomain* m_domain;
178 //
179
180 // function space type code.
181 int m_functionSpaceType;
182
183 };
184
185 } // end of namespace
186 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26