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

Diff of /trunk/esys2/escript/src/Data/FunctionSpace.h

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

revision 115 by jgs, Fri Mar 4 07:12:47 2005 UTC revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 22  Line 22 
22    
23  namespace escript {  namespace escript {
24    
25    class Data;  //
26    // Forward declaration for class Data.
27    class Data;
28    
29  /**  /**
30     \brief     \brief
31     Give a short description of what FunctionSpace does.     Give a short description of what FunctionSpace does.
32    
33     Description:     Description:
34     Give a detailed description of FunctionSpace     Give a detailed description of FunctionSpace.
35    
36     Template Parameters:     Template Parameters:
37     For templates describe any conditions that the parameters used in the     For templates describe any conditions that the parameters used in the
38     template must satisfy     template must satisfy.
39  */  */
40    
41  class FunctionSpace {  class FunctionSpace {
# Line 41  class FunctionSpace { Line 43  class FunctionSpace {
43   public:   public:
44    /**    /**
45       \brief       \brief
46       Default constructor for FunctionSpace       Default constructor for FunctionSpace.
47    
48       Description:       Description:
49       Default constructor for FunctionSpace       Default constructor for FunctionSpace
50       Generates a function space with a null domain.       Generates a function space with a null domain.
51    
52       Preconditions:       Preconditions:
53       Describe any preconditions       Describe any preconditions.
54    
55       Throws:       Throws:
56       Describe any exceptions thrown       Describe any exceptions thrown.
57    */    */
58    FunctionSpace();    FunctionSpace();
59    
60    /**    /**
61       \brief       \brief
62       Constructor for FunctionSpace       Constructor for FunctionSpace.
63    
64       Description:       Description:
65       Constructor for FunctionSpace.       Constructor for FunctionSpace.
# Line 66  class FunctionSpace { Line 68  class FunctionSpace {
68       for the lifetime of the FunctionSpace object. ie: domain must       for the lifetime of the FunctionSpace object. ie: domain must
69       be an externally managed object (!).       be an externally managed object (!).
70    */    */
71    FunctionSpace(const AbstractDomain& domain, int functionSpaceType);    FunctionSpace(const AbstractDomain& domain,
72                    int functionSpaceType);
73    
74    /**    /**
75      \brief      \brief
76      Return the function space type code.      Return the function space type code.
77    */    */
78    int getTypeCode() const;    int
79      getTypeCode() const;
80    
81    /**    /**
82     \brief     \brief
83     Return the function space domain.     Return the function space domain.
84    */    */
85    const AbstractDomain& getDomain() const;    const
86      AbstractDomain&
87      getDomain() const;
88    
89    /**    /**
90     \brief     \brief
91     Assignment operator.     Assignment operator.
92     NOTE: Assignment just copies the domain object pointer     NOTE: Assignment copies the domain object pointer
93     as this object is managed externally to this class.     as this object is managed externally to this class.
94    */    */
95    FunctionSpace& operator=(const FunctionSpace& other);    FunctionSpace&
96      operator=(const FunctionSpace& other);
97    
98    /**    /**
99     \brief     \brief
100     Return the shape of the data needed to represent the function space.     Return the shape of the data needed to represent the function space.
101    */    */
102    std::pair<int,int> getDataShape() const;    std::pair<int,int>
103      getDataShape() const;
104    
105    /**    /**
106     \brief     \brief
# Line 100  class FunctionSpace { Line 108  class FunctionSpace {
108     Return true if function spaces are equal.     Return true if function spaces are equal.
109     ie: Same domain and same function space type.     ie: Same domain and same function space type.
110    */    */
111    bool operator==(const FunctionSpace& other) const;    bool
112    bool operator!=(const FunctionSpace& other) const;    operator==(const FunctionSpace& other) const;
113    
114      bool
115      operator!=(const FunctionSpace& other) const;
116    
117    /**    /**
118     \brief     \brief
119     Return a text description of the function space.     Return a text description of the function space.
120    */    */
121    std::string toString() const;    std::string
122      toString() const;
123    
124    /**    /**
125     \brief     \brief
126     Return the tag associated with the given sample number.     Return the tag associated with the given sample number.
127    */    */
128    int getTagFromSampleNo(int sampleNo) const;    int
129      getTagFromSampleNo(int sampleNo) const;
130    
131    /**    /**
132     \brief     \brief
133     Return the reference nomber associated with the given sample number.     Return the tag associated with the given data-point number.
134    */    */
135    int getReferenceNoFromSampleNo(int sampleNo) const;    int
136      getTagFromDataPointNo(int dataPointNo) const;
137    
138    /**    /**
139     \brief     \brief
140     Return the location of the data points.     Return the reference number associated with the given sample number.
141    */    */
142    escript::Data getX() const;    int
143        getReferenceNoFromSampleNo(int sampleNo) const;
144    
145      /**
146       \brief
147       Return the spatial locations of the data points.
148      */
149      escript::Data
150      getX() const;
151    
152    /**    /**
153     \brief     \brief
154     Return the surface normal field.     Return the surface normal field.
155    */    */
156    escript::Data getNormal() const;    escript::Data
157      getNormal() const;
158    
159    /**    /**
160     \brief     \brief
161     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).
162    */    */
163    escript::Data getSize() const;    escript::Data
164      getSize() const;
165    
166    /**    /**
167     \brief     \brief
168     Return the number of samples.     Return the number of samples.
169    */    */
170    inline int getNumSamples() const {    inline
171      int
172      getNumSamples() const {
173       return getDataShape().second;       return getDataShape().second;
174    }    }
175    
# Line 151  class FunctionSpace { Line 177  class FunctionSpace {
177     \brief     \brief
178     Return the number of data points per sample.     Return the number of data points per sample.
179    */    */
180    inline int getNumDPPSample() const {    inline
181      int
182      getNumDPPSample() const {
183       return getNumDataPointsPerSample();       return getNumDataPointsPerSample();
184    }    }
185    inline int getNumDataPointsPerSample() const {  
186      inline
187      int
188      getNumDataPointsPerSample() const {
189       return getDataShape().first;       return getDataShape().first;
190    }    }
191    
# Line 162  class FunctionSpace { Line 193  class FunctionSpace {
193     \brief     \brief
194     Return the spatial dimension of the underlying domain.     Return the spatial dimension of the underlying domain.
195    */    */
196    inline int getDim() const {    inline
197      int
198      getDim() const {
199        return getDomain().getDim();        return getDomain().getDim();
200    }    }
201    
# Line 177  class FunctionSpace { Line 210  class FunctionSpace {
210    //    //
211    // function space domain    // function space domain
212    const AbstractDomain*  m_domain;    const AbstractDomain*  m_domain;
   //  
213    
214      //
215    // function space type code.    // function space type code.
216    int m_functionSpaceType;    int m_functionSpaceType;
217    
218  };  };
219    
220  } // end of namespace  } // end of namespace
221    
222  #endif  #endif

Legend:
Removed from v.115  
changed lines
  Added in v.149

  ViewVC Help
Powered by ViewVC 1.1.26