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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3675 - (hide annotations)
Thu Nov 17 00:53:38 2011 UTC (7 years, 10 months ago) by jfenwick
File size: 2828 byte(s)
pasowrap joins the trunk.

1 jfenwick 3661
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 jfenwick 3672 #include <paso/Paso.h>
20 jfenwick 3661 }
21    
22     #include "SystemMatrixAdapter.h"
23     #include "TransportProblemAdapter.h"
24    
25 jfenwick 3672 #include "PasoException.h"
26 jfenwick 3661 #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 jfenwick 3672 \page pasowrap
40     Python and c++ wrappers for paso.
41 jfenwick 3661
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 jfenwick 3672 BOOST_PYTHON_MODULE(pasowrapcpp)
59 jfenwick 3661 {
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 jfenwick 3672 register_exception_translator<paso::PasoException>(&(esysUtils::esysExceptionTranslator));
68 jfenwick 3661
69 jfenwick 3672 class_<paso::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
70 jfenwick 3661 ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
71 jfenwick 3672 .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 jfenwick 3661 "writes the matrix to a file using the Matrix Market file format")
76 jfenwick 3672 .def("saveHB",&paso::SystemMatrixAdapter::saveHB, args("filename"),
77 jfenwick 3661 "writes the matrix to a file using the Harwell-Boeing file format");
78    
79 jfenwick 3672 class_<paso::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
80 jfenwick 3661 ("TransportProblemAdapter","",no_init)
81 jfenwick 3672 .def("getSafeTimeStepSize",&paso::TransportProblemAdapter::getSafeTimeStepSize)
82     .def("getUnlimitedTimeStepSize",&paso::TransportProblemAdapter::getUnlimitedTimeStepSize)
83     .def("resetTransport",&paso::TransportProblemAdapter::resetTransport,
84 jfenwick 3661 "resets the transport operator typically as they have been updated");
85     }

  ViewVC Help
Powered by ViewVC 1.1.26