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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 110 - (show annotations)
Mon Feb 14 04:14:42 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: 8306 byte(s)
*** empty log message ***

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26