/[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 1044 by gross, Mon Mar 19 07:29:31 2007 UTC revision 1805 by ksteube, Wed Sep 24 23:39:00 2008 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 19  Line 21 
21  #include "AbstractDomain.h"  #include "AbstractDomain.h"
22  #include "Utils.h"  #include "Utils.h"
23  #include "AbstractSystemMatrix.h"  #include "AbstractSystemMatrix.h"
24    #include "AbstractTransportProblem.h"
25  #include "DataVector.h"  #include "DataVector.h"
26    #include "paso/Paso_MPI.h"
27    
28    extern "C" {
29    #include "escript/blocktimer.h"
30    }
31    
32  #include "esysUtils/esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
33    
# Line 71  BOOST_PYTHON_MODULE(escriptcpp) Line 79  BOOST_PYTHON_MODULE(escriptcpp)
79    def("setNumberOfThreads",escript::setNumberOfThreads);    def("setNumberOfThreads",escript::setNumberOfThreads);
80    def("getNumberOfThreads",escript::getNumberOfThreads);    def("getNumberOfThreads",escript::getNumberOfThreads);
81    def("releaseUnusedMemory",escript::releaseUnusedMemory);    def("releaseUnusedMemory",escript::releaseUnusedMemory);
82      def("blocktimer_initialize",blocktimer_initialize);
83      def("blocktimer_reportSortByName",blocktimer_reportSortByName);
84      def("blocktimer_reportSortByTime",blocktimer_reportSortByTime);
85      def("blocktimer_increment",blocktimer_increment);
86      def("blocktimer_time",blocktimer_time);
87      def("getVersion",escript::getSvnVersion);
88      def("printParallelThreadCounts",escript::printParallelThreadCnt);
89      def("getMPISizeWorld",escript::getMPISizeWorld);
90      def("getMPIRankWorld",escript::getMPIRankWorld);
91    
92    
93    //    //
# Line 82  BOOST_PYTHON_MODULE(escriptcpp) Line 99  BOOST_PYTHON_MODULE(escriptcpp)
99       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)       .def("isValidTagName",&escript::AbstractDomain::isValidTagName)
100       .def("showTagNames",&escript::AbstractDomain::showTagNames)       .def("showTagNames",&escript::AbstractDomain::showTagNames)
101       .def("getX",&escript::AbstractDomain::getX)       .def("getX",&escript::AbstractDomain::getX)
102         .def("getDim",&escript::AbstractDomain::getDim)
103       .def("getNormal",&escript::AbstractDomain::getNormal)       .def("getNormal",&escript::AbstractDomain::getNormal)
104       .def("getSize",&escript::AbstractDomain::getSize)       .def("getSize",&escript::AbstractDomain::getSize)
105       .def("saveVTK",&escript::AbstractDomain::saveVTK)       .def("saveVTK",&escript::AbstractDomain::saveVTK)
106       .def("saveDX",&escript::AbstractDomain::saveDX)       .def("saveDX",&escript::AbstractDomain::saveDX)
107         .def("getMPISize",&escript::AbstractDomain::getMPISize)
108         .def("getMPIRank",&escript::AbstractDomain::getMPIRank)
109    
110       .def(self == self)       .def(self == self)
111       .def(self != self);       .def(self != self);
112    
# Line 98  BOOST_PYTHON_MODULE(escriptcpp) Line 119  BOOST_PYTHON_MODULE(escriptcpp)
119    //    //
120    // Interface for FunctionSpace    // Interface for FunctionSpace
121    //    //
122    class_<escript::FunctionSpace>("FunctionSpace",init<>())    class_<escript::FunctionSpace> fs_definer("FunctionSpace",init<>());
123       .def("getDim",&escript::FunctionSpace::getDim)    fs_definer.def("getDim",&escript::FunctionSpace::getDim);
124       .def("getDomain",&escript::FunctionSpace::getDomain,return_internal_reference<>())    fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,
125       .def("getX",&escript::FunctionSpace::getX)                   return_internal_reference<>());
126       .def("getNormal",&escript::FunctionSpace::getNormal)    fs_definer.def("getX",&escript::FunctionSpace::getX);
127       .def("getSize",&escript::FunctionSpace::getSize)    fs_definer.def("getNormal",&escript::FunctionSpace::getNormal);
128       .def("setTags",&escript::FunctionSpace::setTags)    fs_definer.def("getSize",&escript::FunctionSpace::getSize);
129       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)    fs_definer.def("setTags",&escript::FunctionSpace::setTags);
130       .def("__str__",&escript::FunctionSpace::toString)    fs_definer.def("getTagFromDataPointNo",
131       .def(self == self)                   &escript::FunctionSpace::getTagFromDataPointNo);
132       .def(self != self);    fs_definer.def("getReferenceIDFromDataPointNo", &escript::FunctionSpace::getReferenceIDFromDataPointNo);
133      fs_definer.def("getListOfTags",&escript::FunctionSpace::getListOfTags);
134      fs_definer.def("__str__", &escript::FunctionSpace::toString);
135      fs_definer.def(self == self);
136      fs_definer.def(self != self);
137    //    //
138    // Interface for Data    // Interface for Data
139    //    //
# Line 134  BOOST_PYTHON_MODULE(escriptcpp) Line 159  BOOST_PYTHON_MODULE(escriptcpp)
159      .def("setTaggedValue",&escript::Data::setTaggedValue)      .def("setTaggedValue",&escript::Data::setTaggedValue)
160      .def("setTaggedValue",&escript::Data::setTaggedValueByName)      .def("setTaggedValue",&escript::Data::setTaggedValueByName)
161      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)
162        .def("isExpanded",&escript::Data::isExpanded)
163        .def("isTagged",&escript::Data::isTagged)
164      .def("expand",&escript::Data::expand)      .def("expand",&escript::Data::expand)
165      .def("tag",&escript::Data::tag)      .def("tag",&escript::Data::tag)
166      .def("copy",&escript::Data::copy)      .def("copy",&escript::Data::copy)
167        .def("copy",&escript::Data::copySelf,return_value_policy<manage_new_object>())
168      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)
169      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)
170      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)
171      .def("getValueOfDataPoint",&escript::Data::getValueOfDataPoint)      .def("getValueOfDataPoint",&escript::Data::getValueOfDataPoint)
172      .def("getValueOfGlobalDataPoint",&escript::Data::getValueOfGlobalDataPoint)      .def("getValueOfGlobalDataPoint",&escript::Data::getValueOfGlobalDataPoint)
173        .def("setToZero",&escript::Data::setToZero)
174      .def("interpolate",&escript::Data::interpolate)      .def("interpolate",&escript::Data::interpolate)
175      .def("minGlobalDataPoint",&escript::Data::minGlobalDataPoint)      .def("minGlobalDataPoint",&escript::Data::minGlobalDataPoint)
176      .def("saveDX",&escript::Data::saveDX)      .def("saveDX",&escript::Data::saveDX)
177      .def("saveVTK",&escript::Data::saveVTK)      .def("saveVTK",&escript::Data::saveVTK)
178      .def("getTagNumber",&escript::Data::getTagNumber)      .def("getTagNumber",&escript::Data::getTagNumber)
     .def("archiveData",&escript::Data::archiveData)  
     .def("extractData",&escript::Data::extractData)  
