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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 117 - (hide 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 jgs 82 /*
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 jgs 115
15     #if !defined escript_FunctionSpace_20040323_H
16 jgs 82 #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 jgs 117 //
26     // Forward declaration for class Data.
27     class Data;
28 jgs 82
29     /**
30     \brief
31     Give a short description of what FunctionSpace does.
32    
33     Description:
34 jgs 117 Give a detailed description of FunctionSpace.
35 jgs 82
36     Template Parameters:
37     For templates describe any conditions that the parameters used in the
38 jgs 117 template must satisfy.
39 jgs 82 */
40    
41     class FunctionSpace {
42    
43     public:
44     /**
45     \brief
46 jgs 117 Default constructor for FunctionSpace.
47 jgs 82
48     Description:
49     Default constructor for FunctionSpace
50     Generates a function space with a null domain.
51    
52     Preconditions:
53 jgs 117 Describe any preconditions.
54 jgs 82
55     Throws:
56 jgs 117 Describe any exceptions thrown.
57 jgs 82 */
58     FunctionSpace();
59    
60     /**
61     \brief
62 jgs 117 Constructor for FunctionSpace.
63 jgs 82
64     Description:
65     Constructor for FunctionSpace.
66 jgs 115
67 jgs 82 NOTE: The FunctionSpace class relies on the domain existing
68 jgs 115 for the lifetime of the FunctionSpace object. ie: domain must
69     be an externally managed object (!).
70 jgs 82 */
71 jgs 117 FunctionSpace(const AbstractDomain& domain,
72     int functionSpaceType);
73 jgs 82
74     /**
75     \brief
76     Return the function space type code.
77     */
78 jgs 117 int
79     getTypeCode() const;
80 jgs 82
81     /**
82     \brief
83     Return the function space domain.
84     */
85 jgs 117 const
86     AbstractDomain&
87     getDomain() const;
88 jgs 82
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 jgs 117 FunctionSpace&
96     operator=(const FunctionSpace& other);
97 jgs 82
98     /**
99     \brief
100     Return the shape of the data needed to represent the function space.
101     */
102 jgs 117 std::pair<int,int>
103     getDataShape() const;
104 jgs 82
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 jgs 117 bool
112     operator==(const FunctionSpace& other) const;
113 jgs 82
114 jgs 117 bool
115     operator!=(const FunctionSpace& other) const;
116    
117 jgs 82 /**
118     \brief
119 jgs 115 Return a text description of the function space.
120 jgs 82 */
121 jgs 117 std::string
122     toString() const;
123 jgs 82
124     /**
125     \brief
126     Return the tag associated with the given sample number.
127     */
128 jgs 117 int
129     getTagFromSampleNo(int sampleNo) const;
130 jgs 115
131 jgs 110 /**
132     \brief
133     Return the reference nomber associated with the given sample number.
134     */
135 jgs 117 int
136     getReferenceNoFromSampleNo(int sampleNo) const;
137 jgs 82
138     /**
139     \brief
140     Return the location of the data points.
141     */
142 jgs 117 escript::Data
143     getX() const;
144 jgs 82
145     /**
146     \brief
147     Return the surface normal field.
148     */
149 jgs 117 escript::Data
150     getNormal() const;
151 jgs 82
152     /**
153     \brief
154     Return the sample size (e.g. the diameter of elements, radius of particles).
155     */
156 jgs 117 escript::Data
157     getSize() const;
158 jgs 82
159     /**
160     \brief
161 jgs 115 Return the number of samples.
162 jgs 82 */
163 jgs 117 inline
164     int
165     getNumSamples() const {
166 jgs 82 return getDataShape().second;
167     }
168    
169     /**
170     \brief
171     Return the number of data points per sample.
172     */
173 jgs 117 inline
174     int
175     getNumDPPSample() const {
176 jgs 82 return getNumDataPointsPerSample();
177     }
178 jgs 117 inline
179     int
180     getNumDataPointsPerSample() const {
181 jgs 82 return getDataShape().first;
182     }
183    
184     /**
185     \brief
186     Return the spatial dimension of the underlying domain.
187     */
188 jgs 117 inline
189     int
190     getDim() const {
191 jgs 82 return getDomain().getDim();
192     }
193 jgs 115
194 jgs 82 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 jgs 117
214 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26