GenGeo  1.1
MNTable2D Class Reference

Multi-group Neighbour table. More...

#include <MNTable2D.h>

Inheritance diagram for MNTable2D:
Collaboration diagram for MNTable2D:

Public Types

typedef pair< int, int > bond

Public Member Functions

 MNTable2D ()
 MNTable2D (const Vector3 &, const Vector3 &, double, unsigned int)
virtual ~MNTable2D ()
virtual bool insert (const Sphere &, unsigned int)
virtual bool insertChecked (const Sphere &, unsigned int, double tol=s_small_value)
virtual bool checkInsertable (const Sphere &, unsigned int)
void GrowNGroups (unsigned int)
const multimap< double, const
Sphere * > 
getSpheresClosestTo (const Vector3 &, unsigned int) const
const multimap< double, const
Sphere * > 
getSpheresFromGroupNear (const Vector3 &, double, int) const
const vector< const Sphere * > getAllSpheresFromGroup (int) const
const SpheregetClosestSphereFromGroup (const Sphere &, int) const
SpheregetClosestSphereFromGroup (const Vector3 &, int) const
int getTagOfClosestSphereFromGroup (const Sphere &, int) const
void tagParticlesAlongLine (const Line2D &, double, int, unsigned int)
void tagParticlesAlongLineWithMask (const Line2D &, double, int, int, unsigned int)
void tagParticlesAlongLineSegment (const LineSegment2D &, double, int, int, unsigned int)
void tagParticlesNear (const Vector3 &, double, int, int)
void tagClosestParticle (const Vector3 &, int, int)
void tagParticlesToClosest (int, int)
void tagParticlesInVolume (const AVolume &, int, unsigned int)
boost::python::list getSphereListFromGroup (int) const
boost::python::list getBondList (int)
virtual void generateBonds (int, double, int)
virtual void generateBondsWithMask (int, double, int, int, int)
virtual void generateRandomBonds (int, double, double, int, int, int)
virtual void generateClusterBonds (int, double, int, int)
virtual void generateBondsTaggedMasked (int, double, int, int, int, int, int)
void insertBond (int, int, int)
void breakBondsAlongLineSegment (const LineSegment2D &, double, int, unsigned int)
void removeTagged (int, int, int)
double getSumVolume (int)
int getNrParticles (int)
void SetOutputPrecision (int)
void write (char *filename, int outputStyle)

Static Public Member Functions

static void SetOutputStyle (int)

Protected Member Functions

virtual int getIndex (const Vector3 &) const
int idx (int i, int j) const
void WriteAsVtkXml (ostream &) const

Protected Attributes

MNTCellm_data
map< int, set< pair< int, int > > > m_bonds
double m_x0
double m_y0
 origin
double m_celldim
 cell size
int m_nx
int m_ny
 number of cells in x- and y-direction
unsigned int m_ngroups
int m_x_periodic
int m_y_periodic
int m_write_prec
 precision (nr. of significant digits) for file output

Static Protected Attributes

static int s_output_style = 0
static double s_small_value = 1e-7

Friends

ostream & operator<< (ostream &, const MNTable2D &)

Detailed Description

Multi-group Neighbour table.

Neighbour table supporting multiple tagged groups of particles

Member Typedef Documentation

typedef pair<int,int> MNTable2D::bond

Constructor & Destructor Documentation

MNTable2D::MNTable2D ( )
MNTable2D::MNTable2D ( const Vector3 MinPt,
const Vector3 MaxPt,
double  cd,
unsigned int  ngroups 
)

construct MNTable2D

Parameters
MinPtminimum point (z component ignored)
MaxPtmaximum point (z component ignored)
cdcell dimension
ngroupsinitial number of particle groups

References m_celldim, m_data, m_ngroups, m_nx, m_ny, m_write_prec, m_x0, m_x_periodic, m_y0, m_y_periodic, MNTCell::SetNGroups(), Vector3::X(), and Vector3::Y().

Here is the call graph for this function:

MNTable2D::~MNTable2D ( )
virtual

destruct MNTable2D

References m_data.

Member Function Documentation

