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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3128 - (show annotations)
Wed Sep 1 03:54:09 2010 UTC (8 years, 9 months ago) by caltinay
File size: 2634 byte(s)
-Added mesh axis label/unit and variable unit support to weipa's Silo writer
-Created EscriptDataset python wrapper
-Some code cleanup and a ghost zone fix for the VisIt interface

1
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 #include <escript/Data.h>
16
17 #include <weipa/EscriptDataset.h>
18 #include <weipa/VisItControl.h>
19
20 #include <boost/python.hpp>
21 #include <boost/python/module.hpp>
22 #include <boost/python/def.hpp>
23 #include <boost/python/object.hpp>
24 #include <boost/version.hpp>
25
26 using namespace boost::python;
27
28 /*! \mainpage Esys Documentation
29 *
30 * \version 3.0.0
31 *
32 * - \ref escript
33 *
34 * - \ref esys_exception "Esys Exception"
35 *
36 * - \ref finley
37 *
38 * - <a href="../../epydoc/index.html">Python module documentation (epydoc generated)</a>
39 *
40 */
41
42 /*! \page weipa Weipa
43 * Weipa is the python module that contains the interfaces
44 * to the C++ side of the escript data exporter.
45 *
46 *
47 *
48 * \section class_desc Class Description:
49 * None
50 *
51 * \section class_limits Class Limitations:
52 * None
53 *
54 * \section class_conds Class Conditions of Use:
55 * None
56 *
57 * \section class_throws Throws:
58 * None
59 *
60 */
61
62 BOOST_PYTHON_MODULE(weipacpp)
63 {
64 #if BOOST_VERSION >= 103500
65 // params are: bool show_user_defined, bool show_py_signatures, bool show_cpp_signatures
66 docstring_options docopt(true,true,false);
67 #endif
68
69 class_<weipa::EscriptDataset>("EscriptDataset","Represents an escript dataset including a domain and data variables for one timestep. It is used for exporting", init<>())
70 .def("setDomain", &weipa::EscriptDataset::setDomain)
71 .def("addData", &weipa::EscriptDataset::addData, (arg("data"), arg("name"), arg("units")=""))
72 .def("setCycleAndTime", &weipa::EscriptDataset::setCycleAndTime, args("cycle","time"))
73 .def("setMeshLabels", &weipa::EscriptDataset::setMeshLabels, (arg("x"),arg("y"),arg("z")=""))
74 .def("setMeshUnits", &weipa::EscriptDataset::setMeshUnits, (arg("x"),arg("y"),arg("z")=""))
75 .def("setMetadataSchemaString", &weipa::EscriptDataset::setMetadataSchemaString, (arg("schema"),arg("metadata")=""))
76 .def("saveSilo", &weipa::EscriptDataset::saveSilo, (arg("filename"), arg("useMultimesh")=true))
77 .def("saveVTK", &weipa::EscriptDataset::saveVTK, args("filename"));
78
79 // VisIt Control
80 def("visitInitialize", weipa::VisItControl::initialize, (arg("simFile"), arg("comment")=""));
81 def("visitPublishData", weipa::VisItControl::publishData, args("dataset"));
82 }
83

  ViewVC Help
Powered by ViewVC 1.1.26