/[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 82 - (hide annotations)
Tue Oct 26 06:53:54 2004 UTC (14 years, 9 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/FunctionSpace.h
File MIME type: text/plain
File size: 4221 byte(s)
Initial revision

1 jgs 82 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14    
15     #if !defined escript_FunctionSpace_20040323_H
16     #define escript_FunctionSpace_20040323_H
17    
18     #include "escript/Data/AbstractDomain.h"
19     #include "escript/Data/NullDomain.h"
20    
21     #include <string>
22    
23     namespace escript {
24    
25     class Data;
26    
27     /**
28     \brief
29     Give a short description of what FunctionSpace does.
30    
31     Description:
32     Give a detailed description of FunctionSpace
33    
34     Template Parameters:
35     For templates describe any conditions that the parameters used in the
36     template must satisfy
37     */
38    
39    
40     class FunctionSpace {
41    
42     public:
43     /**
44     \brief
45     Default constructor for FunctionSpace
46    
47     Description:
48     Default constructor for FunctionSpace
49     Generates a function space with a null domain.
50    
51     Preconditions:
52     Describe any preconditions
53    
54     Throws:
55     Describe any exceptions thrown
56     */
57     FunctionSpace();
58    
59     /**
60     \brief
61     Constructor for FunctionSpace
62    
63     Description:
64     Constructor for FunctionSpace.
65     NOTE: The FunctionSpace class relies on the domain existing
66     for the lifetime of the FunctionSpace object.
67     */
68     FunctionSpace(const AbstractDomain& domain, int functionSpaceType);
69    
70     /**
71     \brief
72     Return the function space type code.
73     */
74     int getTypeCode() const;
75    
76     /**
77     \brief
78     Return the function space domain.
79     */
80     const AbstractDomain& getDomain() const;
81    
82     /**
83     \brief
84     Assignment operator.
85     NOTE: Assignment just copies the domain object pointer
86     as this object is managed externally to this class.
87     */
88     FunctionSpace& operator=(const FunctionSpace& other);
89    
90     /**
91     \brief
92     Return the shape of the data needed to represent the function space.
93     */
94     std::pair<int,int> getDataShape() const;
95    
96     /**
97     \brief
98     Comparison operator.
99     Return true if function spaces are equal.
100     ie: Same domain and same function space type.
101     */
102     bool operator==(const FunctionSpace& other) const;
103     bool operator!=(const FunctionSpace& other) const;
104    
105     /**
106     \brief
107     Return a test description of the function space.
108     */
109     std::string toString() const;
110    
111     /**
112     \brief
113     Return the tag associated with the given sample number.
114     */
115     int getTagFromSampleNo(int sampleNo) const;
116    
117     /**
118     \brief
119     Return the location of the data points.
120     */
121     escript::Data getX() const;
122    
123     /**
124     \brief
125     Return the surface normal field.
126     */
127     escript::Data getNormal() const;
128    
129     /**
130     \brief
131     Return the sample size (e.g. the diameter of elements, radius of particles).
132     */
133     escript::Data getSize() const;
134    
135     /**
136     \brief
137     Return the number of samples:
138     */
139     inline int getNumSamples() const {
140     return getDataShape().second;
141     }
142    
143     /**
144     \brief
145     Return the number of data points per sample.
146     */
147     inline int getNumDPPSample() const {
148     return getNumDataPointsPerSample();
149     }
150     inline int getNumDataPointsPerSample() const {
151     return getDataShape().first;
152     }
153    
154     /**
155     \brief
156     Return the spatial dimension of the underlying domain.
157     */
158     inline int getDim() const {
159     return getDomain().getDim();
160     }
161    
162     protected:
163    
164     private:
165    
166     //
167     // static null domain value
168     static NullDomain m_nullDomainValue;
169    
170     //
171     // function space domain
172     const AbstractDomain* m_domain;
173     //
174    
175     // function space type code.
176     int m_functionSpaceType;
177    
178     };
179    
180     } // end of namespace
181     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26