void MNTable2D::breakBondsAlongLineSegment ( const LineSegment2D L,
double  dist,
int  tag,
unsigned int  gid 
)

break bonds along a line segment

Parameters
Lthe line segment
distmax. distance from the line
tagthe bond tag
gidgroup Id

References MNTCell::getSpheresNearObject(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

bool MNTable2D::checkInsertable ( const Sphere S,
unsigned int  gid 
)
virtual
void MNTable2D::generateBonds ( int  gid,
double  tol,
int  btag 
)
virtual

generate bonds between particles of a group

Parameters
gidthe group ID
tolmax. difference between bond length and equilibrium dist.
btagbond tag

Reimplemented in CircMNTable2D, and CircMNTableXY2D.

References MNTCell::getBonds(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

void MNTable2D::generateBondsTaggedMasked ( int  gid,
double  tol,
int  btag,
int  ptag1,
int  mask1,
int  ptag2,
int  mask2 
)
virtual

generate bonds between particles with given particle tag

Parameters
gidthe group ID
tolmax. difference between bond length and equilibrium dist.
btagbond tag
ptag1the 1st particle tag
mask1the mask for the 1st particle tag
ptag2the 2nd particle tag
mask2the mask for the 2nd particle tag

References MNTCell::getBondsTaggedMasked(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::generateBondsWithMask ( int  gid,
double  tol,
int  btag,
int  ptag,
int  mask 
)
virtual

generate bonds between particles with identical particle tag of a group

Parameters
gidthe group ID
tolmax. difference between bond length and equilibrium dist.
btagbond tag
ptagthe particle tag
maskthe mask for the particle tag

Reimplemented in CircMNTable2D.

References MNTCell::getBonds(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and HGrainGenerator2D::generatePacking().

Here is the call graph for this function:

void MNTable2D::generateClusterBonds ( int  gid,
double  tol,
int  btag1,
int  btag2 
)
virtual

generate bonds between particles of a group

Parameters
gidthe group ID
tolmax. difference between bond length and equilibrium dist.
btag1tag for bonds within clusters (same particle tag)
btag2tag for bonds betweem clusters (different particle tag)

References MNTCell::getBondsDiff(), MNTCell::getBondsSame(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::generateRandomBonds ( int  gid,
double  tol,
double  prob,
int  btag,
int  ptag,
int  mask 
)
virtual

generate bonds between particles with identical particle tag of a group with a given probablility (0..1)

Parameters
gidthe group ID
tolmax. difference between bond length and equilibrium dist.
probprobablility of bond generation
btagbond tag
ptagthe particle tag
maskthe mask for the particle tag

References MNTCell::getBonds(), idx(), m_bonds, m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

const vector< const Sphere * > MNTable2D::getAllSpheresFromGroup ( int  gid) const

get vector of pointers to all spheres of a group

Parameters
gidgoup Id

References MNTCell::getAllSpheresFromGroup(), idx(), m_data, m_nx, and m_ny.

Referenced by getSphereListFromGroup().

Here is the call graph for this function:

boost::python::list MNTable2D::getBondList ( int  btag)

return the bonds of a given tag as list of <int,int> pairs

Parameters
btagthe bond tag

References m_bonds.

Referenced by exportMNTable2D().

const Sphere * MNTable2D::getClosestSphereFromGroup ( const Sphere s,
int  gid 
) const

get the sphere within a given group closest to given sphere

Parameters
sthe sphere
gidthe group

References Sphere::Center(), MNTCell::getClosestSphereFromGroup(), getIndex(), idx(), m_celldim, m_data, m_nx, m_ny, and Sphere::Radius().

Referenced by getTagOfClosestSphereFromGroup(), and tagClosestParticle().

Here is the call graph for this function:

Sphere * MNTable2D::getClosestSphereFromGroup ( const Vector3 p,
int  gid 
) const

get the sphere within a given group closest to point

Parameters
pthe point
gidthe group

References Sphere::Center(), MNTCell::getClosestSphereFromGroup(), getIndex(), idx(), m_celldim, m_data, m_nx, and m_ny.

Here is the call graph for this function:

int MNTable2D::getIndex ( const Vector3 Pos) const
protectedvirtual

get the cell index for a given position

Parameters
Posthe position
Returns
the cell index if Pos is inside the table, -1 otherwise

Reimplemented in CircMNTable2D, and CircMNTableXY2D.

References idx(), m_celldim, m_nx, m_ny, m_x0, m_y0, Vector3::x(), and Vector3::y().

Referenced by checkInsertable(), getClosestSphereFromGroup(), getSpheresClosestTo(), getSpheresFromGroupNear(), insert(), insertChecked(), and tagParticlesNear().

Here is the call graph for this function:

int MNTable2D::getNrParticles ( int  gid)

References MNTCell::getNrParticles(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

boost::python::list MNTable2D::getSphereListFromGroup ( int  gid) const

References getAllSpheresFromGroup().

Referenced by exportMNTable2D().

Here is the call graph for this function:

const multimap< double, const Sphere * > MNTable2D::getSpheresClosestTo ( const Vector3 p,
unsigned int  nmax 
) const

get the closest spheres to a given point

Parameters
pthe point
nmaxthe maximum number of spheres returned

References getIndex(), MNTCell::getSpheresClosestTo(), idx(), m_celldim, and m_data.

Referenced by HexAggregateInsertGenerator2D::fillIn(), HexAggregateInsertGenerator2DRand::fillIn(), and InsertGenerator2D::fillIn().

Here is the call graph for this function:

const multimap< double, const Sphere * > MNTable2D::getSpheresFromGroupNear ( const Vector3 P,
double  d,
int  gid 
) const

get all spheres from one group within a given distance to a point

Parameters
Pthe point
dmax. distance between the point and the surface of the sphere
gidthe group id
Warning
no check for validity of gid

References getIndex(), MNTCell::getSpheresFromGroupNear(), idx(), m_celldim, and m_data.

Referenced by CircMNTableXY2D::checkInsertable(), CircMNTable2D::checkInsertable(), checkInsertable(), CircMNTableXY2D::insertChecked(), CircMNTable2D::insertChecked(), and insertChecked().

Here is the call graph for this function:

double MNTable2D::getSumVolume ( int  gid)

References MNTCell::getSumVolume2D(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

int MNTable2D::getTagOfClosestSphereFromGroup ( const Sphere s,
int  gid 
) const

convenience function which calls getClosestSphereFromGroup and returns the tag of the found sphere or -1 if none is found

Parameters
sthe sphere
gidthe group

References getClosestSphereFromGroup(), and Sphere::Tag().

Referenced by tagParticlesToClosest().

Here is the call graph for this function:

void MNTable2D::GrowNGroups ( unsigned int  ngroups)

Increase the number of particle groups. Do nothing if the number is already large enough

Parameters
ngroupsthe new number of particle groups

References m_data, m_ngroups, m_nx, m_ny, and MNTCell::SetNGroups().

Referenced by Model2D::AddParticleGroup(), and exportMNTable2D().

Here is the call graph for this function:

bool MNTable2D::insert ( const Sphere S,
unsigned int  gid 
)
virtual
void MNTable2D::insertBond ( int  id1,
int  id2,
int  btag 
)

insert bond between particles with given ID

Parameters
id1id of 1st particle
id2id of 2nd particle
btagbond tag

References m_bonds.

Referenced by exportMNTable2D(), HexAggregateInsertGenerator2D::fillIn(), HexAggregateInsertGenerator2DRand::fillIn(), HexAggregateInsertGenerator2D::seedParticles(), and HexAggregateInsertGenerator2DRand::seedParticles().

bool MNTable2D::insertChecked ( const Sphere S,
unsigned int  gid,
double  tol = s_small_value 
)
virtual
void MNTable2D::removeTagged ( int  gid,
int  tag,
int  mask 
)

References idx(), m_data, m_nx, m_ny, and MNTCell::removeTagged().

Referenced by exportMNTable2D(), and HGrainGenerator2D::generatePacking().

Here is the call graph for this function:

void MNTable2D::SetOutputPrecision ( int  prec)

Set output precision

Parameters
precnumber of significant digits

References m_write_prec.

Referenced by exportMNTable2D().

void MNTable2D::SetOutputStyle ( int  style)
static

Set output style

Parameters
stylethe output style: 0 = debug, 1 = .geo

References s_output_style.

Referenced by main(), and write().

void MNTable2D::tagClosestParticle ( const Vector3 p,
int  gid,
int  tag 
)

tag the closest sphere to a given point

Parameters
pthe point
gidthe group id
tagthe tag

References getClosestSphereFromGroup(), and Sphere::setTag().

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::tagParticlesAlongLine ( const Line2D L,
double  dist,
int  tag,
unsigned int  gid 
)

tag all particles close to a line

Parameters
Lthe line
distmax. distance
tagthe tag
gidgroup Id

References MNTCell::getSpheresNearObject(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

void MNTable2D::tagParticlesAlongLineSegment ( const LineSegment2D L,
double  dist,
int  tag,
int  mask,
unsigned int  gid 
)

tag all particles close to a line segment

Parameters
Lthe line segment
distmax. distance
tagthe tag
maskthe tag mask
gidgroup Id

References MNTCell::getSpheresNearObject(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::tagParticlesAlongLineWithMask ( const Line2D L,
double  dist,
int  tag,
int  mask,
unsigned int  gid 
)

tag all particles close to a line

Parameters
Lthe line
distmax. distance
tagthe tag
thetag mask
gidgroup Id

References MNTCell::getSpheresNearObject(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D(), and main().

Here is the call graph for this function:

void MNTable2D::tagParticlesInVolume ( const AVolume V,
int  tag,
unsigned int  gid 
)

tag all particles inside a specified volume

Parameters
Vthe volume
tagthe tag
gidgroup Id

References MNTCell::getSpheresInVolume(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::tagParticlesNear ( const Vector3 p,
double  dist,
int  gid,
int  tag 
)

tag the closest spheres to a given point

Parameters
pthe point
distmax distance
gidthe group id
tagthe tag

References getIndex(), idx(), m_celldim, m_data, and MNTCell::tagSpheresNear().

Referenced by exportMNTable2D(), and HGrainGenerator2D::generatePacking().

Here is the call graph for this function:

void MNTable2D::tagParticlesToClosest ( int  gid1,
int  gid2 
)

tag the spheres in a group A according to the tag of the closest spheres from a another group B

Parameters
gid1the group Id A
gid1the group Id B

References MNTCell::getAllSpheresFromGroupNC(), getTagOfClosestSphereFromGroup(), idx(), m_data, m_nx, and m_ny.

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::write ( char *  filename,
int  outputStyle 
)

References m_write_prec, and SetOutputStyle().

Referenced by exportMNTable2D().

Here is the call graph for this function:

void MNTable2D::WriteAsVtkXml ( ostream &  vtkfile) const
protected

output content as VTK-XML format

Parameters
vtkfilethe output stream

References MNTCell::getIdList(), idx(), m_bonds, m_data, m_nx, m_ny, MNTCell::NParts(), MNTCell::writeIDs(), MNTCell::writePositions(), MNTCell::writeRadii(), and MNTCell::writeTags().

Referenced by operator<<().

Here is the call graph for this function:

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const MNTable2D T 
)
friend

Output the content of a MNTable2D to an ostream. The output format depends on the value of MNTable2D::s_output_style (see MNTable2D::SetOutputStyle). If it is set to 0, output suitable for debugging is generated, if it is set to 1 output in the esys .geo format is generated. If MNTable2D::s_output_style is set to 2, the output format is VTK-XML.

Parameters
ostthe output stream
Tthe table

Member Data Documentation

int MNTable2D::m_write_prec
protected

precision (nr. of significant digits) for file output

Referenced by MNTable2D(), SetOutputPrecision(), and write().

int MNTable2D::m_x_periodic
protected
int MNTable2D::m_y_periodic
protected
int MNTable2D::s_output_style = 0
staticprotected

Referenced by operator<<(), and SetOutputStyle().


The documentation for this class was generated from the following files: