/[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 2271 by jfenwick, Mon Feb 16 05:08:29 2009 UTC revision 2459 by jfenwick, Thu Jun 4 06:17:54 2009 UTC
# Line 46  using namespace boost::python; Line 46  using namespace boost::python;
46    
47  /*! \mainpage Esys Documentation  /*! \mainpage Esys Documentation
48   *   *
49   * \version 1.0.0   * \version 2.9.0
50   *   *
51   * - \ref escript   * - \ref escript
52   *   *
# Line 54  using namespace boost::python; Line 54  using namespace boost::python;
54   *   *
55   * - \ref finley   * - \ref finley
56   *   *
57   * - <a href="http://shake200.esscc.uq.edu.au/esys/esys13/release/epydoc/index.html">Python module documentation (epydoc generated)</a>   * - <a href="../../epydoc/index.html">Python module documentation (epydoc generated)</a>
58   *   *
59   */   */
60    
# Line 62  using namespace boost::python; Line 62  using namespace boost::python;
62   * Escript is the python module that contains the interfaces   * Escript is the python module that contains the interfaces
63   * to the C++ side of escript.   * to the C++ side of escript.
64   *   *
65   * \version 1.0.0   *
66   *   *
67   * \section class_desc Class Description:   * \section class_desc Class Description:
68   * Data   * Data
# Line 101  BOOST_PYTHON_MODULE(escriptcpp) Line 101  BOOST_PYTHON_MODULE(escriptcpp)
101    def("printParallelThreadCounts",escript::printParallelThreadCnt);    def("printParallelThreadCounts",escript::printParallelThreadCnt);
102    def("getMPISizeWorld",escript::getMPISizeWorld);    def("getMPISizeWorld",escript::getMPISizeWorld);
103    def("getMPIRankWorld",escript::getMPIRankWorld);    def("getMPIRankWorld",escript::getMPIRankWorld);
104      def("MPIBarrierWorld",escript::MPIBarrierWorld);
105      def("getMPIWorldMax",escript::getMPIWorldMax);
106    def("getMachinePrecision",escript::getMachinePrecision);    def("getMachinePrecision",escript::getMachinePrecision);
107    def("getMaxFloat",escript::getMaxFloat);    def("getMaxFloat",escript::getMaxFloat);
108    //    //
# Line 116  BOOST_PYTHON_MODULE(escriptcpp) Line 118  BOOST_PYTHON_MODULE(escriptcpp)
118       .def("getNormal",&escript::AbstractDomain::getNormal)       .def("getNormal",&escript::AbstractDomain::getNormal)
119       .def("getSize",&escript::AbstractDomain::getSize)       .def("getSize",&escript::AbstractDomain::getSize)
120       .def("saveVTK",&escript::AbstractDomain::saveVTK)       .def("saveVTK",&escript::AbstractDomain::saveVTK)
121         .def("dump",&escript::AbstractDomain::dump)
122       .def("saveDX",&escript::AbstractDomain::saveDX)       .def("saveDX",&escript::AbstractDomain::saveDX)
123       .def("getMPISize",&escript::AbstractDomain::getMPISize)       .def("getMPISize",&escript::AbstractDomain::getMPISize)
124       .def("getMPIRank",&escript::AbstractDomain::getMPIRank)       .def("getMPIRank",&escript::AbstractDomain::getMPIRank)
# Line 156  BOOST_PYTHON_MODULE(escriptcpp) Line 159  BOOST_PYTHON_MODULE(escriptcpp)
159    //    //
160    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<>() )    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<>() )
161      // various constructors for Data objects      // various constructors for Data objects
 //    .def(init<const numeric::array&, optional<const escript::FunctionSpace&, bool> >(args("value","what","expand")))  
