/[escript]/branches/dirac/finley/src/CPPAdapter/finleycpp.cpp
ViewVC logotype

Diff of /branches/dirac/finley/src/CPPAdapter/finleycpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1326 by ksteube, Mon Oct 1 08:10:41 2007 UTC revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  #ifdef PASO_MPI  #ifdef PASO_MPI
16  #include <mpi.h>  #include <mpi.h>
17    #include "paso/Paso_MPI.h"
18  #endif  #endif
19  extern "C" {  extern "C" {
20  #include "../Finley.h"  #include "../Finley.h"
# Line 23  extern "C" { Line 23  extern "C" {
23  #include "MeshAdapter.h"  #include "MeshAdapter.h"
24  #include "MeshAdapterFactory.h"  #include "MeshAdapterFactory.h"
25  #include "SystemMatrixAdapter.h"  #include "SystemMatrixAdapter.h"
26    #include "TransportProblemAdapter.h"
27    
28  #include "FinleyAdapterException.h"  #include "FinleyAdapterException.h"
29  // #include "esysUtils/EsysException.h"  // #include "esysUtils/EsysException.h"
# Line 78  using namespace boost::python; Line 79  using namespace boost::python;
79  BOOST_PYTHON_MODULE(finleycpp)  BOOST_PYTHON_MODULE(finleycpp)
80  {  {
81    
   // def("ReadMesh",finley::readMesh,readMesh_overloads());  
   // def("Brick",finley::brick,brick_overloads());  
   // def("Rectangle",finley::rectangle,rectangle_overloads());  
   // def("Interval",finley::interval,interval_overloads());  
   // def("GlueFaces",finley::glueFaces,glueFaces_overloads());  
   // def("JoinFaces",finley::joinFaces,joinFaces_overloads());  
82    //    //
83    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
84    // return pointers.    // return pointers.
85      //
86      register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));
87    
88    def("load",finley::loadMesh,    def("LoadMesh",finley::loadMesh,
89        (arg("fileName")="file.nc"),        (arg("fileName")="file.nc"),
90        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
91    def("ReadMesh",finley::readMesh,    def("ReadMesh",finley::readMesh,
# Line 135  BOOST_PYTHON_MODULE(finleycpp) Line 132  BOOST_PYTHON_MODULE(finleycpp)
132        arg("optimize")=true),        arg("optimize")=true),
133        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
134    
135    register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));  
136    
137    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >
138        ("MeshAdapter",init<optional <Finley_Mesh*> >())        ("MeshAdapter",init<optional <Finley_Mesh*> >())
139        .def(init<const finley::MeshAdapter&>())        .def(init<const finley::MeshAdapter&>())
140        .def("write",&finley::MeshAdapter::write)        .def("write",&finley::MeshAdapter::write)
141        .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info)        .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info,(arg("full")=false))
142        .def("dump",&finley::MeshAdapter::write)        .def("dump",&finley::MeshAdapter::dump)
143        .def("getDescription",&finley::MeshAdapter::getDescription)        .def("getDescription",&finley::MeshAdapter::getDescription)
144        .def("getDim",&finley::MeshAdapter::getDim)        .def("getDim",&finley::MeshAdapter::getDim)
145        .def("getDataShape",&finley::MeshAdapter::getDataShape)        .def("getDataShape",&finley::MeshAdapter::getDataShape)
146          .def("getNumDataPointsGlobal",&finley::MeshAdapter::getNumDataPointsGlobal)
147        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)
148        .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem)        .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem)
149        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)
150          .def("addPDEToTransportProblem",&finley::MeshAdapter::addPDEToTransportProblem)
151        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)
152          .def("newTransportProblem",&finley::MeshAdapter::newTransportProblem)
153        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)
154        .def("setX",&finley::MeshAdapter::setNewX)        .def("setX",&finley::MeshAdapter::setNewX)
155        .def("getX",&finley::MeshAdapter::getX)        .def("getX",&finley::MeshAdapter::getX)
# Line 166  BOOST_PYTHON_MODULE(finleycpp) Line 166  BOOST_PYTHON_MODULE(finleycpp)
166    
167    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >    class_<finley::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
168        ("OperatorAdapter",no_init)        ("OperatorAdapter",no_init)
169          .def("print_matrix_info",&finley::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false))
170        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)        .def("nullifyRowsAndCols",&finley::SystemMatrixAdapter::nullifyRowsAndCols)
171        .def("resetValues",&finley::SystemMatrixAdapter::resetValues)        .def("resetValues",&finley::SystemMatrixAdapter::resetValues)
172        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)
173        .def("saveHB",&finley::SystemMatrixAdapter::saveHB);        .def("saveHB",&finley::SystemMatrixAdapter::saveHB);
174    
175      class_<finley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
176          ("TransportProblemAdapter",no_init)
177          .def("getSafeTimeStepSize",&finley::TransportProblemAdapter::getSafeTimeStepSize)
178          .def("resetTransport",&finley::TransportProblemAdapter::resetTransport);
179  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26