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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4346 - (hide annotations)
Tue Apr 2 04:46:45 2013 UTC (6 years, 5 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 jfenwick 3661
2 jfenwick 3981 /*****************************************************************************
3 jfenwick 3661 *
4 jfenwick 4154 * Copyright (c) 2003-2013 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 jfenwick 3661 *
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 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 jfenwick 3661
16    
17 jfenwick 3676
18 jfenwick 3672 #include <paso/Paso.h>
19 jfenwick 3661
20     #include "SystemMatrixAdapter.h"
21     #include "TransportProblemAdapter.h"
22    
23 jfenwick 3676 #include "PasoException.h"
24 jfenwick 3661 #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 jfenwick 3672 BOOST_PYTHON_MODULE(pasowrapcpp)
37 jfenwick 3661 {
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 jfenwick 3672 register_exception_translator<paso::PasoException>(&(esysUtils::esysExceptionTranslator));
46 jfenwick 3661
47 jfenwick 3672 class_<paso::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
48 jfenwick 3661 ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
49 jfenwick 3672 .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 jfenwick 3661 "writes the matrix to a file using the Matrix Market file format")
54 jfenwick 3672 .def("saveHB",&paso::SystemMatrixAdapter::saveHB, args("filename"),
55 jfenwick 3661 "writes the matrix to a file using the Harwell-Boeing file format");
56    
57 jfenwick 3672 class_<paso::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
58 jfenwick 3661 ("TransportProblemAdapter","",no_init)
59 jfenwick 3672 .def("getSafeTimeStepSize",&paso::TransportProblemAdapter::getSafeTimeStepSize)
60     .def("getUnlimitedTimeStepSize",&paso::TransportProblemAdapter::getUnlimitedTimeStepSize)
61     .def("resetTransport",&paso::TransportProblemAdapter::resetTransport,
62 jfenwick 3661 "resets the transport operator typically as they have been updated");
63     }

  ViewVC Help
Powered by ViewVC 1.1.26