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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 767 - (hide annotations)
Fri Jun 30 07:29:08 2006 UTC (13 years, 4 months ago) by gross
File MIME type: text/plain
File size: 4483 byte(s)
new FunctionSpace method setTags added
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 gross 767
98 jgs 82 /**
99 gross 767 \brief assigns new tag newTag to all samples with a positive
100     value of mask for any its sample point.
101    
102     */
103     void setTags(const int newTag, const escript::Data& mask) const;
104    
105    
106     /**
107 jgs 82 \brief
108     Return the shape of the data needed to represent the function space.
109     */
110 jgs 117 std::pair<int,int>
111     getDataShape() const;
112 jgs 82
113     /**
114     \brief
115     Comparison operator.
116     Return true if function spaces are equal.
117     ie: Same domain and same function space type.
118     */
119 jgs 117 bool
120     operator==(const FunctionSpace& other) const;
121 jgs 82
122 jgs 117 bool
123     operator!=(const FunctionSpace& other) const;
124    
125 jgs 82 /**
126     \brief
127 jgs 115 Return a text description of the function space.
128 jgs 82 */
129 jgs 117 std::string
130     toString() const;
131 jgs 82
132     /**
133     \brief
134     Return the tag associated with the given sample number.
135     */
136 jgs 117 int
137     getTagFromSampleNo(int sampleNo) const;
138 jgs 115
139 jgs 110 /**
140     \brief
141 jgs 149 Return the tag associated with the given data-point number.
142 jgs 110 */
143 jgs 117 int
144 jgs 149 getTagFromDataPointNo(int dataPointNo) const;
145    
146     /**
147     \brief
148     Return the reference number associated with the given sample number.
149     */
150     int
151 jgs 117 getReferenceNoFromSampleNo(int sampleNo) const;
152 jgs 82
153     /**
154     \brief
155 jgs 149 Return the spatial locations of the data points.
156 jgs 82 */
157 jgs 117 escript::Data
158     getX() const;
159 jgs 149
160 jgs 82 /**
161     \brief
162     Return the surface normal field.
163     */
164 jgs 117 escript::Data
165     getNormal() const;
166 jgs 82
167     /**
168     \brief
169     Return the sample size (e.g. the diameter of elements, radius of particles).
170     */
171 jgs 117 escript::Data
172     getSize() const;
173 jgs 82
174     /**
175     \brief
176 jgs 115 Return the number of samples.
177 jgs 82 */
178 jgs 117 inline
179     int
180     getNumSamples() const {
181 jgs 82 return getDataShape().second;
182     }
183    
184     /**
185     \brief
186     Return the number of data points per sample.
187     */
188 jgs 117 inline
189     int
190     getNumDPPSample() const {
191 jgs 82 return getNumDataPointsPerSample();
192     }
193 jgs 149
194 jgs 117 inline
195     int
196     getNumDataPointsPerSample() const {
197 jgs 82 return getDataShape().first;
198     }
199    
200     /**
201     \brief
202     Return the spatial dimension of the underlying domain.
203     */
204 jgs 117 inline
205     int
206     getDim() const {
207 jgs 82 return getDomain().getDim();
208     }
209 jgs 115
210 jgs 82 protected:
211    
212     private:
213    
214     //
215     // static null domain value
216     static NullDomain m_nullDomainValue;
217    
218     //
219     // function space domain
220     const AbstractDomain* m_domain;
221 jgs 149
222 jgs 82 //
223     // function space type code.
224     int m_functionSpaceType;
225    
226     };
227    
228     } // end of namespace
229 jgs 117
230 jgs 82 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26