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

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

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

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

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

  ViewVC Help
Powered by ViewVC 1.1.26