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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26