/[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 2060 by jfenwick, Mon Nov 10 01:21:39 2008 UTC revision 2061 by jfenwick, Wed Nov 19 03:40:21 2008 UTC
# Line 78  using namespace boost::python; Line 78  using namespace boost::python;
78    
79  BOOST_PYTHON_MODULE(escriptcpp)  BOOST_PYTHON_MODULE(escriptcpp)
80  {  {
81      // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
82      docstring_options docopt(true, true, false);
83    
84    
85    def("setNumberOfThreads",escript::setNumberOfThreads);    def("setNumberOfThreads",escript::setNumberOfThreads);
86    def("getNumberOfThreads",escript::getNumberOfThreads);    def("getNumberOfThreads",escript::getNumberOfThreads);
87    def("releaseUnusedMemory",escript::releaseUnusedMemory);    def("releaseUnusedMemory",escript::releaseUnusedMemory);
# Line 95  BOOST_PYTHON_MODULE(escriptcpp) Line 99  BOOST_PYTHON_MODULE(escriptcpp)
99    //    //
100    // Interface for AbstractDomain    // Interface for AbstractDomain
101    //    //
102    class_<escript::AbstractDomain, escript::Domain_ptr>("Domain",no_init)    class_<escript::AbstractDomain, escript::Domain_ptr>("Domain","Base class for all domains.",no_init)
103       .def("setTagMap",&escript::AbstractDomain::setTagMap)       .def("setTagMap",&escript::AbstractDomain::setTagMap)
104       .def("getTag",&escript::AbstractDomain::getTag)       .def("getTag",&escript::AbstractDomain::getTag)
105       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)
# Line 117  BOOST_PYTHON_MODULE(escriptcpp) Line 121  BOOST_PYTHON_MODULE(escriptcpp)
121    //    //
122    // Interface for AbstractContinuousDomain    // Interface for AbstractContinuousDomain
123    //    //
124    class_<escript::AbstractContinuousDomain, bases<escript::AbstractDomain> >("ContinuousDomain",no_init)    class_<escript::AbstractContinuousDomain, bases<escript::AbstractDomain> >("ContinuousDomain","Class representing continuous domains",no_init)
125         .def("getSystemMatrixTypeId",&escript::AbstractContinuousDomain::getSystemMatrixTypeId)         .def("getSystemMatrixTypeId",&escript::AbstractContinuousDomain::getSystemMatrixTypeId)
126         .def("getTransportTypeId",&escript::AbstractContinuousDomain::getTransportTypeId);         .def("getTransportTypeId",&escript::AbstractContinuousDomain::getTransportTypeId);
127    
128    //    //
129    // Interface for FunctionSpace    // Interface for FunctionSpace
130    //    //
131    class_<escript::FunctionSpace> fs_definer("FunctionSpace",init<>());    class_<escript::FunctionSpace> fs_definer("FunctionSpace","",init<>());   // Doco goes in the empty string param
132    fs_definer.def("getDim",&escript::FunctionSpace::getDim);    fs_definer.def("getDim",&escript::FunctionSpace::getDim);
133  //   fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,  //   fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,
134  //                  return_internal_reference<>());  //                  return_internal_reference<>());
# Line 143  BOOST_PYTHON_MODULE(escriptcpp) Line 147  BOOST_PYTHON_MODULE(escriptcpp)
147    //    //
148    // Interface for Data    // Interface for Data
149    //    //
150    class_<escript::Data>("Data","TEST DOCUMENTATION",init<>() )    class_<escript::Data>("Data","Represents a collection of datapoints. It is used to store the values of a function. For more details please consult the c++ class documentation.",init<>() )
151      // various constructors for Data objects      // various constructors for Data objects
152      .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")))
153      .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 331  BOOST_PYTHON_MODULE(escriptcpp) Line 335  BOOST_PYTHON_MODULE(escriptcpp)
335    //    //
336    // Interface for AbstractSystemMatrix    // Interface for AbstractSystemMatrix
337    //    //
338    class_<escript::AbstractSystemMatrix>("Operator",init<>())    class_<escript::AbstractSystemMatrix>("Operator","",init<>())    // Doco goes in the empty string param
339       .def("isEmpty",&escript::AbstractSystemMatrix::isEmpty)       .def("isEmpty",&escript::AbstractSystemMatrix::isEmpty)
340       .def("solve",&escript::AbstractSystemMatrix::solve)       .def("solve",&escript::AbstractSystemMatrix::solve)
341       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)       .def("of",&escript::AbstractSystemMatrix::vectorMultiply)
# Line 342  BOOST_PYTHON_MODULE(escriptcpp) Line 346  BOOST_PYTHON_MODULE(escriptcpp)
346    //    //
347    // Interface for AbstractTransportProblem    // Interface for AbstractTransportProblem
348    //    //
349    class_<escript::AbstractTransportProblem>("TransportProblem",init<>())    class_<escript::AbstractTransportProblem>("TransportProblem","",init<>())    // Doco goes in the empty string param
350       .def("isEmpty",&escript::AbstractTransportProblem::isEmpty)       .def("isEmpty",&escript::AbstractTransportProblem::isEmpty)
351       .def("solve",&escript::AbstractTransportProblem::solve)       .def("solve",&escript::AbstractTransportProblem::solve)
352       .def("setInitialValue",&escript::AbstractTransportProblem::setInitialValue)       .def("setInitialValue",&escript::AbstractTransportProblem::setInitialValue)

Legend:
Removed from v.2060  
changed lines
  Added in v.2061

  ViewVC Help
Powered by ViewVC 1.1.26