~ubuntu-branches/ubuntu/quantal/python-demgengeo/quantal

« back to all changes in this revision

Viewing changes to Python/CircMNTable3DPy.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 "CircMNTable3DPy.h"
 
18
 
 
19
using namespace std;
 
20
 
 
21
using namespace boost::python;
 
22
 
 
23
    using boost::python::arg;
 
24
    void exportCircMNTable3D()
 
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_<CircMNTable3D, bases<MNTable3D> >(
 
36
        "CircMNTable3D",
 
37
        "A multi-group neighbours table for constructing 3D particle setups with circular boundary conditions in the X-direction.",
 
38
        init<>()
 
39
      )
 
40
      .def(init<const CircMNTable3D &>())
 
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") ),
 
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\n"
 
53
        )
 
54
      )
 
55
      .def(
 
56
        "tagParticlesAlongPlane",
 
57
        &CircMNTable3D::tagParticlesAlongPlane,
 
58
        ( boost::python::arg("plane"), boost::python::arg("distance"), boost::python::arg("tag"), boost::python::arg("groupID")=0 ),
 
59
        "Assigns the specified tag to all particles from group C{groupID}\n"
 
60
        "that lie within the specified distance of the given plane.\n"
 
61
        "@type plane: L{Plane}\n"
 
62
        "@kwarg plane: the plane along which to tag particles\n"
 
63
        "@type distance: double\n"
 
64
        "@kwarg distance: the maximum distance between tagged particles and the plane\n"
 
65
        "@type tag: int\n"
 
66
        "@kwarg tag: the tag to assign particles\n"
 
67
        "@type groupID: unsigned int\n"
 
68
        "@kwarg groupID: the group ID of particles to tag (default: 0)\n"
 
69
        "@rtype: void\n"
 
70
      )
 
71
      .def(
 
72
        "generateBonds",
 
73
        &CircMNTable3D::generateBonds,
 
74
        (boost::python::arg("groupID")=0, boost::python::arg("tolerance"), boost::python::arg("bondID") ),
 
75
        "Generates bonds between particle pairs separated by less than the specified tolerance\n"
 
76
        "@type groupID: int\n"
 
77
        "@kwarg groupID: the group ID of particles to bond together (default: 0)\n"
 
78
        "@type tolerance: double\n"
 
79
        "@kwarg tolerance: maximum distance separating bonded particles\n"
 
80
        "@type bondID: int\n"
 
81
        "@kwarg bondID: the bond ID to assign generated bonds\n"
 
82
        "@rtype: void\n"
 
83
      )
 
84
      .def(
 
85
        "getSumVolume",
 
86
        &CircMNTable3D::getSumVolume,
 
87
        ( boost::python::arg("groupID")=0 ),
 
88
        "Returns the sum of the particle volumes in the specified group.\n"
 
89
        "@type groupID: int\n"
 
90
        "@kwarg groupID: the group ID of particles whose volume is summed (default: 0).\n"
 
91
        "@rtype: double\n"
 
92
      )
 
93
      .def(
 
94
        "write",
 
95
        &CircMNTable3D::write,
 
96
        ( boost::python::arg("fileName"), boost::python::arg("outputStyle") ),
 
97
        "Writes the particle assembly and bonding information to the specified\n"
 
98
        "file using the specified output style (0: debug; 1: geo; 2: vtk)\n"
 
99
        "@type fileName: string\n"
 
100
        "@kwarg fileName: the name of the file to write\n"
 
101
        "@type outputStyle: int\n"
 
102
        "@kwarg outputStyle: output style (0: debug; 1: geo; 2: vtk)\n"
 
103
        "@rtype: void\n"
 
104
      )
 
105
      .def(
 
106
        "generateClusterBonds",
 
107
        &CircMNTable3D::generateClusterBonds,
 
108
        (boost::python::arg("groupID")=0, boost::python::arg("tolerance"), boost::python::arg("bondTag1"), boost::python::arg("bondTag2")),
 
109
        "Generates bonds with tag C{Tag1} within clusters and C{Tag2} between clusters\n"
 
110
      )
 
111
      .def(self_ns::str(self))
 
112
      ;
 
113
    }
 
114
 
 
115
 
 
116