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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4821 - (show annotations)
Tue Apr 1 04:58:33 2014 UTC (5 years, 4 months ago) by sshaw
File size: 2665 byte(s)
moved SolverOptions to c++, split into SolverOptions for the options and SolverBuddy as the state as a precursor to per-pde solving... does break some use cases (e.g. pde.getSolverOptions().DIRECT will now fail, new value access is with SolverOptions.DIRECT), examples and documentation updated to match
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 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 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18
19 #include <paso/Paso.h>
20
21 #include "SystemMatrixAdapter.h"
22 #include "TransportProblemAdapter.h"
23
24 #include "PasoException.h"
25 #include "esysUtils/esysExceptionTranslator.h"
26
27 #include "escript/AbstractContinuousDomain.h"
28
29 #include <boost/python.hpp>
30 #include <boost/python/module.hpp>
31 #include <boost/python/def.hpp>
32 #include <boost/python/detail/defaults_gen.hpp>
33 #include <boost/version.hpp>
34
35 using namespace boost::python;
36
37 BOOST_PYTHON_MODULE(pasowrapcpp)
38 {
39 // This feature was added in boost v1.34
40 #if ((BOOST_VERSION/100)%1000 > 34) || (BOOST_VERSION/100000 >1)
41 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
42 docstring_options docopt(true, true, false);
43 #endif
44
45
46 register_exception_translator<paso::PasoException>(&(esysUtils::RuntimeErrorTranslator));
47
48 class_<paso::SystemMatrixAdapter, bases<escript::AbstractSystemMatrix> >
49 ("OperatorAdapter","A concrete class representing an operator. For more details, please see the c++ documentation.", no_init)
50 .def("print_matrix_info",&paso::SystemMatrixAdapter::Print_Matrix_Info,(arg("full")=false),"prints information about a system matrix")
51 .def("nullifyRowsAndCols",&paso::SystemMatrixAdapter::nullifyRowsAndCols)
52 .def("resetValues",&paso::SystemMatrixAdapter::resetValues, "resets the matrix entries")
53 .def("saveMM",&paso::SystemMatrixAdapter::saveMM,args("fileName"),
54 "writes the matrix to a file using the Matrix Market file format")
55 .def("saveHB",&paso::SystemMatrixAdapter::saveHB, args("filename"),
56 "writes the matrix to a file using the Harwell-Boeing file format");
57
58 class_<paso::TransportProblemAdapter, bases<escript::AbstractTransportProblem> >
59 ("TransportProblemAdapter","",no_init)
60 .def("getSafeTimeStepSize",&paso::TransportProblemAdapter::getSafeTimeStepSize)
61 .def("getUnlimitedTimeStepSize",&paso::TransportProblemAdapter::getUnlimitedTimeStepSize)
62 .def("resetTransport",&paso::TransportProblemAdapter::resetTransport,
63 "resets the transport operator typically as they have been updated");
64 }

  ViewVC Help
Powered by ViewVC 1.1.26