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

Diff of /trunk/bruce/src/Bruce/brucecpp.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 149 by jgs, Thu Sep 1 03:31:39 2005 UTC revision 154 by jgs, Mon Nov 7 05:51:17 2005 UTC
# Line 14  Line 14 
14  */  */
15    
16  #include "bruce/Bruce/Bruce.h"  #include "bruce/Bruce/Bruce.h"
17    #include "bruce/Bruce/BruceFactory.h"
18    
19  #include <boost/python.hpp>  #include <boost/python.hpp>
20  #include <boost/python/module.hpp>  #include <boost/python/module.hpp>
# Line 46  using namespace boost::python; Line 47  using namespace boost::python;
47  BOOST_PYTHON_MODULE(brucecpp)  BOOST_PYTHON_MODULE(brucecpp)
48  {  {
49    
50    class_<bruce::Bruce, bases<escript::AbstractContinuousDomain> >("Bruce",init<>())    //
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&>())        .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)        .def("getDim",&bruce::Bruce::getDim)
73          .def("getNumSamples",&bruce::Bruce::getNumSamples)
74          .def("getNumDataPointsPerSample",&bruce::Bruce::getNumDataPointsPerSample)
75        .def("getX",&bruce::Bruce::getX)        .def("getX",&bruce::Bruce::getX)
76        .def("getSize",&bruce::Bruce::getSize);        .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  }  }

Legend:
Removed from v.149  
changed lines
  Added in v.154

  ViewVC Help
Powered by ViewVC 1.1.26