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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (hide annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 9 months ago) by jfenwick
File MIME type: text/plain
File size: 3957 byte(s)
Round 1 of copyright fixes
1 ksteube 1312
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 4154 * Copyright (c) 2003-2013 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
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 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 ksteube 1312
16 ksteube 1811
17 jgs 82 #if !defined escript_DataFactory_20040721_H
18     #define escript_DataFactory_20040721_H
19 jfenwick 3962
20     #ifdef BADPYTHONMACROS
21     // This hack is required for BSD/OSX builds with python 2.7
22     // (and possibly others). It must be the first include.
23     // From bug reports online it seems that python redefines
24     // some c macros that are functions in c++.
25     // c++ doesn't like that!
26     #include <Python.h>
27     #undef BADPYTHONMACROS
28     #endif
29    
30    
31 woo409 757 #include "system_dep.h"
32 jgs 82
33 gross 950 #include "AbstractDomain.h"
34 jgs 474 #include "FunctionSpace.h"
35     #include "Data.h"
36 jgs 82
37     #include <boost/python/object.hpp>
38    
39     namespace escript {
40    
41     /**
42     \brief
43     A collection of factory functions for creating Data objects which contain
44     data points of various shapes.
45     */
46    
47     /**
48     \brief
49     Return a Data object containing scalar data-points.
50     ie: rank 0 data-points.
51     \param value - Input - Single value applied to all Data.
52     \param what - Input - A description of what this data represents.
53     \param expanded - Input - if true fill the entire container with
54     the value. Otherwise a more efficient storage
55     mechanism will be used.
56     */
57 woo409 757 ESCRIPT_DLL_API Data
58 jgs 82 Scalar(double value,
59     const FunctionSpace& what=FunctionSpace(),
60     bool expanded=false);
61    
62     /**
63     \brief
64     Return a Data object containing vector data-points.
65     ie: rank 1 data-points.
66     */
67 woo409 757 ESCRIPT_DLL_API Data
68 jgs 82 Vector(double value,
69     const FunctionSpace& what=FunctionSpace(),
70     bool expanded=false);
71    
72 jfenwick 2838 ESCRIPT_DLL_API
73     Data
74     VectorFromObj(boost::python::object o,
75     const FunctionSpace& what=FunctionSpace(),
76     bool expanded=false);
77    
78 jgs 82 /**
79     \brief
80     Return a Data object containing tensor datapoints.
81     ie: rank 2 data-points.
82     */
83 woo409 757 ESCRIPT_DLL_API Data
84 jgs 82 Tensor(double value,
85     const FunctionSpace& what=FunctionSpace(),
86     bool expanded=false);
87    
88 jfenwick 2838 ESCRIPT_DLL_API
89     Data
90     TensorFromObj(boost::python::object o,
91     const FunctionSpace& what=FunctionSpace(),
92     bool expanded=false);
93 jgs 82 /**
94     \brief
95     Return a Data object containing tensor3 datapoints.
96     ie: rank 3 data-points.
97     */
98 woo409 757 ESCRIPT_DLL_API Data
99 jgs 82 Tensor3(double value,
100     const FunctionSpace& what=FunctionSpace(),
101     bool expanded=false);
102    
103 jfenwick 2838 ESCRIPT_DLL_API
104     Data
105     Tensor3FromObj(boost::python::object o,
106     const FunctionSpace& what=FunctionSpace(),
107     bool expanded=false);
108    
109 jgs 82 /**
110     \brief
111     Return a Data object containing tensor4 datapoints.
112     ie: rank 4 data-points.
113     */
114 woo409 757 ESCRIPT_DLL_API Data
115 jgs 82 Tensor4(double value,
116     const FunctionSpace& what=FunctionSpace(),
117     bool expanded=false);
118 jfenwick 2838
119     ESCRIPT_DLL_API
120     Data
121     Tensor4FromObj(boost::python::object o,
122     const FunctionSpace& what=FunctionSpace(),
123     bool expanded=false);
124    
125 gross 950 /**
126     \brief
127     reads Data on domain from file in netCDF format
128     */
129     ESCRIPT_DLL_API Data
130     load(const std::string fileName,
131     const AbstractDomain& domain);
132 gross 1023 /**
133     \brief
134     returns true if the load funtion is configured.
135     */
136     ESCRIPT_DLL_API bool
137     loadConfigured();
138 jgs 82
139     /**
140     \brief
141     Tries to convert value into a Data object on FunctionSpace what.
142     If value is already a Data object, the object is returned if it is defined on what otherwise
143     interpolated data of values are returned. If value is not a data object it is tried to generate
144     the corresponding data object. escript::DataEmpty() is returned if value is identified as empty.
145     */
146 woo409 757 ESCRIPT_DLL_API Data
147 jgs 82 convertToData(const boost::python::object& value,
148     const FunctionSpace& what=FunctionSpace());
149    
150 jfenwick 2005
151 jgs 82 } // end of namespace
152    
153     #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26