/[escript]/branches/subworld2/escriptcore/src/DataFactory.h
ViewVC logotype

Contents of /branches/subworld2/escriptcore/src/DataFactory.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5504 - (show annotations)
Wed Mar 4 22:58:13 2015 UTC (4 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 3705 byte(s)
Again with a more up to date copy


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26