/[escript]/trunk/escript/src/escriptcpp.cpp
ViewVC logotype

Diff of /trunk/escript/src/escriptcpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/esys2/escript/src/Data/escriptcpp.cpp revision 119 by jgs, Tue Apr 12 04:45:05 2005 UTC trunk/escript/src/Data/escriptcpp.cpp revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC
# Line 16  Line 16 
16  ******************************************************************************/  ******************************************************************************/
17    
18  #include "escript/Data/Data.h"  #include "escript/Data/Data.h"
19    #include "escript/Data/DataVariable.h"
20  #include "escript/Data/FunctionSpace.h"  #include "escript/Data/FunctionSpace.h"
21  #include "escript/Data/FunctionSpaceFactory.h"  #include "escript/Data/FunctionSpaceFactory.h"
22  #include "escript/Data/DataFactory.h"  #include "escript/Data/DataFactory.h"
# Line 31  Line 32 
32                                                                                                                                                                                                                                                                                        
33  using namespace boost::python;  using namespace boost::python;
34    
35  /**  /*! \mainpage Esys Documentation
36     @memo   *
37     escript is the python module that contains the interfaces   * \version 1.0.0
38     to the C++ side of escript.   *
39     * - \ref escript
40     @version 1.0.0   *
41     * - \ref esys_exception "Esys Exception"
42     @doc   *
43     * - \ref finley
44     Class Description:   *
45     Data   * - <a href=http://iservo.edu.au/esys/esys_python_doc/index.html>Python module documentation (epydoc generated)</a>
46     *
47     Class Limitations:   */
48     None  
49    /*! \page escript Escript
50     Class Conditions of Use:   * Escript is the python module that contains the interfaces
51     None   * to the C++ side of escript.
52     *
53     Throws:   * \version 1.0.0
54     None   *
55     * \section class_desc Class Description:
56  */   * Data
57     *
58     * \section class_limits Class Limitations:
59     * None
60     *
61     * \section class_conds Class Conditions of Use:
62     * None
63     *
64     * \section class_throws Throws:
65     * None
66     *
67     */
68    
69  BOOST_PYTHON_MODULE(escriptcpp)  BOOST_PYTHON_MODULE(escriptcpp)
70  {  {
# Line 64  BOOST_PYTHON_MODULE(escriptcpp) Line 76  BOOST_PYTHON_MODULE(escriptcpp)
76       .def("getX",&escript::AbstractDomain::getX)       .def("getX",&escript::AbstractDomain::getX)
77       .def("getNormal",&escript::AbstractDomain::getNormal)       .def("getNormal",&escript::AbstractDomain::getNormal)
78       .def("getSize",&escript::AbstractDomain::getSize)       .def("getSize",&escript::AbstractDomain::getSize)
79         .def("saveVTK",&escript::AbstractDomain::saveVTK)
80         .def("saveDX",&escript::AbstractDomain::saveDX)
81       .def(self == self)       .def(self == self)
82       .def(self != self);       .def(self != self);
83    
# Line 78  BOOST_PYTHON_MODULE(escriptcpp) Line 92  BOOST_PYTHON_MODULE(escriptcpp)
92    //    //
93    class_<escript::FunctionSpace>("FunctionSpace",init<>())    class_<escript::FunctionSpace>("FunctionSpace",init<>())
94       .def("getDim",&escript::FunctionSpace::getDim)       .def("getDim",&escript::FunctionSpace::getDim)
95         .def("getDomain",&escript::FunctionSpace::getDomain,return_internal_reference<>())
96       .def("getX",&escript::FunctionSpace::getX)       .def("getX",&escript::FunctionSpace::getX)
97       .def("getNormal",&escript::FunctionSpace::getNormal)       .def("getNormal",&escript::FunctionSpace::getNormal)
98       .def("getSize",&escript::FunctionSpace::getSize)       .def("getSize",&escript::FunctionSpace::getSize)
99       .def("toString",&escript::FunctionSpace::toString)       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)
100         .def("__str__",&escript::FunctionSpace::toString)
101       .def(self == self)       .def(self == self)
102       .def(self != self);       .def(self != self);
103    
104    //    //
105      // Interface for DataVariable
106      //
107      class_<escript::DataVariable>("DataVariable",init<>())
108        .def(init<escript::Data*>())
109        .def("evaluate",&escript::DataVariable::evaluate)
110        .def("sum",&escript::DataVariable::sum)
111        .def("diff",&escript::DataVariable::diff);
112    
113      //
114    // Interface for Data    // Interface for Data
115    //    //
116    class_<escript::Data>("Data",init<>())    class_<escript::Data>("Data","TEST DOCUMENTATION",init<>())
117      // various constructors for Data objects      // various constructors for Data objects
118      .def(init<const numeric::array&, optional<const escript::FunctionSpace&, bool> >(args("value","what","expand")))      .def(init<const numeric::array&, optional<const escript::FunctionSpace&, bool> >(args("value","what","expand")))
119      .def(init<const object&, optional<const escript::FunctionSpace&, bool> >(args("value","what","expand")))      .def(init<const object&, optional<const escript::FunctionSpace&, bool> >(args("value","what","expand")))
# Line 109  BOOST_PYTHON_MODULE(escriptcpp) Line 134  BOOST_PYTHON_MODULE(escriptcpp)
134      .def("getRefValue",&escript::Data::getRefValue)      .def("getRefValue",&escript::Data::getRefValue)
135      .def("expand",&escript::Data::expand)      .def("expand",&escript::Data::expand)
136      .def("tag",&escript::Data::tag)      .def("tag",&escript::Data::tag)
137        .def("copy",&escript::Data::copy)
138      .def("saveDX",&escript::Data::saveDX)      .def("saveDX",&escript::Data::saveDX)
139      .def("saveVTK",&escript::Data::saveVTK)      .def("saveVTK",&escript::Data::saveVTK)
140      .def("wherePositive",&escript::Data::wherePositive)      .def("wherePositive",&escript::Data::wherePositive)
# Line 122  BOOST_PYTHON_MODULE(escriptcpp) Line 148  BOOST_PYTHON_MODULE(escriptcpp)
148      .def("grad",&escript::Data::gradOn)      .def("grad",&escript::Data::gradOn)
149      .def("grad",&escript::Data::grad)      .def("grad",&escript::Data::grad)
150      .def("convertToNumArray",&escript::Data::convertToNumArray)      .def("convertToNumArray",&escript::Data::convertToNumArray)
151        .def("convertToNumArrayFromSampleNo",&escript::Data::convertToNumArrayFromSampleNo)
152        .def("convertToNumArrayFromDPNo",&escript::Data::convertToNumArrayFromDPNo)
153        .def("fillFromNumArray",&escript::Data::fillFromNumArray)
154        .def("getTagNumber",&escript::Data::getTagNumber)
155      .def("archiveData",&escript::Data::archiveData)      .def("archiveData",&escript::Data::archiveData)
156      .def("extractData",&escript::Data::extractData)      .def("extractData",&escript::Data::extractData)
157      .def("integrate",&escript::Data::integrate)      .def("integrate",&escript::Data::integrate)
# Line 130  BOOST_PYTHON_MODULE(escriptcpp) Line 160  BOOST_PYTHON_MODULE(escriptcpp)
160      .def("sin",&escript::Data::sin)      .def("sin",&escript::Data::sin)
161      .def("cos",&escript::Data::cos)      .def("cos",&escript::Data::cos)
162      .def("tan",&escript::Data::tan)      .def("tan",&escript::Data::tan)
163        .def("asin",&escript::Data::asin)
164        .def("acos",&escript::Data::acos)
165        .def("atan",&escript::Data::atan)
166        .def("sinh",&escript::Data::sinh)
167        .def("cosh",&escript::Data::cosh)
168        .def("tanh",&escript::Data::tanh)
169        .def("asinh",&escript::Data::asinh)
170        .def("acosh",&escript::Data::acosh)
171        .def("atanh",&escript::Data::atanh)
172      .def("log",&escript::Data::log)      .def("log",&escript::Data::log)
173      .def("ln",&escript::Data::ln)      .def("ln",&escript::Data::ln)
174      .def("Lsup",&escript::Data::Lsup)      .def("Lsup",&escript::Data::Lsup)
# Line 137  BOOST_PYTHON_MODULE(escriptcpp) Line 176  BOOST_PYTHON_MODULE(escriptcpp)
176      .def("sup",&escript::Data::sup)      .def("sup",&escript::Data::sup)
177      .def("inf",&escript::Data::inf)      .def("inf",&escript::Data::inf)
178      .def("__abs__",&escript::Data::abs)      .def("__abs__",&escript::Data::abs)
179        .def("abs",&escript::Data::abs)
180      .def("exp",&escript::Data::exp)      .def("exp",&escript::Data::exp)
181      .def("sqrt",&escript::Data::sqrt)      .def("sqrt",&escript::Data::sqrt)
182      .def("maxval",&escript::Data::maxval)      .def("maxval",&escript::Data::maxval)
183      .def("minval",&escript::Data::minval)      .def("minval",&escript::Data::minval)
184        .def("mindp",&escript::Data::mindp)
185      .def("length",&escript::Data::length)      .def("length",&escript::Data::length)
186      .def("sign",&escript::Data::sign)      .def("sign",&escript::Data::sign)
187      // following implements the python "-" negation operator      // following implements the python "-" negation operator
188      .def("__neg__",&escript::Data::neg)      .def("__neg__",&escript::Data::neg)
189        .def("neg",&escript::Data::neg)
190      // following implements the python "+" identity operator      // following implements the python "+" identity operator
191      .def("__pos__",&escript::Data::pos)      .def("__pos__",&escript::Data::pos)
192        .def("pos",&escript::Data::pos)
193      // following two functions implement the python [] operator      // following two functions implement the python [] operator
194      .def("__getitem__",&escript::Data::getItem)      .def("__getitem__",&escript::Data::getItem)
195      .def("__setitem__",&escript::Data::setItemO)      .def("__setitem__",&escript::Data::setItemO)
# Line 225  BOOST_PYTHON_MODULE(escriptcpp) Line 268  BOOST_PYTHON_MODULE(escriptcpp)
268       .def("solve",&escript::AbstractSystemMatrix::solve)       .def("solve",&escript::AbstractSystemMatrix::solve)
269       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)
270       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)
271       .def("setValue",&escript::AbstractSystemMatrix::setValue)       .def("saveHB",&escript::AbstractSystemMatrix::saveHB)
272       .def("resetSolver",&escript::AbstractSystemMatrix::resetSolver)       .def("resetValues",&escript::AbstractSystemMatrix::resetValues)
273       .def(self*other<escript::Data>());       .def(self*other<escript::Data>());
274    
275    //    //

Legend:
Removed from v.119  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.26