162      .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")))
163      .def(init<const double, const tuple&, optional<const escript::FunctionSpace&, bool> >(args("value","shape","what","expand")))      .def(init<const double, const tuple&, optional<const escript::FunctionSpace&, bool> >(args("value","shape","what","expand")))
164      .def(init<const escript::Data&, const escript::FunctionSpace&>(args("value","what")))      .def(init<const escript::Data&, const escript::FunctionSpace&>(args("value","what")))
# Line 164  BOOST_PYTHON_MODULE(escriptcpp) Line 166  BOOST_PYTHON_MODULE(escriptcpp)
166      // 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
167      // reference. In this case return_internal_reference.      // reference. In this case return_internal_reference.
168      .def("__str__",&escript::Data::toString)      .def("__str__",&escript::Data::toString)
 //     .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())  
169      .def("getDomain",&escript::Data::getDomainPython)      .def("getDomain",&escript::Data::getDomainPython)
170      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_value_policy<copy_const_reference>())      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_value_policy<copy_const_reference>())
171      .def("isEmpty",&escript::Data::isEmpty)      .def("isEmpty",&escript::Data::isEmpty)
# Line 173  BOOST_PYTHON_MODULE(escriptcpp) Line 174  BOOST_PYTHON_MODULE(escriptcpp)
174      .def("getShape",&escript::Data::getShapeTuple)      .def("getShape",&escript::Data::getShapeTuple)
175      .def("getRank",&escript::Data::getDataPointRank)      .def("getRank",&escript::Data::getDataPointRank)
176      .def("dump",&escript::Data::dump)      .def("dump",&escript::Data::dump)
177        .def("toListOfTuples",&escript::Data::toListOfTuples, (arg("scalarastuple")=false))
178      .def("copyWithMask",&escript::Data::copyWithMask)      .def("copyWithMask",&escript::Data::copyWithMask)
179      .def("setTaggedValue",&escript::Data::setTaggedValue)      .def("setTaggedValue",&escript::Data::setTaggedValue)
180      .def("setTaggedValue",&escript::Data::setTaggedValueByName)      .def("setTaggedValue",&escript::Data::setTaggedValueByName)
# Line 191  BOOST_PYTHON_MODULE(escriptcpp) Line 193  BOOST_PYTHON_MODULE(escriptcpp)
193      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)
194      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)
195      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)
     .def("getValueOfDataPoint",&escript::Data::getValueOfDataPoint)  
196      .def("getTupleForDataPoint",&escript::Data::getValueOfDataPointAsTuple)      .def("getTupleForDataPoint",&escript::Data::getValueOfDataPointAsTuple)
     .def("getValueOfGlobalDataPoint",&escript::Data::getValueOfGlobalDataPoint)  
197      .def("getTupleForGlobalDataPoint",&escript::Data::getValueOfGlobalDataPointAsTuple)      .def("getTupleForGlobalDataPoint",&escript::Data::getValueOfGlobalDataPointAsTuple)
198      .def("setToZero",&escript::Data::setToZero)      .def("setToZero",&escript::Data::setToZero)
199      .def("interpolate",&escript::Data::interpolate)      .def("interpolate",&escript::Data::interpolate)
# Line 243  BOOST_PYTHON_MODULE(escriptcpp) Line 243  BOOST_PYTHON_MODULE(escriptcpp)
243      .def("_Lsup",&escript::Data::Lsup)      .def("_Lsup",&escript::Data::Lsup)
244      .def("_sup",&escript::Data::sup)      .def("_sup",&escript::Data::sup)
245      .def("_inf",&escript::Data::inf)      .def("_inf",&escript::Data::inf)
     .def("_integrate",&escript::Data::integrate)  
246      .def("_integrateToTuple",&escript::Data::integrateToTuple)      .def("_integrateToTuple",&escript::Data::integrateToTuple)
247    
248      // following implements the python abs operator      // following implements the python abs operator

Legend:
Removed from v.2271  
changed lines
  Added in v.2459

  ViewVC Help
Powered by ViewVC 1.1.26