1
/////////////////////////////////////////////////////////////
3
// Copyright (c) 2007-2011 by The University of Queensland //
4
// Earth Systems Science Computational Centre (ESSCC) //
5
// http://www.uq.edu.au/esscc //
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 //
11
/////////////////////////////////////////////////////////////
16
// --- STL includes ---
17
#include <boost/python.hpp>
27
// --- IO includes ---
32
// --- Project includes ---
36
#include "LineSegment2D.h"
40
\brief Multi-group Neighbour table
42
Neighbour table supporting multiple tagged groups of particles
47
typedef pair<int,int> bond;
51
map<int,set<pair<int,int> > > m_bonds;
52
double m_x0,m_y0; //!< origin
53
double m_celldim; //!< cell size
54
int m_nx,m_ny; //!< number of cells in x- and y-direction
55
unsigned int m_ngroups;
56
static int s_output_style;
57
static double s_small_value;
61
virtual int getIndex(const Vector3&) const;
62
inline int idx(int i,int j) const {return i*m_ny+j;};
63
void WriteAsVtkXml(ostream&) const;
67
MNTable2D(const Vector3&,const Vector3&,double,unsigned int);
70
virtual bool insert(const Sphere&,unsigned int);
71
virtual bool insertChecked(const Sphere&,unsigned int,double tol=s_small_value);
72
virtual bool checkInsertable(const Sphere&,unsigned int);
73
void GrowNGroups(unsigned int);
74
const multimap<double,const Sphere*> getSpheresClosestTo(const Vector3&,unsigned int) const;
75
const multimap<double,const Sphere*> getSpheresFromGroupNear(const Vector3&,double,int) const;
76
const vector<const Sphere*> getAllSpheresFromGroup(int) const;
77
const Sphere* getClosestSphereFromGroup(const Sphere&,int) const;
78
Sphere* getClosestSphereFromGroup(const Vector3&,int) const;
79
int getTagOfClosestSphereFromGroup(const Sphere&,int) const;
80
void tagParticlesAlongLine(const Line2D&,double,int,unsigned int);
81
void tagParticlesAlongLineWithMask(const Line2D&,double,int,int, unsigned int);
82
void tagParticlesAlongLineSegment(const LineSegment2D&,double,int,int, unsigned int);
83
void tagParticlesNear(const Vector3&,double,int,int);
84
void tagClosestParticle(const Vector3&,int,int);
85
void tagParticlesToClosest(int,int);
86
void tagParticlesInVolume(const AVolume&,int,unsigned int);
88
boost::python::list getSphereListFromGroup(int) const;
90
virtual void generateBonds(int,double,int);
91
virtual void generateBondsWithMask(int,double,int,int,int);
92
virtual void generateRandomBonds(int,double,double,int,int,int);
93
virtual void generateClusterBonds(int,double,int,int);
94
void insertBond(int,int,int);
95
void breakBondsAlongLineSegment(const LineSegment2D&,double,int, unsigned int);
97
void removeTagged(int,int,int);
100
double getSumVolume(int);
101
int getNrParticles(int);
102
friend ostream& operator << (ostream&,const MNTable2D&);
103
static void SetOutputStyle(int);
104
void write(char *filename, int outputStyle);
106
#endif // __MNTABLE_H