/[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 1034 by gross, Wed Mar 14 23:49:20 2007 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1  //$Id$  
2  /*  /*******************************************************
3   ************************************************************  *
4   *          Copyright 2006 by ACcESS MNRF                   *  * Copyright (c) 2003-2008 by University of Queensland
5   *                                                          *  * Earth Systems Science Computational Center (ESSCC)
6   *              http://www.access.edu.au                    *  * http://www.uq.edu.au/esscc
7   *       Primary Business: Queensland, Australia            *  *
8   *  Licensed under the Open Software License version 3.0    *  * Primary Business: Queensland, Australia
9   *     http://www.opensource.org/licenses/osl-3.0.php       *  * Licensed under the Open Software License version 3.0
10   *                                                          *  * http://www.opensource.org/licenses/osl-3.0.php
11   ************************************************************  *
12  */  *******************************************************/
13    
14    
15  #include "Data.h"  #include "Data.h"
16  #include "FunctionSpace.h"  #include "FunctionSpace.h"
# Line 19  Line 20 
20  #include "AbstractDomain.h"  #include "AbstractDomain.h"
21  #include "Utils.h"  #include "Utils.h"
22  #include "AbstractSystemMatrix.h"  #include "AbstractSystemMatrix.h"
23    #include "AbstractTransportProblem.h"
24  #include "DataVector.h"  #include "DataVector.h"
25    #include "paso/Paso_MPI.h"
26    
27    extern "C" {
28    #include "escript/blocktimer.h"
29    }
30    
31  #include "esysUtils/esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
32    
# Line 71  BOOST_PYTHON_MODULE(escriptcpp) Line 78  BOOST_PYTHON_MODULE(escriptcpp)
78    def("setNumberOfThreads",escript::setNumberOfThreads);    def("setNumberOfThreads",escript::setNumberOfThreads);
79    def("getNumberOfThreads",escript::getNumberOfThreads);    def("getNumberOfThreads",escript::getNumberOfThreads);
80    def("releaseUnusedMemory",escript::releaseUnusedMemory);    def("releaseUnusedMemory",escript::releaseUnusedMemory);
81      def("blocktimer_initialize",blocktimer_initialize);
82      def("blocktimer_reportSortByName",blocktimer_reportSortByName);
83      def("blocktimer_reportSortByTime",blocktimer_reportSortByTime);
84      def("blocktimer_increment",blocktimer_increment);
85      def("blocktimer_time",blocktimer_time);
86      def("getVersion",escript::getSvnVersion);
87      def("printParallelThreadCounts",escript::printParallelThreadCnt);
88      def("getMPISizeWorld",escript::getMPISizeWorld);
89      def("getMPIRankWorld",escript::getMPIRankWorld);
90    
91    
92    //    //
93    // Interface for AbstractDomain    // Interface for AbstractDomain
94    //    //
95    class_<escript::AbstractDomain>("Domain",no_init)    class_<escript::AbstractDomain>("Domain",no_init)
96         .def("setTagMap",&escript::AbstractDomain::setTagMap)
97         .def("getTag",&escript::AbstractDomain::getTag)
98         .def("isValidTagName",&escript::AbstractDomain::isValidTagName)
99         .def("showTagNames",&escript::AbstractDomain::showTagNames)
100       .def("getX",&escript::AbstractDomain::getX)       .def("getX",&escript::AbstractDomain::getX)
101         .def("getDim",&escript::AbstractDomain::getDim)
102       .def("getNormal",&escript::AbstractDomain::getNormal)       .def("getNormal",&escript::AbstractDomain::getNormal)
103       .def("getSize",&escript::AbstractDomain::getSize)       .def("getSize",&escript::AbstractDomain::getSize)
104       .def("saveVTK",&escript::AbstractDomain::saveVTK)       .def("saveVTK",&escript::AbstractDomain::saveVTK)
105       .def("saveDX",&escript::AbstractDomain::saveDX)       .def("saveDX",&escript::AbstractDomain::saveDX)
106         .def("getMPISize",&escript::AbstractDomain::getMPISize)
107         .def("getMPIRank",&escript::AbstractDomain::getMPIRank)
108    
109       .def(self == self)       .def(self == self)
110       .def(self != self);       .def(self != self);
111    
# Line 94  BOOST_PYTHON_MODULE(escriptcpp) Line 118  BOOST_PYTHON_MODULE(escriptcpp)
118    //    //
119    // Interface for FunctionSpace    // Interface for FunctionSpace
120    //    //
121    class_<escript::FunctionSpace>("FunctionSpace",init<>())    class_<escript::FunctionSpace> fs_definer("FunctionSpace",init<>());
122       .def("getDim",&escript::FunctionSpace::getDim)    fs_definer.def("getDim",&escript::FunctionSpace::getDim);
123       .def("getDomain",&escript::FunctionSpace::getDomain,return_internal_reference<>())    fs_definer.def("getDomain",&escript::FunctionSpace::getDomain,
124       .def("getX",&escript::FunctionSpace::getX)                   return_internal_reference<>());
125       .def("getNormal",&escript::FunctionSpace::getNormal)    fs_definer.def("getX",&escript::FunctionSpace::getX);
126       .def("getSize",&escript::FunctionSpace::getSize)    fs_definer.def("getNormal",&escript::FunctionSpace::getNormal);
127       .def("setTags",&escript::FunctionSpace::setTags)    fs_definer.def("getSize",&escript::FunctionSpace::getSize);
128       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)    fs_definer.def("setTags",&escript::FunctionSpace::setTags);
129       .def("__str__",&escript::FunctionSpace::toString)    fs_definer.def("getTagFromDataPointNo",
130       .def(self == self)                   &escript::FunctionSpace::getTagFromDataPointNo);
131       .def(self != self);    fs_definer.def("getReferenceIDFromDataPointNo", &escript::FunctionSpace::getReferenceIDFromDataPointNo);
132      fs_definer.def("getListOfTags",&escript::FunctionSpace::getListOfTags);
133      fs_definer.def("__str__", &escript::FunctionSpace::toString);
134      fs_definer.def(self == self);
135      fs_definer.def(self != self);
136    //    //
137    // Interface for Data    // Interface for Data
138    //    //
# Line 128  BOOST_PYTHON_MODULE(escriptcpp) Line 156  BOOST_PYTHON_MODULE(escriptcpp)
156      .def("dump",&escript::Data::dump)      .def("dump",&escript::Data::dump)
157      .def("copyWithMask",&escript::Data::copyWithMask)      .def("copyWithMask",&escript::Data::copyWithMask)
158      .def("setTaggedValue",&escript::Data::setTaggedValue)      .def("setTaggedValue",&escript::Data::setTaggedValue)
159        .def("setTaggedValue",&escript::Data::setTaggedValueByName)
160      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)      .def("getNumberOfDataPoints",&escript::Data::getNumDataPoints)
161        .def("isExpanded",&escript::Data::isExpanded)
162        .def("isTagged",&escript::Data::isTagged)
163      .def("expand",&escript::Data::expand)      .def("expand",&escript::Data::expand)
164      .def("tag",&escript::Data::tag)      .def("tag",&escript::Data::tag)
165      .def("copy",&escript::Data::copy)      .def("copy",&escript::Data::copy)
166        .def("copy",&escript::Data::copySelf,return_value_policy<manage_new_object>())
167      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToPyObject)
168      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPointToArray)
169      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)      .def("setValueOfDataPoint",&escript::Data::setValueOfDataPoint)
170      .def("getValueOfDataPoint",&escript::Data::getValueOfDataPoint)      .def("getValueOfDataPoint",&escript::Data::getValueOfDataPoint)
171      .def("getValueOfGlobalDataPoint",&escript::Data::getValueOfGlobalDataPoint)      .def("getValueOfGlobalDataPoint",&escript::Data::getValueOfGlobalDataPoint)
172        .def("setToZero",&escript::Data::setToZero)
173      .def("interpolate",&escript::Data::interpolate)      .def("interpolate",&escript::Data::interpolate)
174      .def("minGlobalDataPoint",&escript::Data::minGlobalDataPoint)      .def("minGlobalDataPoint",&escript::Data::minGlobalDataPoint)
175      .def("saveDX",&escript::Data::saveDX)      .def("saveDX",&escript::Data::saveDX)
176      .def("saveVTK",&escript::Data::saveVTK)      .def("saveVTK",&escript::Data::saveVTK)
177      .def("getTagNumber",&escript::Data::getTagNumber)      .def("getTagNumber",&escript::Data::getTagNumber)
     .def("archiveData",&escript::Data::archiveData)  
     .def("extractData",&escript::Data::extractData)  
