/[escript]/trunk/dudley/src/CPPAdapter/dudleycpp.cpp
ViewVC logotype

Diff of /trunk/dudley/src/CPPAdapter/dudleycpp.cpp

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

revision 1339 by ksteube, Wed Nov 7 01:53:12 2007 UTC revision 1370 by gross, Wed Jan 2 09:21:43 2008 UTC
# 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 88  BOOST_PYTHON_MODULE(finleycpp) Line 89  BOOST_PYTHON_MODULE(finleycpp)
89    // NOTE: The return_value_policy is necessary for functions that    // NOTE: The return_value_policy is necessary for functions that
90    // return pointers.    // return pointers.
91    
92    def("load",finley::loadMesh,    def("LoadMesh",finley::loadMesh,
93        (arg("fileName")="file.nc"),        (arg("fileName")="file.nc"),
94        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
95    def("ReadMesh",finley::readMesh,    def("ReadMesh",finley::readMesh,
96        (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true),        (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true),
97        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
98      def("ReadMeshMPI",finley::readMeshMPI,
99          (arg("fileName")="file.fly",arg("integrationOrder")=-1,  arg("reducedIntegrationOrder")=-1,  arg("optimize")=true),
100          return_value_policy<manage_new_object>());
101    
102    def("ReadGmsh",finley::readGmsh,    def("ReadGmsh",finley::readGmsh,
103        (arg("fileName")="file.msh",arg("numDim"), arg("integrationOrder")=-1, arg("reducedIntegrationOrder")=-1, arg("optimize")=true),        (arg("fileName")="file.msh",arg("numDim"), arg("integrationOrder")=-1, arg("reducedIntegrationOrder")=-1, arg("optimize")=true),
# Line 135  BOOST_PYTHON_MODULE(finleycpp) Line 139  BOOST_PYTHON_MODULE(finleycpp)
139        arg("optimize")=true),        arg("optimize")=true),
140        return_value_policy<manage_new_object>());        return_value_policy<manage_new_object>());
141    
142    register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));  
143    
144    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >    class_<finley::MeshAdapter, bases<escript::AbstractContinuousDomain> >
145        ("MeshAdapter",init<optional <Finley_Mesh*> >())        ("MeshAdapter",init<optional <Finley_Mesh*> >())
146        .def(init<const finley::MeshAdapter&>())        .def(init<const finley::MeshAdapter&>())
147        .def("write",&finley::MeshAdapter::write)        .def("write",&finley::MeshAdapter::write)
148        .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info,(arg("full")=false))        .def("print_mesh_info",&finley::MeshAdapter::Print_Mesh_Info,(arg("full")=false))
149        .def("dump",&finley::MeshAdapter::write)        .def("dump",&finley::MeshAdapter::dump)
150        .def("getDescription",&finley::MeshAdapter::getDescription)        .def("getDescription",&finley::MeshAdapter::getDescription)
151        .def("getDim",&finley::MeshAdapter::getDim)        .def("getDim",&finley::MeshAdapter::getDim)
152        .def("getDataShape",&finley::MeshAdapter::getDataShape)        .def("getDataShape",&finley::MeshAdapter::getDataShape)
153        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)        .def("addPDEToSystem",&finley::MeshAdapter::addPDEToSystem)
154        .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem)        .def("addPDEToLumpedSystem",&finley::MeshAdapter::addPDEToLumpedSystem)
155        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)        .def("addPDEToRHS",&finley::MeshAdapter::addPDEToRHS)
156          .def("addPDEToTransportProblem",&finley::MeshAdapter::addPDEToTransportProblem)
157        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)        .def("newOperator",&finley::MeshAdapter::newSystemMatrix)
158          .def("newTransportProblem",&finley::MeshAdapter::newTransportProblem)
159        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)        .def("getSystemMatrixTypeId",&finley::MeshAdapter::getSystemMatrixTypeId)
160        .def("setX",&finley::MeshAdapter::setNewX)        .def("setX",&finley::MeshAdapter::setNewX)
161        .def("getX",&finley::MeshAdapter::getX)        .def("getX",&finley::MeshAdapter::getX)
# Line 172  BOOST_PYTHON_MODULE(finleycpp) Line 178  BOOST_PYTHON_MODULE(finleycpp)
178        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)        .def("saveMM",&finley::SystemMatrixAdapter::saveMM)
179        .def("saveHB",&finley::SystemMatrixAdapter::saveHB);        .def("saveHB",&finley::SystemMatrixAdapter::saveHB);
180    
181      class_<finley::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
182          ("OperatorAdapter",no_init)
183          .def("resetTransport",&finley::TransportProblemAdapter::resetTransport);
184    
185    
186    
187      register_exception_translator<finley::FinleyAdapterException>(&(esysUtils::esysExceptionTranslator));
188    
189  }  }

Legend:
Removed from v.1339  
changed lines
  Added in v.1370

  ViewVC Help
Powered by ViewVC 1.1.26