/[escript]/trunk/pasowrap/src/pasowrapcpp.cpp
ViewVC logotype

Contents of /trunk/pasowrap/src/pasowrapcpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3672 - (show annotations)
Wed Nov 16 05:43:35 2011 UTC (7 years, 10 months ago) by jfenwick
Original Path: branches/pasowrap/pasowrap/src/pasowrapcpp.cpp
File size: 2828 byte(s)
build hooks for pasowrap

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 #ifdef ESYS_MPI
16 #include "esysUtils/Esys_MPI.h"
17 #endif
18 extern "C" {
19 #include <paso/Paso.h>
20 }
21
22 #include "SystemMatrixAdapter.h"
23 #include "TransportProblemAdapter.h"
24
25 #include "PasoException.h"
26 #include "esysUtils/esysExceptionTranslator.h"
27
28 #include "escript/AbstractContinuousDomain.h"
29
30 #include <boost/python.hpp>
31 #include <boost/python/module.hpp>
32 #include <boost/python/def.hpp>
33 #include <boost/python/detail/defaults_gen.hpp>
34 #include <boost/version.hpp>
35
36 using namespace boost::python;
37
38 /**
39 \page pasowrap
40 Python and c++ wrappers for paso.
41
42 \version 1.0.0
43
44 \section class_desc Class Description:
45 Data
46
47 \section class_limits Class Limitations:
48 None
49
50 \section class_conds Class Conditions of Use:
51 None
52
53 \section throws Throws:
54 None
55
56 */
57
58 BOOST_PYTHON_MODULE(pasowrapcpp)
59 {
60 // This feature was added in boost v1.34
61 #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
62 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
63 docstring_options docopt(true, true, false);
64 #endif
65
66
67 register_exception_translator<paso::PasoException>(&(esysUtils::esysExceptionTranslator));
68
69 class_<paso::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
70 ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
71 .def("print_matrix_info",&paso::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")
72 .def("nullifyRowsAndCols",&paso::SystemMatrixAdapter::nullifyRowsAndCols)
73 .def("resetValues",&paso::SystemMatrixAdapter::resetValues, "resets the matrix entries")
74 .def("saveMM",&paso::SystemMatrixAdapter::saveMM,args("fileName"),
75 "writes the matrix to a file using the Matrix Market file format")
76 .def("saveHB",&paso::SystemMatrixAdapter::saveHB, args("filename"),
77 "writes the matrix to a file using the Harwell-Boeing file format");
78
79 class_<paso::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
80 ("TransportProblemAdapter","",no_init)
81 .def("getSafeTimeStepSize",&paso::TransportProblemAdapter::getSafeTimeStepSize)
82 .def("getUnlimitedTimeStepSize",&paso::TransportProblemAdapter::getUnlimitedTimeStepSize)
83 .def("resetTransport",&paso::TransportProblemAdapter::resetTransport,
84 "resets the transport operator typically as they have been updated");
85 }

  ViewVC Help
Powered by ViewVC 1.1.26