/[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 1871 by gross, Wed Oct 8 03:03:37 2008 UTC revision 1872 by jfenwick, Mon Oct 13 00:18:55 2008 UTC
# Line 24  Line 24 
24  #include "DataVector.h"  #include "DataVector.h"
25  #include "paso/Paso_MPI.h"  #include "paso/Paso_MPI.h"
26    
27    
28    
29  extern "C" {  extern "C" {
30  #include "escript/blocktimer.h"  #include "escript/blocktimer.h"
31  }  }
# Line 36  extern "C" { Line 38  extern "C" {
38  #include <boost/python/object.hpp>  #include <boost/python/object.hpp>
39  #include <boost/python/tuple.hpp>  #include <boost/python/tuple.hpp>
40  #include <boost/python/numeric.hpp>  #include <boost/python/numeric.hpp>
41    #include <boost/smart_ptr.hpp>
42    
43  using namespace boost::python;  using namespace boost::python;
44    
# Line 92  BOOST_PYTHON_MODULE(escriptcpp) Line 95  BOOST_PYTHON_MODULE(escriptcpp)
95    //    //
96    // Interface for AbstractDomain    // Interface for AbstractDomain
97    //    //
98    class_<escript::AbstractDomain>("Domain",no_init)    class_<escript::AbstractDomain, escript::Domain_ptr>("Domain",no_init)
99       .def("setTagMap",&escript::AbstractDomain::setTagMap)       .def("setTagMap",&escript::AbstractDomain::setTagMap)
100       .def("getTag",&escript::AbstractDomain::getTag)       .def("getTag",&escript::AbstractDomain::getTag)
101       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)
# Line 121  BOOST_PYTHON_MODULE(escriptcpp) Line 124  BOOST_PYTHON_MODULE(escriptcpp)
124    //    //
125    class_<escript::FunctionSpace> fs_definer("FunctionSpace",init<>());    class_<escript::FunctionSpace> fs_definer("FunctionSpace",init<>());
126    fs_definer.def("getDim",&escript::FunctionSpace::getDim);    fs_definer.def("getDim",&escript::FunctionSpace::getDim);
127    fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,  //   fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,
128                   return_internal_reference<>());  //                  return_internal_reference<>());
129      fs_definer.def("getDomain",&escript::FunctionSpace::getDomainPython);
130    fs_definer.def("getX",&escript::FunctionSpace::getX);    fs_definer.def("getX",&escript::FunctionSpace::getX);
131    fs_definer.def("getNormal",&escript::FunctionSpace::getNormal);    fs_definer.def("getNormal",&escript::FunctionSpace::getNormal);
132    fs_definer.def("getSize",&escript::FunctionSpace::getSize);    fs_definer.def("getSize",&escript::FunctionSpace::getSize);
# Line 137  BOOST_PYTHON_MODULE(escriptcpp) Line 141  BOOST_PYTHON_MODULE(escriptcpp)
141    //    //
142    // Interface for Data    // Interface for Data
143    //    //
144    class_<escript::Data>("Data","TEST DOCUMENTATION",init<>())    class_<escript::Data>("Data","TEST DOCUMENTATION",init<>() )
145      // various constructors for Data objects      // various constructors for Data objects
146      .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")))
147      .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 147  BOOST_PYTHON_MODULE(escriptcpp) Line 151  BOOST_PYTHON_MODULE(escriptcpp)
151      // Note for Lutz, Need to specify the call policy in order to return a      // Note for Lutz, Need to specify the call policy in order to return a
152      // reference. In this case return_internal_reference.      // reference. In this case return_internal_reference.
153      .def("__str__",&escript::Data::toString)      .def("__str__",&escript::Data::toString)
154      .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())  //     .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())
155      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_internal_reference<>())      .def("getDomain",&escript::Data::getDomainPython)
156        .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_value_policy<copy_const_reference>())
157      .def("isEmpty",&escript::Data::isEmpty)      .def("isEmpty",&escript::Data::isEmpty)
158      .def("isProtected",&escript::Data::isProtected)      .def("isProtected",&escript::Data::isProtected)
159      .def("setProtection",&escript::Data::setProtection)      .def("setProtection",&escript::Data::setProtection)

Legend:
Removed from v.1871  
changed lines
  Added in v.1872

  ViewVC Help
Powered by ViewVC 1.1.26