escript
Revision_
|
00001 00002 /***************************************************************************** 00003 * 00004 * Copyright (c) 2003-2014 by University of Queensland 00005 * http://www.uq.edu.au 00006 * 00007 * Primary Business: Queensland, Australia 00008 * Licensed under the Open Software License version 3.0 00009 * http://www.opensource.org/licenses/osl-3.0.php 00010 * 00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC) 00012 * Development 2012-2013 by School of Earth Sciences 00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp) 00014 * 00015 *****************************************************************************/ 00016 00017 00018 #if !defined escript_DataFactory_20040721_H 00019 #define escript_DataFactory_20040721_H 00020 00021 #ifdef BADPYTHONMACROS 00022 // This hack is required for BSD/OSX builds with python 2.7 00023 // (and possibly others). It must be the first include. 00024 // From bug reports online it seems that python redefines 00025 // some c macros that are functions in c++. 00026 // c++ doesn't like that! 00027 #include <Python.h> 00028 #undef BADPYTHONMACROS 00029 #endif 00030 00031 00032 #include "system_dep.h" 00033 00034 #include "AbstractDomain.h" 00035 #include "FunctionSpace.h" 00036 #include "Data.h" 00037 00038 #include <boost/python/object.hpp> 00039 00040 namespace escript { 00041 00058 ESCRIPT_DLL_API Data 00059 Scalar(double value, 00060 const FunctionSpace& what=FunctionSpace(), 00061 bool expanded=false); 00062 00068 ESCRIPT_DLL_API Data 00069 Vector(double value, 00070 const FunctionSpace& what=FunctionSpace(), 00071 bool expanded=false); 00072 00073 ESCRIPT_DLL_API 00074 Data 00075 VectorFromObj(boost::python::object o, 00076 const FunctionSpace& what=FunctionSpace(), 00077 bool expanded=false); 00078 00084 ESCRIPT_DLL_API Data 00085 Tensor(double value, 00086 const FunctionSpace& what=FunctionSpace(), 00087 bool expanded=false); 00088 00089 ESCRIPT_DLL_API 00090 Data 00091 TensorFromObj(boost::python::object o, 00092 const FunctionSpace& what=FunctionSpace(), 00093 bool expanded=false); 00099 ESCRIPT_DLL_API Data 00100 Tensor3(double value, 00101 const FunctionSpace& what=FunctionSpace(), 00102 bool expanded=false); 00103 00104 ESCRIPT_DLL_API 00105 Data 00106 Tensor3FromObj(boost::python::object o, 00107 const FunctionSpace& what=FunctionSpace(), 00108 bool expanded=false); 00109 00115 ESCRIPT_DLL_API Data 00116 Tensor4(double value, 00117 const FunctionSpace& what=FunctionSpace(), 00118 bool expanded=false); 00119 00120 ESCRIPT_DLL_API 00121 Data 00122 Tensor4FromObj(boost::python::object o, 00123 const FunctionSpace& what=FunctionSpace(), 00124 bool expanded=false); 00125 00130 ESCRIPT_DLL_API Data 00131 load(const std::string fileName, 00132 const AbstractDomain& domain); 00137 ESCRIPT_DLL_API bool 00138 loadConfigured(); 00139 00147 ESCRIPT_DLL_API Data 00148 convertToData(const boost::python::object& value, 00149 const FunctionSpace& what=FunctionSpace()); 00150 00151 00152 } // end of namespace 00153 00154 #endif