ESScript
Revision_4488
Main Page
Namespaces
Classes
Files
File List
File Members
escript
src
FunctionSpace.h
Go to the documentation of this file.
1
2
/*****************************************************************************
3
*
4
* Copyright (c) 2003-2013 by University of Queensland
5
* http://www.uq.edu.au
6
*
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
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12
* Development since 2012 by School of Earth Sciences
13
*
14
*****************************************************************************/
15
16
17
#if !defined escript_FunctionSpace_20040323_H
18
#define escript_FunctionSpace_20040323_H
19
#include "
system_dep.h
"
20
21
#include "
AbstractDomain.h
"
22
#include "
NullDomain.h
"
23
24
#include <string>
25
#include <list>
26
27
namespace
escript {
28
29
//
30
// Forward declaration for class Data.
31
class
Data;
32
45
class
FunctionSpace
46
{
47
public
:
62
ESCRIPT_DLL_API
63
FunctionSpace
();
64
72
ESCRIPT_DLL_API
73
FunctionSpace
(
const_Domain_ptr
domain,
74
int
functionSpaceType);
75
76
77
ESCRIPT_DLL_API
78
FunctionSpace
(
const
FunctionSpace& other);
79
86
ESCRIPT_DLL_API
87
int
88
getTypeCode
()
const
;
89
94
ESCRIPT_DLL_API
95
// const
96
// AbstractDomain&
97
const_Domain_ptr
98
getDomain
()
const
;
99
106
ESCRIPT_DLL_API
107
// const
108
// AbstractDomain&
109
Domain_ptr
110
getDomainPython
()
const
;
111
112
113
117
ESCRIPT_DLL_API
118
bool
119
canTag
()
const
;
120
125
ESCRIPT_DLL_API
126
int
127
getApproximationOrder
()
const
;
128
133
ESCRIPT_DLL_API
134
void
setTags
(
const
int
newTag,
const
escript::Data
& mask)
const
;
135
136
137
ESCRIPT_DLL_API
138
void
setTagsByString
(
const
std::string& name,
const
escript::Data
& mask)
const
;
139
140
145
ESCRIPT_DLL_API
146
std::pair<int,int>
147
getDataShape
()
const
;
148
155
ESCRIPT_DLL_API
156
bool
157
operator==
(
const
FunctionSpace& other)
const
;
158
159
ESCRIPT_DLL_API
160
bool
161
operator!=
(
const
FunctionSpace& other)
const
;
162
167
ESCRIPT_DLL_API
168
std::string
169
toString
()
const
;
170
171
//#define DEBUG_PY_STRINGS
172
173
#ifdef DEBUG_PY_STRINGS
174
182
ESCRIPT_DLL_API
183
PyObject *
184
toPyString()
const
;
185
#endif
186
191
ESCRIPT_DLL_API
192
int
193
getTagFromSampleNo
(
int
sampleNo)
const
;
194
199
ESCRIPT_DLL_API
200
int
201
getTagFromDataPointNo
(
int
dataPointNo)
const
;
202
207
ESCRIPT_DLL_API
208
int
getReferenceIDFromDataPointNo
(
int
dataPointNo)
const
;
209
216
ESCRIPT_DLL_API
217
inline
218
int
219
getReferenceIDOfSample
(
int
sampleNo)
const
220
{
221
return
borrowSampleReferenceIDs
()[sampleNo];
222
}
223
228
ESCRIPT_DLL_API
229
inline
230
bool
231
ownSample
(
int
sampleNo)
const
232
{
233
return
m_domain
->ownSample(
m_functionSpaceType
, sampleNo);
234
}
235
240
ESCRIPT_DLL_API
241
const
int
*
242
borrowSampleReferenceIDs
()
const
;
243
248
ESCRIPT_DLL_API
249
escript::Data
250
getX
()
const
;
251
256
ESCRIPT_DLL_API
257
escript::Data
258
getNormal
()
const
;
259
264
ESCRIPT_DLL_API
265
escript::Data
266
getSize
()
const
;
267
272
ESCRIPT_DLL_API
273
inline
274
int
275
getNumSamples
()
const
{
276
return
getDataShape
().second;
277
}
278
283
ESCRIPT_DLL_API
284
inline
285
int
286
getNumDPPSample
()
const
{
287
return
getNumDataPointsPerSample
();
288
}
289
290
ESCRIPT_DLL_API
291
inline
292
int
293
getNumDataPointsPerSample
()
const
{
294
return
getDataShape
().first;
295
}
296
301
ESCRIPT_DLL_API
302
inline
303
int
304
getDim
()
const
{
305
return
getDomain
()->getDim();
306
}
311
ESCRIPT_DLL_API
312
boost::python::list
313
getListOfTags
()
const
;
318
ESCRIPT_DLL_API
319
std::list<int>
320
getListOfTagsSTL
()
const
;
321
326
ESCRIPT_DLL_API
327
int
getNumberOfTagsInUse
()
const
;
328
329
ESCRIPT_DLL_API
330
const
int
*
borrowListOfTagsInUse
()
const
;
331
332
ESCRIPT_DLL_API
333
bool
334
probeInterpolation
(
const
FunctionSpace& other)
const
335
{
336
if
(*
this
==other) {
337
return
true
;
338
}
else
{
339
const_Domain_ptr
domain=
getDomain
();
340
if
(*domain==*other.
getDomain
()) {
341
return
domain->probeInterpolationOnDomain(
getTypeCode
(),other.
getTypeCode
());
342
}
else
{
343
return
domain->probeInterpolationACross(
getTypeCode
(),*(other.
getDomain
()),other.
getTypeCode
());
344
}
345
}
346
}
347
348
349
protected
:
350
351
private
:
357
ESCRIPT_DLL_API
358
FunctionSpace&
359
operator=
(
const
FunctionSpace& other);
360
361
//
362
// function space domain
363
364
// const AbstractDomain* m_domain;
365
const_Domain_ptr
m_domain
;
366
367
368
//
369
// function space type code.
370
int
m_functionSpaceType
;
371
372
};
373
374
ESCRIPT_DLL_API
375
bool
canInterpolate
(
FunctionSpace
src,
FunctionSpace
dest);
376
377
}
// end of namespace
378
379
#endif
Generated on Fri Jun 28 2013 11:10:52 for ESScript by
1.8.1.2