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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1419 by trankine, Fri Jan 11 07:40:29 2008 UTC revision 1420 by trankine, Tue Feb 26 07:30:08 2008 UTC
# Line 40  class Data; Line 40  class Data;
40     template must satisfy.     template must satisfy.
41  */  */
42    
43  class ESCRIPT_DLL_API FunctionSpace {  class FunctionSpace {
44    
45       friend class AbstractSystemMatrix;
46       friend class AbstractTransportProblem;
47    
48   public:   public:
49    /**    /**
# Line 57  class ESCRIPT_DLL_API FunctionSpace { Line 60  class ESCRIPT_DLL_API FunctionSpace {
60       Throws:       Throws:
61       Describe any exceptions thrown.       Describe any exceptions thrown.
62    */    */
63      ESCRIPT_DLL_API
64    FunctionSpace();    FunctionSpace();
65    
66    /**    /**
# Line 70  class ESCRIPT_DLL_API FunctionSpace { Line 74  class ESCRIPT_DLL_API FunctionSpace {
74       for the lifetime of the FunctionSpace object. ie: domain must       for the lifetime of the FunctionSpace object. ie: domain must
75       be an externally managed object (!).       be an externally managed object (!).
76    */    */
77      ESCRIPT_DLL_API
78    FunctionSpace(const AbstractDomain& domain,    FunctionSpace(const AbstractDomain& domain,
79                  int functionSpaceType);                  int functionSpaceType);
80    
# Line 77  class ESCRIPT_DLL_API FunctionSpace { Line 82  class ESCRIPT_DLL_API FunctionSpace {
82      \brief      \brief
83      Return the function space type code.      Return the function space type code.
84    */    */
85      ESCRIPT_DLL_API
86    int    int
87    getTypeCode() const;    getTypeCode() const;
88    
# Line 84  class ESCRIPT_DLL_API FunctionSpace { Line 90  class ESCRIPT_DLL_API FunctionSpace {
90     \brief     \brief
91     Return the function space domain.     Return the function space domain.
92    */    */
93      ESCRIPT_DLL_API
94    const    const
95    AbstractDomain&    AbstractDomain&
96    getDomain() const;    getDomain() const;
97    
   /**  
    \brief  
    Assignment operator.  
    NOTE: Assignment copies the domain object pointer  
    as this object is managed externally to this class.  
   */  
   FunctionSpace&  
   operator=(const FunctionSpace& other);  
98    
99    
100    /**    /**
# Line 103  class ESCRIPT_DLL_API FunctionSpace { Line 102  class ESCRIPT_DLL_API FunctionSpace {
102       value of mask for any its sample point.       value of mask for any its sample point.
103    
104    */    */
105      ESCRIPT_DLL_API
106    void setTags(const int newTag, const escript::Data& mask) const;    void setTags(const int newTag, const escript::Data& mask) const;
107    
108    
# Line 110  class ESCRIPT_DLL_API FunctionSpace { Line 110  class ESCRIPT_DLL_API FunctionSpace {
110     \brief     \brief
111     Return the shape of the data needed to represent the function space.     Return the shape of the data needed to represent the function space.
112    */    */
113      ESCRIPT_DLL_API
114    std::pair<int,int>    std::pair<int,int>
115    getDataShape() const;    getDataShape() const;
116    
# Line 119  class ESCRIPT_DLL_API FunctionSpace { Line 120  class ESCRIPT_DLL_API FunctionSpace {
120     Return true if function spaces are equal.     Return true if function spaces are equal.
121     ie: Same domain and same function space type.     ie: Same domain and same function space type.
122    */    */
123      ESCRIPT_DLL_API
124    bool    bool
125    operator==(const FunctionSpace& other) const;    operator==(const FunctionSpace& other) const;
126    
127      ESCRIPT_DLL_API
128    bool    bool
129    operator!=(const FunctionSpace& other) const;    operator!=(const FunctionSpace& other) const;
130    
# Line 129  class ESCRIPT_DLL_API FunctionSpace { Line 132  class ESCRIPT_DLL_API FunctionSpace {
132     \brief     \brief
133     Return a text description of the function space.     Return a text description of the function space.
134    */    */
135    std::string    ESCRIPT_DLL_API
136      const std::string &
137    toString() const;    toString() const;
138    
139    #ifdef DEBUG
140      /**
141       \brief
142       Return a text description of the function space
143       as a python string.
144       NOTE: This code was used to debug a conversion of
145       std::string to python string problem on windows.
146       An alternative approach was sought.
147      */
148      ESCRIPT_DLL_API
149      PyObject *
150      toPyString() const;
151    #endif
152    
153    /**    /**
154     \brief     \brief
155     Return the tag associated with the given sample number.     Return the tag associated with the given sample number.
156    */    */
157      ESCRIPT_DLL_API
158    int    int
159    getTagFromSampleNo(int sampleNo) const;    getTagFromSampleNo(int sampleNo) const;
160    
# Line 143  class ESCRIPT_DLL_API FunctionSpace { Line 162  class ESCRIPT_DLL_API FunctionSpace {
162     \brief     \brief
163     Return the tag associated with the given data-point number.     Return the tag associated with the given data-point number.
164    */    */
165      ESCRIPT_DLL_API
166    int    int
167    getTagFromDataPointNo(int dataPointNo) const;    getTagFromDataPointNo(int dataPointNo) const;
168    
# Line 152  class ESCRIPT_DLL_API FunctionSpace { Line 172  class ESCRIPT_DLL_API FunctionSpace {
172     This function is not efficient. It is better to first call     This function is not efficient. It is better to first call
173     borrowSampleReferenceIDs and then when iterating over sampleNo to use sampleNo as an offset.     borrowSampleReferenceIDs and then when iterating over sampleNo to use sampleNo as an offset.
174    */    */
175      ESCRIPT_DLL_API
176    inline    inline
177    int    int
178    getReferenceIDOfSample(int sampleNo) const    getReferenceIDOfSample(int sampleNo) const
# Line 162  class ESCRIPT_DLL_API FunctionSpace { Line 183  class ESCRIPT_DLL_API FunctionSpace {
183     \brief     \brief
184     Return a borrowed reference to the list of sample reference IDs     Return a borrowed reference to the list of sample reference IDs
185    */    */
186      ESCRIPT_DLL_API
187    int*    int*
188    borrowSampleReferenceIDs() const;    borrowSampleReferenceIDs() const;
189    
# Line 169  class ESCRIPT_DLL_API FunctionSpace { Line 191  class ESCRIPT_DLL_API FunctionSpace {
191     \brief     \brief
192     Return the spatial locations of the data points.     Return the spatial locations of the data points.
193    */    */
194      ESCRIPT_DLL_API
195    escript::Data    escript::Data
196    getX() const;    getX() const;
197    
# Line 176  class ESCRIPT_DLL_API FunctionSpace { Line 199  class ESCRIPT_DLL_API FunctionSpace {
199     \brief     \brief
200     Return the surface normal field.     Return the surface normal field.
201    */    */
202      ESCRIPT_DLL_API
203    escript::Data    escript::Data
204    getNormal() const;    getNormal() const;
205    
# Line 183  class ESCRIPT_DLL_API FunctionSpace { Line 207  class ESCRIPT_DLL_API FunctionSpace {
207     \brief     \brief
208     Return the sample size (e.g. the diameter of elements, radius of particles).     Return the sample size (e.g. the diameter of elements, radius of particles).
209    */    */
210      ESCRIPT_DLL_API
211    escript::Data    escript::Data
212    getSize() const;    getSize() const;
213    
# Line 190  class ESCRIPT_DLL_API FunctionSpace { Line 215  class ESCRIPT_DLL_API FunctionSpace {
215     \brief     \brief
216     Return the number of samples.     Return the number of samples.
217    */    */
218      ESCRIPT_DLL_API
219    inline    inline
220    int    int
221    getNumSamples() const {    getNumSamples() const {
# Line 200  class ESCRIPT_DLL_API FunctionSpace { Line 226  class ESCRIPT_DLL_API FunctionSpace {
226     \brief     \brief
227     Return the number of data points per sample.     Return the number of data points per sample.
228    */    */
229      ESCRIPT_DLL_API
230    inline    inline
231    int    int
232    getNumDPPSample() const {    getNumDPPSample() const {
233       return getNumDataPointsPerSample();       return getNumDataPointsPerSample();
234    }    }
235    
236      ESCRIPT_DLL_API
237    inline    inline
238    int    int
239    getNumDataPointsPerSample() const {    getNumDataPointsPerSample() const {
# Line 216  class ESCRIPT_DLL_API FunctionSpace { Line 244  class ESCRIPT_DLL_API FunctionSpace {
244     \brief     \brief
245     Return the spatial dimension of the underlying domain.     Return the spatial dimension of the underlying domain.
246    */    */
247      ESCRIPT_DLL_API
248    inline    inline
249    int    int
250    getDim() const {    getDim() const {
# Line 225  class ESCRIPT_DLL_API FunctionSpace { Line 254  class ESCRIPT_DLL_API FunctionSpace {
254   protected:   protected:
255    
256   private:   private:
257      /**
258       \brief
259       Assignment operator.
260       NOTE: Assignment copies the domain object pointer
261       as this object is managed externally to this class.
262       NOTE Also, breaks the non-mutability of FunctionSpace
263       assumed by toString(). Allowing this would also have
264       unknown effects at the python level, and could
265       leave python with an incorrect view of the object.
266      */
267      FunctionSpace&
268      operator=(const FunctionSpace& other);
269    
270    //    //
271    // static null domain value    // static null domain value
272    static NullDomain m_nullDomainValue;    static const NullDomain nullDomainValue;
273    
274    //    //
275    // function space domain    // function space domain
# Line 238  class ESCRIPT_DLL_API FunctionSpace { Line 279  class ESCRIPT_DLL_API FunctionSpace {
279    // function space type code.    // function space type code.
280    int m_functionSpaceType;    int m_functionSpaceType;
281    
282      //
283      // return value of toString.
284      // made mutable for lazy initialisation in 1st call to toString.
285      // So, this is conceptually immutable, meaning it expects the FunctionSpace
286      // object to be immutable.
287      mutable std::string type_str;
288    
289  };  };
290    
291  } // end of namespace  } // end of namespace

Legend:
Removed from v.1419  
changed lines
  Added in v.1420

  ViewVC Help
Powered by ViewVC 1.1.26