179      // Unary functions for Data      // Unary functions for Data
180      .def("_interpolate",&escript::Data::interpolate)      .def("_interpolate",&escript::Data::interpolate)
181      .def("_grad",&escript::Data::gradOn)      .def("_grad",&escript::Data::gradOn)
# Line 241  BOOST_PYTHON_MODULE(escriptcpp) Line 268  BOOST_PYTHON_MODULE(escriptcpp)
268    // Factory methods for function space    // Factory methods for function space
269    //    //
270    def("ContinuousFunction",escript::continuousFunction);    def("ContinuousFunction",escript::continuousFunction);
271      def("ReducedContinuousFunction",escript::reducedContinuousFunction);
272    def("Function",escript::function);    def("Function",escript::function);
273      def("ReducedFunction",escript::reducedFunction);
274    def("FunctionOnBoundary",escript::functionOnBoundary);    def("FunctionOnBoundary",escript::functionOnBoundary);
275      def("ReducedFunctionOnBoundary",escript::reducedFunctionOnBoundary);
276    def("FunctionOnContactZero",escript::functionOnContactZero);    def("FunctionOnContactZero",escript::functionOnContactZero);
277      def("ReducedFunctionOnContactZero",escript::reducedFunctionOnContactZero);
278    def("FunctionOnContactOne",escript::functionOnContactOne);    def("FunctionOnContactOne",escript::functionOnContactOne);
279      def("ReducedFunctionOnContactOne",escript::reducedFunctionOnContactOne);
280    def("Solution",escript::solution);    def("Solution",escript::solution);
281    def("ReducedSolution",escript::reducedSolution);    def("ReducedSolution",escript::reducedSolution);
282    def("DiracDeltaFunction",escript::diracDeltaFunction);    def("DiracDeltaFunction",escript::diracDeltaFunction);
# Line 295  BOOST_PYTHON_MODULE(escriptcpp) Line 327  BOOST_PYTHON_MODULE(escriptcpp)
327       .def("saveHB",&escript::AbstractSystemMatrix::saveHB)       .def("saveHB",&escript::AbstractSystemMatrix::saveHB)
328       .def("resetValues",&escript::AbstractSystemMatrix::resetValues)       .def("resetValues",&escript::AbstractSystemMatrix::resetValues)
329       .def(self*other<escript::Data>());       .def(self*other<escript::Data>());
330      //
331      // Interface for AbstractTransportProblem
332      //
333      class_<escript::AbstractTransportProblem>("TransportProblem",init<>())
334         .def("isEmpty",&escript::AbstractTransportProblem::isEmpty)
335         .def("solve",&escript::AbstractTransportProblem::solve)
336         .def("setInitialValue",&escript::AbstractTransportProblem::setInitialValue)
337         .def("insertConstraint",&escript::AbstractTransportProblem::insertConstraint)
338         .def("reset",&escript::AbstractTransportProblem::resetTransport)
339         .def("getSafeTimeStepSize",&escript::AbstractTransportProblem::getSafeTimeStepSize);
340    
341    //    //
342    // Register esysExceptionTranslator    // Register esysExceptionTranslator

Legend:
Removed from v.1044  
changed lines
  Added in v.1805

  ViewVC Help
Powered by ViewVC 1.1.26