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

Annotation of /trunk/escript/src/AbstractDomain.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 115 - (hide annotations)
Fri Mar 4 07:12:47 2005 UTC (14 years, 7 months ago) by jgs
Original Path: trunk/esys2/escript/src/Data/AbstractDomain.h
File MIME type: text/plain
File size: 8379 byte(s)
*** empty log message ***

1 jgs 102 // $Id$
2 jgs 82 /*
3     ******************************************************************************
4     * *
5     * COPYRIGHT ACcESS 2004 - All Rights Reserved *
6     * *
7     * This software is the property of ACcESS. No part of this code *
8     * may be copied in any form or by any means without the expressed written *
9     * consent of ACcESS. Copying, use or modification of this software *
10     * by any unauthorised person is illegal unless that person has a software *
11     * license agreement with ACcESS. *
12     * *
13     ******************************************************************************
14     */
15 jgs 115
16     #if !defined escript_AbstractDomain_20040609_H
17 jgs 82 #define escript_AbstractDomain_20040609_H
18 jgs 115
19 jgs 82 #include <string>
20     #include <utility>
21    
22     namespace escript {
23    
24 jgs 115 // forward declarations of certain classes which will be used
25 jgs 82 class Data;
26     class AbstractSystemMatrix;
27     class FunctionSpace;
28 jgs 115
29 jgs 82 /**
30     \brief
31     Base class for all escript domains.
32    
33     Description:
34     Base class for all escript domains.
35     */
36 jgs 115
37 jgs 82 class AbstractDomain {
38    
39     public:
40    
41     /**
42     \brief
43     Default constructor for AbstractDomain
44    
45     Description:
46     Default constructor for AbstractDomain. As the name suggests
47     this is intended to be an abstract base class but by making it
48     constructable avoid a boost.python wrapper class. A call to
49     almost any of the base class functions will throw an exception
50 jgs 115 as they are not intended to be used directly, but are overridden
51     by the underlying solver package which is linked to.
52 jgs 82
53 jgs 115 By default, this class is overridden by the class NullDomain.
54    
55 jgs 82 Preconditions:
56     Describe any preconditions
57    
58     Throws:
59     Describe any exceptions thrown
60     */
61     AbstractDomain();
62 jgs 115
63 jgs 82 /**
64     \brief
65     Destructor for AbstractDomain
66    
67     Description:
68     Destructor for AbstractDomain
69     */
70     virtual ~AbstractDomain();
71 jgs 115
72 jgs 82 /**
73     \brief
74     Returns true if the given integer is a valid function space type
75     for this domain.
76     */
77     virtual bool isValidFunctionSpaceType(int functionSpaceType) const;
78 jgs 115
79 jgs 82 /**
80     \brief
81     Return a description for this domain
82     */
83     virtual std::string getDescription() const;
84 jgs 115
85 jgs 82 /**
86     \brief
87     Return a description for the given function space type code
88     */
89     virtual std::string functionSpaceTypeAsString(int functionSpaceType) const;
90 jgs 115
91 jgs 82 /**
92     \brief
93     Throw a standard exception. This function is called if any attempt
94     is made to use a base class function.
95     */
96     void throwStandardException(const std::string& functionName) const;
97 jgs 115
98 jgs 82 /**
99     \brief
100 jgs 115 Returns the spatial dimension of the domain.
101 jgs 82 has to be implemented by the actual Domain adapter.
102     */
103     virtual int getDim() const;
104    
105     /**
106     \brief
107 jgs 115 Return true if given domains are equal.
108 jgs 82 */
109 jgs 104 bool operator==(const AbstractDomain& other) const;
110     bool operator!=(const AbstractDomain& other) const;
111 jgs 115
112 jgs 82 /**
113     \brief
114 jgs 115 Writes the doamin to an external file filename.
115     This has to be implemented by the actual Domain adapter.
116 jgs 82 */
117     virtual void write(const std::string& filename) const;
118    
119     /**
120     \brief
121 jgs 115 Sets the tagList pointer and length of tag list numTags.
122 jgs 82 */
123     virtual void getTagList(int functionSpaceType, int** tagList, int* numTags) const;
124    
125 jgs 110 /**
126     \brief
127 jgs 115 Sets the referenceNoList pointer and length of tag list numReferenceNo.
128 jgs 110 */
129     virtual void getReferenceNoList(int functionSpaceType, int** referenceNoList, int* numReferenceNo) const;
130    
131 jgs 115 /**
132 jgs 82 \brief
133     Return the number of data points per sample, and the number of samples as a pair.
134     has to be implemented by the actual Domain adapter.
135     \param functionSpaceCode Input - Code for the function space type.
136     \return pair, first - number of data points per sample, second - number of samples
137     */
138     virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
139    
140     /**
141     \brief
142     Return the tag key for the given sample number.
143     \param functionSpaceType Input - The function space type.
144     \param sampleNo Input - The sample number.
145     */
146     virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
147 jgs 115
148 jgs 82 /**
149     \brief
150 jgs 115 Return the reference number of the given sample number.
151 jgs 110 \param functionSpaceType Input - The function space type.
152     \param sampleNo Input - The sample number.
153     */
154     virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const;
155 jgs 115
156 jgs 110 /**
157     \brief
158 jgs 115 Assigns new location to the domain
159 jgs 82 has to be implemented by the actual Domain adapter.
160     */
161     virtual void setNewX(const escript::Data& arg);
162    
163     /**
164     \brief
165 jgs 115 Interpolates data given on source onto target where source and target have to be given on the same domain.
166 jgs 82 has to be implemented by the actual Domain adapter.
167     */
168     virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
169     virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
170 jgs 115
171 jgs 82 /**
172     \brief
173 jgs 115 Interpolates data given on source onto target where source and target are given on different domains.
174 jgs 82 has to be implemented by the actual Domain adapter.
175     */
176     virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
177     virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
178    
179     /**
180 jgs 115 \brief returns locations in the domain. The function space is chosen appropriately.
181 jgs 102 */
182     virtual escript::Data getX() const;
183 jgs 115
184 jgs 102 /**
185 jgs 115 \brief return boundary normals. The function space is chosen appropriately.
186 jgs 102 */
187     virtual escript::Data getNormal() const;
188 jgs 115
189 jgs 102 /**
190 jgs 115 \brief returns the local size of samples. The function space is chosen appropriately.
191 jgs 102 */
192     virtual escript::Data getSize() const;
193    
194     /**
195 jgs 82 \brief
196 jgs 115 Copies the location of data points on the domain into out.
197     The actual function space to be considered
198 jgs 82 is defined by out. out has to be defined on this.
199     has to be implemented by the actual Domain adapter.
200     */
201     virtual void setToX(escript::Data& out) const;
202 jgs 115
203 jgs 82 /**
204     \brief
205 jgs 115 Copies the surface normals at data points into out.
206     The actual function space to be considered
207 jgs 82 is defined by out. out has to be defined on this.
208     has to be implemented by the actual Domain adapter.
209     */
210     virtual void setToNormal(escript::Data& out) const;
211 jgs 115
212 jgs 82 /**
213     \brief
214 jgs 115 Copies the size of samples into out. The actual
215     function space to be considered
216 jgs 82 is defined by out. out has to be defined on this.
217     has to be implemented by the actual Domain adapter.
218     */
219     virtual void setToSize(escript::Data& out) const;
220    
221     /**
222     \brief
223 jgs 115 Copies the gradient of arg into grad. The actual function space to be considered
224 jgs 82 for the gradient is defined by grad. arg and grad have to be defined on this.
225     has to be implemented by the actual Domain adapter.
226     */
227     virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
228    
229     /**
230     \brief
231 jgs 115 Saves data arg to an OpenDX input file.
232 jgs 82 considered as cell centered data.
233     has to be implemented by the actual Domain adapter.
234     */
235     virtual void saveDX(const std::string& filename,const escript::Data& arg) const;
236 jgs 110
237 jgs 82 /**
238     \brief
239 jgs 110 saves data arg to a VTK input file.
240     considered as cell centered data.
241     has to be implemented by the actual Domain adapter.
242     */
243     virtual void saveVTK(const std::string& filename,const escript::Data& arg) const;
244    
245     /**
246     \brief
247 jgs 82 returns the function space representation of the type functionSpaceCode on this domain
248     as a vtkObject.
249     has to be implemented by the actual Domain adapter.
250     */
251     //virtual vtkObject createVtkObject(int functionSpaceCode) const;
252    
253 jgs 115 /**
254 jgs 82 \brief
255     returns true if data on this domain and a function space of type functionSpaceCode has to
256     considered as cell centered data.
257     has to be implemented by the actual Domain adapter.
258     */
259     virtual bool isCellOriented(int functionSpaceCode) const;
260    
261     protected:
262    
263     private:
264 jgs 115
265 jgs 82 };
266    
267     } // end of namespace
268     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26