178      // Unary functions for Data      // Unary functions for Data
179      .def("_interpolate",&escript::Data::interpolate)      .def("_interpolate",&escript::Data::interpolate)
180      .def("_grad",&escript::Data::gradOn)      .def("_grad",&escript::Data::gradOn)
# Line 236  BOOST_PYTHON_MODULE(escriptcpp) Line 267  BOOST_PYTHON_MODULE(escriptcpp)
267    // Factory methods for function space    // Factory methods for function space
268    //    //
269    def("ContinuousFunction",escript::continuousFunction);    def("ContinuousFunction",escript::continuousFunction);
270      def("ReducedContinuousFunction",escript::reducedContinuousFunction);
271    def("Function",escript::function);    def("Function",escript::function);
272      def("ReducedFunction",escript::reducedFunction);
273    def("FunctionOnBoundary",escript::functionOnBoundary);    def("FunctionOnBoundary",escript::functionOnBoundary);
274      def("ReducedFunctionOnBoundary",escript::reducedFunctionOnBoundary);
275    def("FunctionOnContactZero",escript::functionOnContactZero);    def("FunctionOnContactZero",escript::functionOnContactZero);
276      def("ReducedFunctionOnContactZero",escript::reducedFunctionOnContactZero);
277    def("FunctionOnContactOne",escript::functionOnContactOne);    def("FunctionOnContactOne",escript::functionOnContactOne);
278      def("ReducedFunctionOnContactOne",escript::reducedFunctionOnContactOne);
279    def("Solution",escript::solution);    def("Solution",escript::solution);
280    def("ReducedSolution",escript::reducedSolution);    def("ReducedSolution",escript::reducedSolution);
281    def("DiracDeltaFunction",escript::diracDeltaFunction);    def("DiracDeltaFunction",escript::diracDeltaFunction);
# Line 290  BOOST_PYTHON_MODULE(escriptcpp) Line 326  BOOST_PYTHON_MODULE(escriptcpp)
326       .def("saveHB",&escript::AbstractSystemMatrix::saveHB)       .def("saveHB",&escript::AbstractSystemMatrix::saveHB)
327       .def("resetValues",&escript::AbstractSystemMatrix::resetValues)       .def("resetValues",&escript::AbstractSystemMatrix::resetValues)
328       .def(self*other<escript::Data>());       .def(self*other<escript::Data>());
329      //
330      // Interface for AbstractTransportProblem
331      //
332      class_<escript::AbstractTransportProblem>("TransportProblem",init<>())
333         .def("isEmpty",&escript::AbstractTransportProblem::isEmpty)
334         .def("solve",&escript::AbstractTransportProblem::solve)
335         .def("setInitialValue",&escript::AbstractTransportProblem::setInitialValue)
336         .def("insertConstraint",&escript::AbstractTransportProblem::insertConstraint)
337         .def("reset",&escript::AbstractTransportProblem::resetTransport)
338         .def("getSafeTimeStepSize",&escript::AbstractTransportProblem::getSafeTimeStepSize);
339    
340    //    //
341    // Register esysExceptionTranslator    // Register esysExceptionTranslator

Legend:
Removed from v.1034  
changed lines
  Added in v.1811

  ViewVC Help
Powered by ViewVC 1.1.26