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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (hide annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 2 months ago) by woo409
File MIME type: text/plain
File size: 8357 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26