1 |
jgs |
82 |
// $Id$ |
2 |
|
|
/* |
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 |
jgs |
82 |
*/ |
13 |
|
|
|
14 |
|
|
#if !defined escript_DataFactory_20040721_H |
15 |
|
|
#define escript_DataFactory_20040721_H |
16 |
woo409 |
757 |
#include "system_dep.h" |
17 |
jgs |
82 |
|
18 |
gross |
950 |
#include "AbstractDomain.h" |
19 |
jgs |
474 |
#include "FunctionSpace.h" |
20 |
|
|
#include "Data.h" |
21 |
jgs |
82 |
|
22 |
|
|
#include <boost/python/object.hpp> |
23 |
|
|
|
24 |
|
|
namespace escript { |
25 |
|
|
|
26 |
|
|
/** |
27 |
|
|
\brief |
28 |
|
|
A collection of factory functions for creating Data objects which contain |
29 |
|
|
data points of various shapes. |
30 |
|
|
*/ |
31 |
|
|
|
32 |
|
|
/** |
33 |
|
|
\brief |
34 |
|
|
Return a Data object containing scalar data-points. |
35 |
|
|
ie: rank 0 data-points. |
36 |
|
|
\param value - Input - Single value applied to all Data. |
37 |
|
|
\param what - Input - A description of what this data represents. |
38 |
|
|
\param expanded - Input - if true fill the entire container with |
39 |
|
|
the value. Otherwise a more efficient storage |
40 |
|
|
mechanism will be used. |
41 |
|
|
*/ |
42 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
43 |
jgs |
82 |
Scalar(double value, |
44 |
|
|
const FunctionSpace& what=FunctionSpace(), |
45 |
|
|
bool expanded=false); |
46 |
|
|
|
47 |
|
|
/** |
48 |
|
|
\brief |
49 |
|
|
Return a Data object containing vector data-points. |
50 |
|
|
ie: rank 1 data-points. |
51 |
|
|
*/ |
52 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
53 |
jgs |
82 |
Vector(double value, |
54 |
|
|
const FunctionSpace& what=FunctionSpace(), |
55 |
|
|
bool expanded=false); |
56 |
|
|
|
57 |
|
|
/** |
58 |
|
|
\brief |
59 |
|
|
Return a Data object containing tensor datapoints. |
60 |
|
|
ie: rank 2 data-points. |
61 |
|
|
*/ |
62 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
63 |
jgs |
82 |
Tensor(double value, |
64 |
|
|
const FunctionSpace& what=FunctionSpace(), |
65 |
|
|
bool expanded=false); |
66 |
|
|
|
67 |
|
|
/** |
68 |
|
|
\brief |
69 |
|
|
Return a Data object containing tensor3 datapoints. |
70 |
|
|
ie: rank 3 data-points. |
71 |
|
|
*/ |
72 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
73 |
jgs |
82 |
Tensor3(double value, |
74 |
|
|
const FunctionSpace& what=FunctionSpace(), |
75 |
|
|
bool expanded=false); |
76 |
|
|
|
77 |
|
|
/** |
78 |
|
|
\brief |
79 |
|
|
Return a Data object containing tensor4 datapoints. |
80 |
|
|
ie: rank 4 data-points. |
81 |
|
|
*/ |
82 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
83 |
jgs |
82 |
Tensor4(double value, |
84 |
|
|
const FunctionSpace& what=FunctionSpace(), |
85 |
|
|
bool expanded=false); |
86 |
gross |
950 |
/** |
87 |
|
|
\brief |
88 |
|
|
reads Data on domain from file in netCDF format |
89 |
|
|
*/ |
90 |
|
|
ESCRIPT_DLL_API Data |
91 |
|
|
load(const std::string fileName, |
92 |
|
|
const AbstractDomain& domain); |
93 |
gross |
1023 |
/** |
94 |
|
|
\brief |
95 |
|
|
returns true if the load funtion is configured. |
96 |
|
|
*/ |
97 |
|
|
ESCRIPT_DLL_API bool |
98 |
|
|
loadConfigured(); |
99 |
jgs |
82 |
|
100 |
|
|
/** |
101 |
|
|
\brief |
102 |
|
|
Tries to convert value into a Data object on FunctionSpace what. |
103 |
|
|
If value is already a Data object, the object is returned if it is defined on what otherwise |
104 |
|
|
interpolated data of values are returned. If value is not a data object it is tried to generate |
105 |
|
|
the corresponding data object. escript::DataEmpty() is returned if value is identified as empty. |
106 |
|
|
*/ |
107 |
woo409 |
757 |
ESCRIPT_DLL_API Data |
108 |
jgs |
82 |
convertToData(const boost::python::object& value, |
109 |
|
|
const FunctionSpace& what=FunctionSpace()); |
110 |
|
|
|
111 |
|
|
} // end of namespace |
112 |
|
|
|
113 |
|
|
#endif |