/[escript]/branches/windows_from_1456_trunk_1544_merged_in/bruce/src/brucecpp.cpp
ViewVC logotype

Contents of /branches/windows_from_1456_trunk_1544_merged_in/bruce/src/brucecpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1578 - (show annotations)
Wed May 28 11:16:10 2008 UTC (11 years, 3 months ago) by phornby
File size: 2633 byte(s)
Now restore the old 1544 merged branch to its previous state. 
(Yup, I forgot to do an svn cp and an svn switch before doing the merge....).


1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 #include "Bruce.h"
17 #include "BruceFactory.h"
18
19 #include <boost/python.hpp>
20 #include <boost/python/module.hpp>
21 #include <boost/python/def.hpp>
22 #include <boost/python/detail/defaults_gen.hpp>
23
24 using namespace boost::python;
25
26 /**
27 \page bruce Bruce
28 Bruce is the python module name that contains the interfaces
29 to the C++ wrapper to bruce.
30
31 \version 1.0.0
32
33 \section class_desc Class Description:
34 Bruce
35
36 \section class_limits Class Limitations:
37 None
38
39 \section class_conds Class Conditions of Use:
40 None
41
42 \section throws Throws:
43 None
44
45 */
46
47 BOOST_PYTHON_MODULE(brucecpp)
48 {
49
50 //
51 // NOTE: The return_value_policy is necessary for functions that
52 // return pointers.
53
54 def ("Brick",bruce::brick,
55 (arg("n0")=2,arg("n1")=2,arg("n2")=2,
56 arg("l0")=1.0,arg("l1")=1.0,arg("l2")=1.0),
57 return_value_policy<manage_new_object>());
58
59 def ("Rectangle",bruce::rectangle,
60 (arg("n0")=2,arg("n1")=2,
61 arg("l0")=1.0,arg("l1")=1.0),
62 return_value_policy<manage_new_object>());
63
64 class_<bruce::Bruce, bases<escript::AbstractContinuousDomain> >
65 ("Bruce",init<>())
66 .def(init<const bruce::Bruce&>())
67 .def("getDescription",&bruce::Bruce::getDescription)
68 .def("isValidFunctionSpaceType",&bruce::Bruce::isValidFunctionSpaceType)
69 .def("functionSpaceTypeAsString",&bruce::Bruce::functionSpaceTypeAsString)
70 .def("getContinuousFunctionCode",&bruce::Bruce::getContinuousFunctionCode)
71 .def("getFunctionCode",&bruce::Bruce::getFunctionCode)
72 .def("getDim",&bruce::Bruce::getDim)
73 .def("getNumSamples",&bruce::Bruce::getNumSamples)
74 .def("getNumDataPointsPerSample",&bruce::Bruce::getNumDataPointsPerSample)
75 .def("getX",&bruce::Bruce::getX)
76 .def("setToX",&bruce::Bruce::setToX)
77 .def("getSize",&bruce::Bruce::getSize)
78 .def("setToSize",&bruce::Bruce::setToSize)
79 .def("getTagFromSampleNo",&bruce::Bruce::getTagFromSampleNo)
80 .def("getReferenceNoFromSampleNo",&bruce::Bruce::getReferenceNoFromSampleNo)
81 .def("saveVTK",&bruce::Bruce::saveVTK)
82 .def(self == other<object>())
83 .def(self == self)
84 .def(self != other<object>())
85 .def(self != self);
86
87 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26