/[escript]/trunk/weipa/src/weipacpp.cpp
ViewVC logotype

Contents of /trunk/weipa/src/weipacpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3981 - (show annotations)
Fri Sep 21 02:47:54 2012 UTC (6 years, 11 months ago) by jfenwick
File size: 2589 byte(s)
First pass of updating copyright notices
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2012 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 #include <escript/Data.h>
18
19 #include <weipa/EscriptDataset.h>
20 #include <weipa/VisItControl.h>
21
22 #include <boost/python.hpp>
23 #include <boost/python/module.hpp>
24 #include <boost/python/def.hpp>
25 #include <boost/python/object.hpp>
26 #include <boost/version.hpp>
27
28 using namespace boost::python;
29
30 /*! \page weipa Weipa
31 * Weipa is the python module that contains the interfaces
32 * to the C++ side of the escript data exporter.
33 *
34 *
35 *
36 * \section class_desc Class Description:
37 * None
38 *
39 * \section class_limits Class Limitations:
40 * None
41 *
42 * \section class_conds Class Conditions of Use:
43 * None
44 *
45 * \section class_throws Throws:
46 * None
47 *
48 */
49
50 BOOST_PYTHON_MODULE(weipacpp)
51 {
52 #if BOOST_VERSION >= 103500
53 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
54 docstring_options docopt(true,true,false);
55 #endif
56
57 class_<weipa::EscriptDataset>("EscriptDataset","Represents an escript dataset including a domain and data variables for one timestep. It is used for exporting", init<>())
58 .def("setDomain", &weipa::EscriptDataset::setDomain)
59 .def("addData", &weipa::EscriptDataset::addData, (arg("data"), arg("name"), arg("units")=""))
60 .def("setCycleAndTime", &weipa::EscriptDataset::setCycleAndTime, args("cycle","time"))
61 .def("setMeshLabels", &weipa::EscriptDataset::setMeshLabels, (arg("x"),arg("y"),arg("z")=""))
62 .def("setMeshUnits", &weipa::EscriptDataset::setMeshUnits, (arg("x"),arg("y"),arg("z")=""))
63 .def("setMetadataSchemaString", &weipa::EscriptDataset::setMetadataSchemaString, (arg("schema")="", arg("metadata")=""))
64 .def("setSaveMeshData", &weipa::EscriptDataset::setSaveMeshData)
65 .def("saveSilo", &weipa::EscriptDataset::saveSilo, (arg("filename"), arg("useMultimesh")=true))
66 .def("saveVTK", &weipa::EscriptDataset::saveVTK, args("filename"));
67
68 // VisIt Control
69 def("visitInitialize", weipa::VisItControl::initialize, (arg("simFile"), arg("comment")=""));
70 def("visitPublishData", weipa::VisItControl::publishData, args("dataset"));
71 }
72

  ViewVC Help
Powered by ViewVC 1.1.26