/[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 474 by jgs, Mon Jan 30 04:23:44 2006 UTC revision 783 by gross, Tue Jul 18 01:32:50 2006 UTC
# Line 1  Line 1 
1  //$Id$  //$Id$
2  /*=============================================================================  /*
3     ************************************************************
4   ******************************************************************************   *          Copyright 2006 by ACcESS MNRF                   *
5   *                                                                            *   *                                                          *
6   *       COPYRIGHT ACcESS 2004 -  All Rights Reserved                         *   *              http://www.access.edu.au                    *
7   *                                                                            *   *       Primary Business: Queensland, Australia            *
8   * This software is the property of ACcESS.  No part of this code             *   *  Licensed under the Open Software License version 3.0    *
9   * may be copied in any form or by any means without the expressed written    *   *     http://www.opensource.org/licenses/osl-3.0.php       *
10   * consent of ACcESS.  Copying, use or modification of this software          *   *                                                          *
11   * by any unauthorised person is illegal unless that                          *   ************************************************************
12   * person has a software license agreement with ACcESS.                       *  */
  *                                                                            *  
  ******************************************************************************  
   
 ******************************************************************************/  
13    
14  #include "Data.h"  #include "Data.h"
 #include "DataVariable.h"  
15  #include "FunctionSpace.h"  #include "FunctionSpace.h"
16  #include "FunctionSpaceFactory.h"  #include "FunctionSpaceFactory.h"
17  #include "DataFactory.h"  #include "DataFactory.h"
18  #include "AbstractContinuousDomain.h"  #include "AbstractContinuousDomain.h"
19  #include "AbstractDomain.h"  #include "AbstractDomain.h"
20  #include "Utils.h"  #include "Utils.h"
21    #include "AbstractSystemMatrix.h"
22    
23  #include "esysExceptionTranslator.h"  #include "esysUtils/esysExceptionTranslator.h"
24    
25  #include <boost/python.hpp>  #include <boost/python.hpp>
26  #include <boost/python/module.hpp>  #include <boost/python/module.hpp>
# Line 101  BOOST_PYTHON_MODULE(escriptcpp) Line 97  BOOST_PYTHON_MODULE(escriptcpp)
97       .def("getX",&escript::FunctionSpace::getX)       .def("getX",&escript::FunctionSpace::getX)
98       .def("getNormal",&escript::FunctionSpace::getNormal)       .def("getNormal",&escript::FunctionSpace::getNormal)
99       .def("getSize",&escript::FunctionSpace::getSize)       .def("getSize",&escript::FunctionSpace::getSize)
100         .def("setTags",&escript::FunctionSpace::setTags)
101       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)       .def("getTagFromDataPointNo",&escript::FunctionSpace::getTagFromDataPointNo)
102       .def("__str__",&escript::FunctionSpace::toString)       .def("__str__",&escript::FunctionSpace::toString)
103       .def(self == self)       .def(self == self)
104       .def(self != self);       .def(self != self);
   
   //  
   // Interface for DataVariable  
   //  
   class_<escript::DataVariable>("DataVariable",init<>())  
     .def(init<escript::Data*>())  
     .def("evaluate",&escript::DataVariable::evaluate)  
     .def("sum",&escript::DataVariable::sum)  
     .def("diff",&escript::DataVariable::diff);  
   
105    //    //
106    // Interface for Data    // Interface for Data
107    //    //
# Line 131  BOOST_PYTHON_MODULE(escriptcpp) Line 118  BOOST_PYTHON_MODULE(escriptcpp)
118      .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())      .def("getDomain",&escript::Data::getDomain,return_internal_reference<>())
119      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_internal_reference<>())      .def("getFunctionSpace",&escript::Data::getFunctionSpace,return_internal_reference<>())
120      .def("isEmpty",&escript::Data::isEmpty)      .def("isEmpty",&escript::Data::isEmpty)
121        .def("isProtected",&escript::Data::isProtected)
122        .def("setProtection",&escript::Data::setProtection)
123      .def("getShape",&escript::Data::getShapeTuple)      .def("getShape",&escript::Data::getShapeTuple)
124      .def("getRank",&escript::Data::getDataPointRank)      .def("getRank",&escript::Data::getDataPointRank)
125      .def("copyWithMask",&escript::Data::copyWithMask)      .def("copyWithMask",&escript::Data::copyWithMask)
# Line 146  BOOST_PYTHON_MODULE(escriptcpp) Line 135  BOOST_PYTHON_MODULE(escriptcpp)
135      .def("fillFromNumArray",&escript::Data::fillFromNumArray)      .def("fillFromNumArray",&escript::Data::fillFromNumArray)
136      .def("interpolate",&escript::Data::interpolate)      .def("interpolate",&escript::Data::interpolate)
137      .def("mindp",&escript::Data::mindp)      .def("mindp",&escript::Data::mindp)
   
