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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4346 - (show annotations)
Tue Apr 2 04:46:45 2013 UTC (6 years, 4 months ago) by jfenwick
File size: 2598 byte(s)
Bringing the changes from doubleplusgood branch.
Can't merge directly because svn doesn't transfer changes to renamed files (mutter grumble).
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17
18 #include <paso/Paso.h>
19
20 #include "SystemMatrixAdapter.h"
21 #include "TransportProblemAdapter.h"
22
23 #include "PasoException.h"
24 #include "esysUtils/esysExceptionTranslator.h"
25
26 #include "escript/AbstractContinuousDomain.h"
27
28 #include <boost/python.hpp>
29 #include <boost/python/module.hpp>
30 #include <boost/python/def.hpp>
31 #include <boost/python/detail/defaults_gen.hpp>
32 #include <boost/version.hpp>
33
34 using namespace boost::python;
35
36 BOOST_PYTHON_MODULE(pasowrapcpp)
37 {
38 // This feature was added in boost v1.34
39 #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
40 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
41 docstring_options docopt(true, true, false);
42 #endif
43
44
45 register_exception_translator<paso::PasoException>(&(esysUtils::esysExceptionTranslator));
46
47 class_<paso::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
48 ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
49 .def("print_matrix_info",&paso::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")
50 .def("nullifyRowsAndCols",&paso::SystemMatrixAdapter::nullifyRowsAndCols)
51 .def("resetValues",&paso::SystemMatrixAdapter::resetValues, "resets the matrix entries")
52 .def("saveMM",&paso::SystemMatrixAdapter::saveMM,args("fileName"),
53 "writes the matrix to a file using the Matrix Market file format")
54 .def("saveHB",&paso::SystemMatrixAdapter::saveHB, args("filename"),
55 "writes the matrix to a file using the Harwell-Boeing file format");
56
57 class_<paso::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
58 ("TransportProblemAdapter","",no_init)
59 .def("getSafeTimeStepSize",&paso::TransportProblemAdapter::getSafeTimeStepSize)
60 .def("getUnlimitedTimeStepSize",&paso::TransportProblemAdapter::getUnlimitedTimeStepSize)
61 .def("resetTransport",&paso::TransportProblemAdapter::resetTransport,
62 "resets the transport operator typically as they have been updated");
63 }

  ViewVC Help
Powered by ViewVC 1.1.26