/[escript]/trunk/esys2/bruce/src/Bruce/brucecpp.cpp
ViewVC logotype

Annotation of /trunk/esys2/bruce/src/Bruce/brucecpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 153 - (hide annotations)
Tue Oct 25 01:51:20 2005 UTC (15 years ago) by jgs
File size: 2827 byte(s)
Merge of development branch dev-02 back to main trunk on 2005-10-25

1 jgs 149 // $Id$
2     /*
3     ******************************************************************************
4     * *
5     * COPYRIGHT ACcESS 2005 - All Rights Reserved *
6     * *
7     * This software is the property of ACcESS. No part of this code *
8     * may be copied in any form or by any means without the expressed written *
9     * consent of ACcESS. Copying, use or modification of this software *
10     * by any unauthorised person is illegal unless that *
11     * person has a software license agreement with ACcESS. *
12     * *
13     ******************************************************************************
14     */
15    
16     #include "bruce/Bruce/Bruce.h"
17 jgs 150 #include "bruce/Bruce/BruceFactory.h"
18 jgs 149
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 jgs 150 //
51     // NOTE: The return_value_policy is necessary for functions that
52     // return pointers.
53    
54     def ("Brick",bruce::brick,
55 jgs 153 (arg("n0")=2,arg("n1")=2,arg("n2")=2,
56 jgs 150 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 jgs 153 (arg("n0")=2,arg("n1")=2,
61 jgs 150 arg("l0")=1.0,arg("l1")=1.0),
62     return_value_policy<manage_new_object>());
63    
64 jgs 149 class_<bruce::Bruce, bases<escript::AbstractContinuousDomain> >("Bruce",init<>())
65     .def(init<const bruce::Bruce&>())
66 jgs 151 .def("getDescription",&bruce::Bruce::getDescription)
67     .def("isValidFunctionSpaceType",&bruce::Bruce::isValidFunctionSpaceType)
68     .def("functionSpaceTypeAsString",&bruce::Bruce::functionSpaceTypeAsString)
69     .def("getContinuousFunctionCode",&bruce::Bruce::getContinuousFunctionCode)
70     .def("getFunctionCode",&bruce::Bruce::getFunctionCode)
71 jgs 149 .def("getDim",&bruce::Bruce::getDim)
72 jgs 151 .def("getDataShape",&bruce::Bruce::getDataShape)
73 jgs 149 .def("getX",&bruce::Bruce::getX)
74 jgs 151 .def("setToX",&bruce::Bruce::setToX)
75     .def("getSize",&bruce::Bruce::getSize)
76     .def("setToSize",&bruce::Bruce::setToSize)
77     .def(self == other<object>())
78     .def(self == self)
79     .def(self != other<object>())
80     .def(self != self);
81 jgs 149
82     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26