/[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

revision 119 by jgs, Tue Apr 12 04:45:05 2005 UTC revision 126 by jgs, Fri Jul 22 03:53:08 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://www.esscc.uq.edu.au/~cochrane/esys_python_doc/html/index.html>Python module documentation (doxygen generated)</a>
46     *
47     Class Limitations:   * - <a href=http://www.esscc.uq.edu.au/~cochrane/esys_python_doc/index.html>Python module documentation (epydoc generated)</a>
48     None   *
49     */
50     Class Conditions of Use:  
51     None  /*! \page escript Escript
52     * Escript is the python module that contains the interfaces
53     Throws:   * to the C++ side of escript.
54     None   *
55     * \version 1.0.0
56  */   *
57     * \section class_desc Class Description:
58     * Data
59     *
60     * \section class_limits Class Limitations:
61     * None
62     *
63     * \section class_conds Class Conditions of Use:
64     * None
65     *
66     * \section class_throws Throws:
67     * None
68     *
69     */
70    
71  BOOST_PYTHON_MODULE(escriptcpp)  BOOST_PYTHON_MODULE(escriptcpp)
72  {  {
# Line 86  BOOST_PYTHON_MODULE(escriptcpp) Line 100  BOOST_PYTHON_MODULE(escriptcpp)
100       .def(self != self);       .def(self != self);
101    
102    //    //
103      // Interface for DataVariable
104      //
105      class_<escript::DataVariable>("DataVariable",init<>())
106        .def(init<escript::Data*>())
107        .def("evaluate",&escript::DataVariable::evaluate)
108        .def("sum",&escript::DataVariable::sum)
109        .def("diff",&escript::DataVariable::diff);
110    
111      //
112    // Interface for Data    // Interface for Data
113    //    //
114    class_<escript::Data>("Data",init<>())    class_<escript::Data>("Data",init<>())
# Line 109  BOOST_PYTHON_MODULE(escriptcpp) Line 132  BOOST_PYTHON_MODULE(escriptcpp)
132      .def("getRefValue",&escript::Data::getRefValue)      .def("getRefValue",&escript::Data::getRefValue)
133      .def("expand",&escript::Data::expand)      .def("expand",&escript::Data::expand)
134      .def("tag",&escript::Data::tag)      .def("tag",&escript::Data::tag)
135        .def("copy",&escript::Data::copy)
136      .def("saveDX",&escript::Data::saveDX)      .def("saveDX",&escript::Data::saveDX)
137      .def("saveVTK",&escript::Data::saveVTK)      .def("saveVTK",&escript::Data::saveVTK)
138      .def("wherePositive",&escript::Data::wherePositive)      .def("wherePositive",&escript::Data::wherePositive)
# Line 122  BOOST_PYTHON_MODULE(escriptcpp) Line 146  BOOST_PYTHON_MODULE(escriptcpp)
146      .def("grad",&escript::Data::gradOn)      .def("grad",&escript::Data::gradOn)
147      .def("grad",&escript::Data::grad)      .def("grad",&escript::Data::grad)
148      .def("convertToNumArray",&escript::Data::convertToNumArray)      .def("convertToNumArray",&escript::Data::convertToNumArray)
149        .def("convertToNumArrayFromSampleNo",&escript::Data::convertToNumArrayFromSampleNo)
150        .def("convertToNumArrayFromDPNo",&escript::Data::convertToNumArrayFromDPNo)
151        .def("fillFromNumArray",&escript::Data::fillFromNumArray)
152      .def("archiveData",&escript::Data::archiveData)      .def("archiveData",&escript::Data::archiveData)
153      .def("extractData",&escript::Data::extractData)      .def("extractData",&escript::Data::extractData)
154      .def("integrate",&escript::Data::integrate)      .def("integrate",&escript::Data::integrate)
# Line 137  BOOST_PYTHON_MODULE(escriptcpp) Line 164  BOOST_PYTHON_MODULE(escriptcpp)
164      .def("sup",&escript::Data::sup)      .def("sup",&escript::Data::sup)
165      .def("inf",&escript::Data::inf)      .def("inf",&escript::Data::inf)
166      .def("__abs__",&escript::Data::abs)      .def("__abs__",&escript::Data::abs)
167        .def("abs",&escript::Data::abs)
168      .def("exp",&escript::Data::exp)      .def("exp",&escript::Data::exp)
169      .def("sqrt",&escript::Data::sqrt)      .def("sqrt",&escript::Data::sqrt)
170      .def("maxval",&escript::Data::maxval)      .def("maxval",&escript::Data::maxval)
171      .def("minval",&escript::Data::minval)      .def("minval",&escript::Data::minval)
172        .def("mindp",&escript::Data::mindp)
173      .def("length",&escript::Data::length)      .def("length",&escript::Data::length)
174      .def("sign",&escript::Data::sign)      .def("sign",&escript::Data::sign)
175      // following implements the python "-" negation operator      // following implements the python "-" negation operator
176      .def("__neg__",&escript::Data::neg)      .def("__neg__",&escript::Data::neg)
177        .def("neg",&escript::Data::neg)
178      // following implements the python "+" identity operator      // following implements the python "+" identity operator
179      .def("__pos__",&escript::Data::pos)      .def("__pos__",&escript::Data::pos)
180        .def("pos",&escript::Data::pos)
181      // following two functions implement the python [] operator      // following two functions implement the python [] operator
182      .def("__getitem__",&escript::Data::getItem)      .def("__getitem__",&escript::Data::getItem)
183      .def("__setitem__",&escript::Data::setItemO)      .def("__setitem__",&escript::Data::setItemO)
# Line 225  BOOST_PYTHON_MODULE(escriptcpp) Line 256  BOOST_PYTHON_MODULE(escriptcpp)
256       .def("solve",&escript::AbstractSystemMatrix::solve)       .def("solve",&escript::AbstractSystemMatrix::solve)
257       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)
258       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)
259         .def("saveHB",&escript::AbstractSystemMatrix::saveHB)
260       .def("setValue",&escript::AbstractSystemMatrix::setValue)       .def("setValue",&escript::AbstractSystemMatrix::setValue)
261       .def("resetSolver",&escript::AbstractSystemMatrix::resetSolver)       .def("resetSolver",&escript::AbstractSystemMatrix::resetSolver)
262       .def(self*other<escript::Data>());       .def(self*other<escript::Data>());

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

  ViewVC Help
Powered by ViewVC 1.1.26