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

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

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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 122 by jgs, Thu Jun 9 05:38:05 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 105  BOOST_PYTHON_MODULE(escriptcpp) Line 128  BOOST_PYTHON_MODULE(escriptcpp)
128      .def("getRank",&escript::Data::getDataPointRank)      .def("getRank",&escript::Data::getDataPointRank)
129      .def("copyWithMask",&escript::Data::copyWithMask)      .def("copyWithMask",&escript::Data::copyWithMask)
130      .def("setTaggedValue",&escript::Data::setTaggedValue)      .def("setTaggedValue",&escript::Data::setTaggedValue)
131      //.def("expand",&escript::Data::expand)      .def("setRefValue",&escript::Data::setRefValue)
132      //.def("tag",&escript::Data::tag)      .def("getRefValue",&escript::Data::getRefValue)
133        .def("expand",&escript::Data::expand)
134        .def("tag",&escript::Data::tag)
135        .def("saveDX",&escript::Data::saveDX)
136        .def("saveVTK",&escript::Data::saveVTK)
137      .def("wherePositive",&escript::Data::wherePositive)      .def("wherePositive",&escript::Data::wherePositive)
138      .def("whereNegative",&escript::Data::whereNegative)      .def("whereNegative",&escript::Data::whereNegative)
139      .def("whereNonNegative",&escript::Data::whereNonNegative)      .def("whereNonNegative",&escript::Data::whereNonNegative)
# Line 117  BOOST_PYTHON_MODULE(escriptcpp) Line 144  BOOST_PYTHON_MODULE(escriptcpp)
144      .def("interpolate",&escript::Data::interpolate)      .def("interpolate",&escript::Data::interpolate)
145      .def("grad",&escript::Data::gradOn)      .def("grad",&escript::Data::gradOn)
146      .def("grad",&escript::Data::grad)      .def("grad",&escript::Data::grad)
147        .def("convertToNumArray",&escript::Data::convertToNumArray)
148        .def("convertToNumArrayFromSampleNo",&escript::Data::convertToNumArrayFromSampleNo)
149        .def("convertToNumArrayFromDPNo",&escript::Data::convertToNumArrayFromDPNo)
150        .def("archiveData",&escript::Data::archiveData)
151        .def("extractData",&escript::Data::extractData)
152      .def("integrate",&escript::Data::integrate)      .def("integrate",&escript::Data::integrate)
153      .def("transpose",&escript::Data::transpose)      .def("transpose",&escript::Data::transpose)
154      .def("trace",&escript::Data::trace)      .def("trace",&escript::Data::trace)
# Line 126  BOOST_PYTHON_MODULE(escriptcpp) Line 158  BOOST_PYTHON_MODULE(escriptcpp)
158      .def("log",&escript::Data::log)      .def("log",&escript::Data::log)
159      .def("ln",&escript::Data::ln)      .def("ln",&escript::Data::ln)
160      .def("Lsup",&escript::Data::Lsup)      .def("Lsup",&escript::Data::Lsup)
161        .def("Linf",&escript::Data::Lsup)
162      .def("sup",&escript::Data::sup)      .def("sup",&escript::Data::sup)
163      .def("inf",&escript::Data::inf)      .def("inf",&escript::Data::inf)
164        .def("__abs__",&escript::Data::abs)
165      .def("abs",&escript::Data::abs)      .def("abs",&escript::Data::abs)
166      .def("exp",&escript::Data::exp)      .def("exp",&escript::Data::exp)
167      .def("sqrt",&escript::Data::sqrt)      .def("sqrt",&escript::Data::sqrt)
168      .def("maxval",&escript::Data::maxval)      .def("maxval",&escript::Data::maxval)
169      .def("minval",&escript::Data::minval)      .def("minval",&escript::Data::minval)
170        .def("mindp",&escript::Data::mindp)
171      .def("length",&escript::Data::length)      .def("length",&escript::Data::length)
172      .def("sign",&escript::Data::sign)      .def("sign",&escript::Data::sign)
173      // following implements the python "-" negation operator      // following implements the python "-" negation operator
174      .def("__neg__",&escript::Data::neg)      .def("__neg__",&escript::Data::neg)
175        .def("neg",&escript::Data::neg)
176      // following implements the python "+" identity operator      // following implements the python "+" identity operator
177      .def("__pos__",&escript::Data::pos)      .def("__pos__",&escript::Data::pos)
178        .def("pos",&escript::Data::pos)
179      // following two functions implement the python [] operator      // following two functions implement the python [] operator
180      .def("__getitem__",&escript::Data::getItem)      .def("__getitem__",&escript::Data::getItem)
181      .def("__setitem__",&escript::Data::setItemO)      .def("__setitem__",&escript::Data::setItemO)
# Line 218  BOOST_PYTHON_MODULE(escriptcpp) Line 255  BOOST_PYTHON_MODULE(escriptcpp)
255       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)
256       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)       .def("saveMM",&escript::AbstractSystemMatrix::saveMM)
257       .def("setValue",&escript::AbstractSystemMatrix::setValue)       .def("setValue",&escript::AbstractSystemMatrix::setValue)
258         .def("resetSolver",&escript::AbstractSystemMatrix::resetSolver)
259       .def(self*other<escript::Data>());       .def(self*other<escript::Data>());
260    
261    //    //

Legend:
Removed from v.102  
changed lines
  Added in v.122

  ViewVC Help
Powered by ViewVC 1.1.26