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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2838 - (hide annotations)
Wed Jan 13 06:01:03 2010 UTC (9 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 3517 byte(s)
Vector, Tensor, Tensor3, Tensor4 can now take a (nested) sequence for 
their initial value.


1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * 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 ksteube 1312
14 ksteube 1811
15 jgs 82 #if !defined escript_DataFactory_20040721_H
16     #define escript_DataFactory_20040721_H
17 woo409 757 #include "system_dep.h"
18 jgs 82
19 gross 950 #include "AbstractDomain.h"
20 jgs 474 #include "FunctionSpace.h"
21     #include "Data.h"
22 jgs 82
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 woo409 757 ESCRIPT_DLL_API Data
44 jgs 82 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 woo409 757 ESCRIPT_DLL_API Data
54 jgs 82 Vector(double value,
55     const FunctionSpace& what=FunctionSpace(),
56     bool expanded=false);
57    
58 jfenwick 2838 ESCRIPT_DLL_API
59     Data
60     VectorFromObj(boost::python::object o,
61     const FunctionSpace& what=FunctionSpace(),
62     bool expanded=false);
63    
64 jgs 82 /**
65     \brief
66     Return a Data object containing tensor datapoints.
67     ie: rank 2 data-points.
68     */
69 woo409 757 ESCRIPT_DLL_API Data
70 jgs 82 Tensor(double value,
71     const FunctionSpace& what=FunctionSpace(),
72     bool expanded=false);
73    
74 jfenwick 2838 ESCRIPT_DLL_API
75     Data
76     TensorFromObj(boost::python::object o,
77     const FunctionSpace& what=FunctionSpace(),
78     bool expanded=false);
79 jgs 82 /**
80     \brief
81     Return a Data object containing tensor3 datapoints.
82     ie: rank 3 data-points.
83     */
84 woo409 757 ESCRIPT_DLL_API Data
85 jgs 82 Tensor3(double value,
86     const FunctionSpace& what=FunctionSpace(),
87     bool expanded=false);
88    
89 jfenwick 2838 ESCRIPT_DLL_API
90     Data
91     Tensor3FromObj(boost::python::object o,
92     const FunctionSpace& what=FunctionSpace(),
93     bool expanded=false);
94    
95 jgs 82 /**
96     \brief
97     Return a Data object containing tensor4 datapoints.
98     ie: rank 4 data-points.
99     */
100 woo409 757 ESCRIPT_DLL_API Data
101 jgs 82 Tensor4(double value,
102     const FunctionSpace& what=FunctionSpace(),
103     bool expanded=false);
104 jfenwick 2838
105     ESCRIPT_DLL_API
106     Data
107     Tensor4FromObj(boost::python::object o,
108     const FunctionSpace& what=FunctionSpace(),
109     bool expanded=false);
110    
111 gross 950 /**
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 gross 1023 /**
119     \brief
120     returns true if the load funtion is configured.
121     */
122     ESCRIPT_DLL_API bool
123     loadConfigured();
124 jgs 82
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 woo409 757 ESCRIPT_DLL_API Data
133 jgs 82 convertToData(const boost::python::object& value,
134     const FunctionSpace& what=FunctionSpace());
135    
136 jfenwick 2005
137 jgs 82 } // 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