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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 104 - (show annotations)
Fri Dec 17 07:43:12 2004 UTC (14 years, 4 months ago) by jgs
File MIME type: text/plain
File size: 7720 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 *tagList may be null in which case on tags are used for functionSpaceType on the Domain.
110 has to be implemented by the actual Domain adapter.
111 */
112 virtual void getTagList(int functionSpaceType, int** tagList, int* numTags) const;
113
114 /**
115 \brief
116 Return the number of data points per sample, and the number of samples as a pair.
117 has to be implemented by the actual Domain adapter.
118 \param functionSpaceCode Input - Code for the function space type.
119 \return pair, first - number of data points per sample, second - number of samples
120 */
121 virtual std::pair<int,int> getDataShape(int functionSpaceCode) const;
122
123 /**
124 \brief
125 Return the tag key for the given sample number.
126 \param functionSpaceType Input - The function space type.
127 \param sampleNo Input - The sample number.
128 */
129 virtual int getTagFromSampleNo(int functionSpaceType, int sampleNo) const;
130 /**
131 \brief
132 assigns new location to the domain
133 has to be implemented by the actual Domain adapter.
134 */
135 virtual void setNewX(const escript::Data& arg);
136
137 /**
138 \brief
139 interpolates data given on source onto target where source and target have to be given on the same domain.
140 has to be implemented by the actual Domain adapter.
141 */
142 virtual void interpolateOnDomain(escript::Data& target,const escript::Data& source) const;
143 virtual bool probeInterpolationOnDomain(int functionSpaceType_source,int functionSpaceType_target) const;
144 /**
145 \brief
146 interpolates data given on source onto target where source and target are given on different domains.
147 has to be implemented by the actual Domain adapter.
148 */
149 virtual void interpolateACross(escript::Data& target, const escript::Data& source) const;
150 virtual bool probeInterpolationACross(int functionSpaceType_source,const AbstractDomain& targetDomain, int functionSpaceType_target) const;
151
152 /**
153 \brief returns locations in the domain. The function space is chosen appropriatly.
154 */
155 virtual escript::Data getX() const;
156 /**
157 \brief return boundary normals. The function space is chosen appropriatly.
158 */
159 virtual escript::Data getNormal() const;
160 /**
161 \brief returns the local size od samples. The function space is chosen appropriatly.
162 */
163 virtual escript::Data getSize() const;
164
165 /**
166 \brief
167 copies the location of data points on the domain into out. The actual function space to be considered
168 is defined by out. out has to be defined on this.
169 has to be implemented by the actual Domain adapter.
170 */
171 virtual void setToX(escript::Data& out) const;
172 /**
173 \brief
174 copies the surface normals at data points into out. The actual function space to be considered
175 is defined by out. out has to be defined on this.
176 has to be implemented by the actual Domain adapter.
177 */
178 virtual void setToNormal(escript::Data& out) const;
179 /**
180 \brief
181 copies the size of samples into out. The actual function space to be considered
182 is defined by out. out has to be defined on this.
183 has to be implemented by the actual Domain adapter.
184 */
185 virtual void setToSize(escript::Data& out) const;
186
187 /**
188 \brief
189 copies the gradient of arg into grad. The actual function space to be considered
190 for the gradient is defined by grad. arg and grad have to be defined on this.
191 has to be implemented by the actual Domain adapter.
192 */
193 virtual void setToGradient(escript::Data& grad, const escript::Data& arg) const;
194
195 /**
196 \brief
197 saves data arg to a OpenDX input file.
198 considered as cell centered data.
199 has to be implemented by the actual Domain adapter.
200 */
201 virtual void saveDX(const std::string& filename,const escript::Data& arg) const;
202 /**
203 \brief
204 returns the function space representation of the type functionSpaceCode on this domain
205 as a vtkObject.
206 has to be implemented by the actual Domain adapter.
207 */
208 //virtual vtkObject createVtkObject(int functionSpaceCode) const;
209
210 /**
211 \brief
212 returns true if data on this domain and a function space of type functionSpaceCode has to
213 considered as cell centered data.
214 has to be implemented by the actual Domain adapter.
215 */
216 virtual bool isCellOriented(int functionSpaceCode) const;
217
218
219 protected:
220
221 private:
222 };
223
224 } // end of namespace
225 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26