/[escript]/branches/windows_from_1383_trunk/escript/src/FunctionSpace.h
ViewVC logotype

Annotation of /branches/windows_from_1383_trunk/escript/src/FunctionSpace.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (hide annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 2 months ago) by woo409
Original Path: trunk/escript/src/FunctionSpace.h
File MIME type: text/plain
File size: 4290 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26