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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 6 months ago) by jfenwick
File MIME type: text/plain
File size: 3517 byte(s)
Don't panic.
Updating copyright stamps

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #if !defined escript_DataFactory_20040721_H
16 #define escript_DataFactory_20040721_H
17 #include "system_dep.h"
18
19 #include "AbstractDomain.h"
20 #include "FunctionSpace.h"
21 #include "Data.h"
22
23 #include <boost/python/object.hpp>
24
25 namespace escript {
26
27 /**
28 \brief
29 A collection of factory functions for creating Data objects which contain
30 data points of various shapes.
31 */
32
33 /**
34 \brief
35 Return a Data object containing scalar data-points.
36 ie: rank 0 data-points.
37 \param value - Input - Single value applied to all Data.
38 \param what - Input - A description of what this data represents.
39 \param expanded - Input - if true fill the entire container with
40 the value. Otherwise a more efficient storage
41 mechanism will be used.
42 */
43 ESCRIPT_DLL_API Data
44 Scalar(double value,
45 const FunctionSpace& what=FunctionSpace(),
46 bool expanded=false);
47
48 /**
49 \brief
50 Return a Data object containing vector data-points.
51 ie: rank 1 data-points.
52 */
53 ESCRIPT_DLL_API Data
54 Vector(double value,
55 const FunctionSpace& what=FunctionSpace(),
56 bool expanded=false);
57
58 ESCRIPT_DLL_API
59 Data
60 VectorFromObj(boost::python::object o,
61 const FunctionSpace& what=FunctionSpace(),
62 bool expanded=false);
63
64 /**
65 \brief
66 Return a Data object containing tensor datapoints.
67 ie: rank 2 data-points.
68 */
69 ESCRIPT_DLL_API Data
70 Tensor(double value,
71 const FunctionSpace& what=FunctionSpace(),
72 bool expanded=false);
73
74 ESCRIPT_DLL_API
75 Data
76 TensorFromObj(boost::python::object o,
77 const FunctionSpace& what=FunctionSpace(),
78 bool expanded=false);
79 /**
80 \brief
81 Return a Data object containing tensor3 datapoints.
82 ie: rank 3 data-points.
83 */
84 ESCRIPT_DLL_API Data
85 Tensor3(double value,
86 const FunctionSpace& what=FunctionSpace(),
87 bool expanded=false);
88
89 ESCRIPT_DLL_API
90 Data
91 Tensor3FromObj(boost::python::object o,
92 const FunctionSpace& what=FunctionSpace(),
93 bool expanded=false);
94
95 /**
96 \brief
97 Return a Data object containing tensor4 datapoints.
98 ie: rank 4 data-points.
99 */
100 ESCRIPT_DLL_API Data
101 Tensor4(double value,
102 const FunctionSpace& what=FunctionSpace(),
103 bool expanded=false);
104
105 ESCRIPT_DLL_API
106 Data
107 Tensor4FromObj(boost::python::object o,
108 const FunctionSpace& what=FunctionSpace(),
109 bool expanded=false);
110
111 /**
112 \brief
113 reads Data on domain from file in netCDF format
114 */
115 ESCRIPT_DLL_API Data
116 load(const std::string fileName,
117 const AbstractDomain& domain);
118 /**
119 \brief
120 returns true if the load funtion is configured.
121 */
122 ESCRIPT_DLL_API bool
123 loadConfigured();
124
125 /**
126 \brief
127 Tries to convert value into a Data object on FunctionSpace what.
128 If value is already a Data object, the object is returned if it is defined on what otherwise
129 interpolated data of values are returned. If value is not a data object it is tried to generate
130 the corresponding data object. escript::DataEmpty() is returned if value is identified as empty.
131 */
132 ESCRIPT_DLL_API Data
133 convertToData(const boost::python::object& value,
134 const FunctionSpace& what=FunctionSpace());
135
136
137 } // end of namespace
138
139 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26