/[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 1137 by gross, Thu May 10 08:11:31 2007 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
1  //$Id$  
2  /*  /* $Id$ */
3   ************************************************************  
4   *          Copyright 2006 by ACcESS MNRF                   *  /*******************************************************
5   *                                                          *   *
6   *              http://www.access.edu.au                    *   *           Copyright 2003-2007 by ACceSS MNRF
7   *       Primary Business: Queensland, Australia            *   *       Copyright 2007 by University of Queensland
8   *  Licensed under the Open Software License version 3.0    *   *
9   *     http://www.opensource.org/licenses/osl-3.0.php       *   *                http://esscc.uq.edu.au
10   *                                                          *   *        Primary Business: Queensland, Australia
11   ************************************************************   *  Licensed under the Open Software License version 3.0
12  */   *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  #include "Data.h"  #include "Data.h"
17  #include "FunctionSpace.h"  #include "FunctionSpace.h"
# Line 21  Line 23 
23  #include "AbstractSystemMatrix.h"  #include "AbstractSystemMatrix.h"
24  #include "DataVector.h"  #include "DataVector.h"
25    
26    extern "C" {
27    #include "escript/blocktimer.h"
28    }
29    
30  #include "esysUtils/esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
31    
32  #include <boost/python.hpp>  #include <boost/python.hpp>
# Line 71  BOOST_PYTHON_MODULE(escriptcpp) Line 77  BOOST_PYTHON_MODULE(escriptcpp)
77    def("setNumberOfThreads",escript::setNumberOfThreads);    def("setNumberOfThreads",escript::setNumberOfThreads);
78    def("getNumberOfThreads",escript::getNumberOfThreads);    def("getNumberOfThreads",escript::getNumberOfThreads);
79    def("releaseUnusedMemory",escript::releaseUnusedMemory);    def("releaseUnusedMemory",escript::releaseUnusedMemory);
80      def("blocktimer_initialize",blocktimer_initialize);
81      def("blocktimer_reportSortByName",blocktimer_reportSortByName);
82      def("blocktimer_reportSortByTime",blocktimer_reportSortByTime);
83      def("blocktimer_increment",blocktimer_increment);
84      def("blocktimer_time",blocktimer_time);
85      def("blocktimer_reportSystemInfo",blocktimer_reportSystemInfo);
86      def("getVersion",escript::getSvnVersion);
87    
88    
89    //    //
90    // Interface for AbstractDomain    // Interface for AbstractDomain
91    //    //
92    class_<escript::AbstractDomain>("Domain",no_init)    class_<escript::AbstractDomain>("Domain",no_init)
      .def("__str__",&escript::AbstractDomain::str)  
93       .def("setTagMap",&escript::AbstractDomain::setTagMap)       .def("setTagMap",&escript::AbstractDomain::setTagMap)
94       .def("getTag",&escript::AbstractDomain::getTag)       .def("getTag",&escript::AbstractDomain::getTag)
95       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)
# Line 87  BOOST_PYTHON_MODULE(escriptcpp) Line 99  BOOST_PYTHON_MODULE(escriptcpp)
99       .def("getSize",&escript::AbstractDomain::getSize)       .def("getSize",&escript::AbstractDomain::getSize)
100       .def("saveVTK",&escript::AbstractDomain::saveVTK)       .def("saveVTK",&escript::AbstractDomain::saveVTK)
101       .def("saveDX",&escript::AbstractDomain::saveDX)       .def("saveDX",&escript::AbstractDomain::saveDX)
102         .def("getMPISize",&escript::AbstractDomain::getMPISize)
103         .def("getMPIRank",&escript::AbstractDomain::getMPIRank)
104    
105       .def(self == self)       .def(self == self)
106       .def(self != self);       .def(self != self);
107    
# Line 107  BOOST_PYTHON_MODULE(escriptcpp) Line 122  BOOST_PYTHON_MODULE(escriptcpp)
122       .def("getSize",&escript::FunctionSpace::getSize)       .def("getSize",&escript::FunctionSpace::getSize)
123       .def("setTags",&escript::FunctionSpace::setTags)       .def("setTags",&escript::FunctionSpace::setTags)
124       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)
125       .def("__str__",&escript::FunctionSpace::str)       .def("__str__",&escript::FunctionSpace::toString)
126       .def(self == self)       .def(self == self)
127       .def(self != self);       .def(self != self);
128    //    //
# Line 122  BOOST_PYTHON_MODULE(escriptcpp) Line 137  BOOST_PYTHON_MODULE(escriptcpp)
137      .def(init<const escript::Data&>())      .def(init<const escript::Data&>())
138      // 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
139      // reference. In this case return_internal_reference.      // reference. In this case return_internal_reference.
140      .def("__str__",&escript::Data::str)      .def("__str__",&escript::Data::toString)
141      .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())      .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())
142      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_internal_reference<>())      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_internal_reference<>())
143      .def("isEmpty",&escript::Data::isEmpty)      .def("isEmpty",&escript::Data::isEmpty)
# Line 135  BOOST_PYTHON_MODULE(escriptcpp) Line 150  BOOST_PYTHON_MODULE(escriptcpp)
150      .def("setTaggedValue",&escript::Data::setTaggedValue)      .def("setTaggedValue",&escript::Data::setTaggedValue)
151      .def("setTaggedValue",&escript::Data::setTaggedValueByName)      .def("setTaggedValue",&escript::Data::setTaggedValueByName)
152      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)
153        .def("isExpanded",&escript::Data::isExpanded)
154        .def("isTagged",&escript::Data::isTagged)
155      .def("expand",&escript::Data::expand)      .def("expand",&escript::Data::expand)
156      .def("tag",&escript::Data::tag)      .def("tag",&escript::Data::tag)
157      .def("copy",&escript::Data::copy)      .def("copy",&escript::Data::copy)

Legend:
Removed from v.1137  
changed lines
  Added in v.1312

  ViewVC Help
Powered by ViewVC 1.1.26