|
// $Id$ |
|
|
/* |
|
|
************************************************************ |
|
|
* Copyright 2006 by ACcESS MNRF * |
|
|
* * |
|
|
* http://www.access.edu.au * |
|
|
* Primary Business: Queensland, Australia * |
|
|
* Licensed under the Open Software License version 3.0 * |
|
|
* http://www.opensource.org/licenses/osl-3.0.php * |
|
|
* * |
|
|
************************************************************ |
|
1 |
|
|
2 |
*/ |
/* $Id$ */ |
3 |
|
|
4 |
|
/******************************************************* |
5 |
|
* |
6 |
|
* Copyright 2003-2007 by ACceSS MNRF |
7 |
|
* Copyright 2007 by University of Queensland |
8 |
|
* |
9 |
|
* http://esscc.uq.edu.au |
10 |
|
* Primary Business: Queensland, Australia |
11 |
|
* Licensed under the Open Software License version 3.0 |
12 |
|
* http://www.opensource.org/licenses/osl-3.0.php |
13 |
|
* |
14 |
|
*******************************************************/ |
15 |
|
|
16 |
#if !defined escript_AbstractDomain_20040609_H |
#if !defined escript_AbstractDomain_20040609_H |
17 |
#define escript_AbstractDomain_20040609_H |
#define escript_AbstractDomain_20040609_H |
19 |
#include "system_dep.h" |
#include "system_dep.h" |
20 |
|
|
21 |
#include <string> |
#include <string> |
22 |
|
#include <map> |
23 |
#include <boost/python/dict.hpp> |
#include <boost/python/dict.hpp> |
24 |
|
|
25 |
namespace escript { |
namespace escript { |
26 |
|
// class forward declarations |
|
// |
|
|
// forward declarations |
|
27 |
class Data; |
class Data; |
|
//class AbstractSystemMatrix; |
|
|
//class FunctionSpace; |
|
|
|
|
28 |
/** |
/** |
29 |
\brief |
\brief |
30 |
Base class for all escript domains. |
Base class for all escript domains. |
37 |
|
|
38 |
public: |
public: |
39 |
|
|
40 |
|
|
41 |
|
// structure holding values for X, size and normal |
42 |
|
typedef int StatusType; |
43 |
|
struct ValueBuffer |
44 |
|
{ |
45 |
|
StatusType m_status; |
46 |
|
boost::shared_ptr<Data> m_data; |
47 |
|
}; |
48 |
|
typedef struct ValueBuffer ValueBuffer; |
49 |
|
|
50 |
|
// |
51 |
|
// map from function space type code to value buffer |
52 |
|
typedef std::map<int, ValueBuffer> BufferMapType; |
53 |
|
|
54 |
|
|
55 |
/** |
/** |
56 |
\brief |
\brief |
57 |
Default constructor for AbstractDomain. |
Default constructor for AbstractDomain. |
87 |
|
|
88 |
/** |
/** |
89 |
\brief |
\brief |
90 |
|
return the number of processors used for this domain |
91 |
|
*/ |
92 |
|
ESCRIPT_DLL_API |
93 |
|
virtual int getMPISize() const; |
94 |
|
/** |
95 |
|
\brief |
96 |
|
return the number MPI rank of this processor |
97 |
|
*/ |
98 |
|
|
99 |
|
ESCRIPT_DLL_API |
100 |
|
virtual int getMPIRank() const; |
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
/** |
105 |
|
\brief |
106 |
Returns true if the given integer is a valid function space type |
Returns true if the given integer is a valid function space type |
107 |
for this domain. |
for this domain. |
108 |
*/ |
*/ |
152 |
|
|
153 |
/** |
/** |
154 |
\brief |
\brief |
155 |
|
dumps the domain to an external file filename. |
156 |
|
|
157 |
|
This has to be implemented by the actual Domain adapter. |
158 |
|
*/ |
159 |
|
ESCRIPT_DLL_API |
160 |
|
virtual void dump(const std::string& filename) const; |
161 |
|
|
162 |
|
/** |
163 |
|
\brief |
164 |
Return the number of data points per sample, and the number of samples as a pair. |
Return the number of data points per sample, and the number of samples as a pair. |
165 |
|
|
166 |
This has to be implemented by the actual Domain adapter. |
This has to be implemented by the actual Domain adapter. |
182 |
|
|
183 |
/** |
/** |
184 |
\brief |
\brief |
185 |
Return the reference number of the given sample number. |
sets a map from a clear tag name to a tag key |
186 |
|
\param name Input - tag name. |
187 |
|
\param tag Input - tag key. |
188 |
|
*/ |
189 |
|
ESCRIPT_DLL_API |
190 |
|
virtual void setTagMap(const std::string& name, int tag); |
191 |
|
|
192 |
|
/** |
193 |
|
\brief |
194 |
|
Return the tag key for tag name. |
195 |
|
\param name Input - tag name |
196 |
|
*/ |
197 |
|
ESCRIPT_DLL_API |
198 |
|
virtual int getTag(const std::string& name) const; |
199 |
|
|
200 |
|
/** |
201 |
|
\brief |
202 |
|
Returns True if name is a defined tag name |
203 |
|
\param name Input - tag name |
204 |
|
*/ |
205 |
|
ESCRIPT_DLL_API |
206 |
|
virtual bool isValidTagName(const std::string& name) const; |
207 |
|
|
208 |
|
/** |
209 |
|
\brief |
210 |
|
Returns all tag names in a single string sperated by commas |
211 |
|
*/ |
212 |
|
ESCRIPT_DLL_API |
213 |
|
virtual std::string showTagNames() const; |
214 |
|
|
215 |
|
/** |
216 |
|
\brief |
217 |
|
Return a borrowed pointer to the sample reference number id list |
218 |
\param functionSpaceType Input - The function space type. |
\param functionSpaceType Input - The function space type. |
|
\param sampleNo Input - The sample number. |
|
219 |
*/ |
*/ |
220 |
ESCRIPT_DLL_API |
ESCRIPT_DLL_API |
221 |
virtual int getReferenceNoFromSampleNo(int functionSpaceType, int sampleNo) const; |
virtual int* borrowSampleReferenceIDs(int functionSpaceType) const; |
222 |
|
|
223 |
/** |
/** |
224 |
\brief |
\brief |
342 |
//virtual vtkObject createVtkObject(int functionSpaceCode) const; |
//virtual vtkObject createVtkObject(int functionSpaceCode) const; |
343 |
|
|
344 |
/** |
/** |
345 |
|
\brief assigns new tag newTag to all samples of functionspace with a positive |
346 |
|
value of mask for any its sample point. |
347 |
|
|
348 |
|
*/ |
349 |
|
ESCRIPT_DLL_API |
350 |
|
virtual void setTags(const int functionSpaceType, const int newTag, const escript::Data& mask) const; |
351 |
|
|
352 |
|
/** |
353 |
\brief |
\brief |
354 |
returns true if data on this domain and a function space of type functionSpaceCode has to |
returns true if data on this domain and a function space of type functionSpaceCode has to |
355 |
considered as cell centered data. |
considered as cell centered data. |
361 |
|
|
362 |
/** |
/** |
363 |
\brief |
\brief |
364 |
|
returns status of the domain. |
365 |
|
|
366 |
|
This has to be implemented by the actual Domain adapter. |
367 |
|
*/ |
368 |
|
ESCRIPT_DLL_API |
369 |
|
virtual StatusType getStatus() const; |
370 |
|
|
371 |
|
/** |
372 |
|
\brief |
373 |
Throw a standard exception. This function is called if any attempt |
Throw a standard exception. This function is called if any attempt |
374 |
is made to use a base class function. |
is made to use a base class function. |
375 |
*/ |
*/ |
380 |
|
|
381 |
private: |
private: |
382 |
|
|
383 |
|
// buffer for coordinates used by function spaces |
384 |
|
BufferMapType m_x_buffer; |
385 |
|
|
386 |
|
// buffer for normal vectors used by function spaces |
387 |
|
BufferMapType m_normal_buffer; |
388 |
|
|
389 |
|
// buffer for normal element size used by function spaces |
390 |
|
BufferMapType m_size_buffer; |
391 |
|
|
392 |
}; |
}; |
393 |
|
|
394 |
} // end of namespace |
} // end of namespace |