/[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 1312 - (hide annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 10 months ago) by ksteube
Original Path: trunk/escript/src/FunctionSpace.h
File MIME type: text/plain
File size: 4710 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26