~ubuntu-branches/ubuntu/saucy/python-demgengeo/saucy

« back to all changes in this revision

Viewing changes to Python/CircMNTable2DPy.cc

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2011-11-18 21:47:18 UTC
  • Revision ID: package-import@ubuntu.com-20111118214718-4ysqm3dhpqwdd7gd
Tags: upstream-0.99~bzr106
ImportĀ upstreamĀ versionĀ 0.99~bzr106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/////////////////////////////////////////////////////////////
 
2
//                                                         //
 
3
// Copyright (c) 2007-2011 by The University of Queensland //
 
4
// Earth Systems Science Computational Centre (ESSCC)      //
 
5
// http://www.uq.edu.au/esscc                              //
 
6
//                                                         //
 
7
// Primary Business: Brisbane, Queensland, Australia       //
 
8
// Licensed under the Open Software License version 3.0    //
 
9
// http://www.opensource.org/licenses/osl-3.0.php          //
 
10
//                                                         //
 
11
/////////////////////////////////////////////////////////////
 
12
 
 
13
#include <boost/version.hpp>
 
14
#include <iostream>
 
15
#include <fstream>
 
16
#include <sstream>
 
17
#include "CircMNTable2DPy.h"
 
18
 
 
19
using namespace std;
 
20
 
 
21
using namespace boost::python;
 
22
 
 
23
    using boost::python::arg;
 
24
    void exportCircMNTable2D()
 
25
    {
 
26
      // Check that Boost 1.34.0 or higher is being used.
 
27
      // If so, disable auto-generation of C++ signatures for Epydoc
 
28
      // (which stumbles over indentation in the auto-generated strings).
 
29
      #if ((BOOST_VERSION / 100000 >= 1) \
 
30
          && (BOOST_VERSION / 100 % 1000 >= 34)) \
 
31
          || (BOOST_VERSION / 100000 >= 2)
 
32
        boost::python::docstring_options no_autogen(true,false);
 
33
      #endif
 
34
 
 
35
      class_<CircMNTable2D, bases<MNTable2D> >(
 
36
        "CircMNTable2D",
 
37
        "A multi-group neighbours table for constructing 2D particle setups with circular boundary conditions in the X-direction.",
 
38
        init<>()
 
39
      )
 
40
      .def(init<const CircMNTable2D &>())
 
41
      .def(
 
42
        init<Vector3&,Vector3&,double, unsigned int>(
 
43
          ( boost::python::arg("minPoint"), boost::python::arg("maxPoint"), boost::python::arg("gridSize"), boost::python::arg("numGroups")=1 ),
 
44
          "Constructs a neighbours table with specified bounds, cell size and initial number of particle groups.\n"
 
45
          "@type minPoint: L{Vector3}\n"
 
46
          "@kwarg minPoint: lower-left point of the particle region\n"
 
47
          "@type maxPoint: L{Vector3}\n"
 
48
          "@kwarg maxPoint: upper-right point of the particle region\n"
 
49
          "@type gridSize: double\n"
 
50
          "@kwarg gridSize: the cell size for neighbour searches\n"
 
51
          "@type numGroups: unsigned int\n"
 
52
          "@kwarg numGroups: the initial number of groups (default: 1)\n"
 
53
        )
 
54
      )
 
55
      .def(
 
56
        "generateBonds",
 
57
        &CircMNTable2D::generateBonds,
 
58
        (boost::python::arg("groupID")=0, boost::python::arg("tolerance"), boost::python::arg("bondID") ),
 
59
        "Generates bonds between particle pairs separated by less than the specified tolerance\n"
 
60
        "@type groupID: int\n"
 
61
        "@kwarg groupID: the group ID of particles to bond together (default: 0)\n"
 
62
        "@type tolerance: double\n"
 
63
        "@kwarg tolerance: maximum distance separating bonded particles\n"
 
64
        "@type bondID: int\n"
 
65
        "@kwarg bondID: the bond ID to assign generated bonds\n"
 
66
        "@rtype: void\n"
 
67
      )
 
68
      .def(self_ns::str(self))
 
69
      ;
 
70
    }
 
71
 
 
72
 
 
73