138      .def("saveDX",&escript::Data::saveDX)      .def("saveDX",&escript::Data::saveDX)
139      .def("saveVTK",&escript::Data::saveVTK)      .def("saveVTK",&escript::Data::saveVTK)
140      .def("getTagNumber",&escript::Data::getTagNumber)      .def("getTagNumber",&escript::Data::getTagNumber)
# Line 164  BOOST_PYTHON_MODULE(escriptcpp) Line 152  BOOST_PYTHON_MODULE(escriptcpp)
152      .def("_whereNegative",&escript::Data::whereNegative)      .def("_whereNegative",&escript::Data::whereNegative)
153      .def("_whereNonNegative",&escript::Data::whereNonNegative)      .def("_whereNonNegative",&escript::Data::whereNonNegative)
154      .def("_whereNonPositive",&escript::Data::whereNonPositive)      .def("_whereNonPositive",&escript::Data::whereNonPositive)
155      .def("_whereZero",&escript::Data::whereZero)      .def("_whereZero",&escript::Data::whereZero,(arg("tol")=0.0))
156      .def("_whereNonZero",&escript::Data::whereNonZero)      .def("_whereNonZero",&escript::Data::whereNonZero,(arg("tol")=0.0))
157      .def("_sin",&escript::Data::sin)      .def("_sin",&escript::Data::sin)
158      .def("_cos",&escript::Data::cos)      .def("_cos",&escript::Data::cos)
159      .def("_tan",&escript::Data::tan)      .def("_tan",&escript::Data::tan)
# Line 183  BOOST_PYTHON_MODULE(escriptcpp) Line 171  BOOST_PYTHON_MODULE(escriptcpp)
171      .def("_log10",&escript::Data::log10)      .def("_log10",&escript::Data::log10)
172      .def("_log",&escript::Data::log)      .def("_log",&escript::Data::log)
173      .def("_sign",&escript::Data::sign)      .def("_sign",&escript::Data::sign)
174        .def("_symmetric",&escript::Data::symmetric)
175        .def("_nonsymmetric",&escript::Data::nonsymmetric)
176        .def("_matrixtrace",&escript::Data::matrixtrace)
177        .def("_eigenvalues",&escript::Data::eigenvalues)
178        .def("_eigenvalues_and_eigenvectors",&escript::Data::eigenvalues_and_eigenvectors,(arg("tol")=1.e-13))
179      // functions returning a single real number:      // functions returning a single real number:
180      .def("_Lsup",&escript::Data::Lsup)      .def("_Lsup",&escript::Data::Lsup)
181      .def("_sup",&escript::Data::sup)      .def("_sup",&escript::Data::sup)
# Line 202  BOOST_PYTHON_MODULE(escriptcpp) Line 195  BOOST_PYTHON_MODULE(escriptcpp)
195      // following two functions implement the python ** operator      // following two functions implement the python ** operator
196      .def("__pow__",&escript::Data::powO)      .def("__pow__",&escript::Data::powO)
197      .def("__pow__",&escript::Data::powD)      .def("__pow__",&escript::Data::powD)
198        .def("__rpow__",&escript::Data::rpowO)
199      // NOTE:: The order of these declarations is important. Anything      // NOTE:: The order of these declarations is important. Anything
200      // declared before the generic declaration isn't found so the generic      // declared before the generic declaration isn't found so the generic
201      // version will be called.      // version will be called.

Legend:
Removed from v.474  
changed lines
  Added in v.783

  ViewVC Help
Powered by ViewVC 1.1.26