GenGeo  1.1
MNTCell Class Reference

class for a cell in a neighbor table (MNTable2D or MNTable3D) More...

#include <MNTCell.h>

Collaboration diagram for MNTCell:

Public Member Functions

 MNTCell (unsigned int ngroups=1)
void SetNGroups (unsigned int)
void insert (const Sphere &, int)
int NParts () const
const multimap< double, const
Sphere * > 
getSpheresNear (const Vector3 &, double) const
const multimap< double, const
Sphere * > 
getSpheresFromGroupNear (const Vector3 &, double, int) const
multimap< double, Sphere * > getSpheresFromGroupNearNC (const Vector3 &, double, int)
const multimap< double, const
Sphere * > 
getSpheresClosestTo (const Vector3 &, unsigned int) const
const SpheregetClosestSphereFromGroup (const Sphere &, int, double) const
const SpheregetClosestSphereFromGroup (const Sphere &, int, double, double, double, double) const
SpheregetClosestSphereFromGroup (const Vector3 &, int, double)
const vector< const Sphere * > getAllSpheresFromGroup (int) const
vector< Sphere * > getAllSpheresFromGroupNC (int)
const vector< Sphere * > getSpheresNearObject (const AGeometricObject *, double, unsigned int)
const vector< Sphere * > getSpheresInVolume (const AVolume *, unsigned int)
vector< int > getIdList ()
void remove (int, int)
void removeTagged (int, int, int)
void removeInVolume (const AVolume *, int, bool)
void tagSpheresNear (const Vector3 &, double, int, int)
void tagClosestParticle (const Vector3 &, int, int)
void tagSpheresInGroup (int, int, int)
int renumberParticlesContinuous (int)
vector< pair< int, int > > getBonds (int, double)
vector< pair< int, int > > getBonds (int, double, const MNTCell &)
vector< BondWithPosgetBondsWithPos (int, double)
vector< BondWithPosgetBondsWithPos (int, double, const MNTCell &)
vector< pair< int, int > > getBonds (int, double, int, int)
vector< pair< int, int > > getBonds (int, double, const MNTCell &, int, int)
vector< pair< int, int > > getBondsSame (int, double)
vector< pair< int, int > > getBondsSame (int, double, const MNTCell &)
vector< pair< int, int > > getBondsDiff (int, double)
vector< pair< int, int > > getBondsDiff (int, double, const MNTCell &)
vector< pair< int, int > > getBondsTagged (int, double, int, int)
vector< pair< int, int > > getBondsTagged (int, double, const MNTCell &, int, int)
vector< pair< int, int > > getBondsTaggedMasked (int, double, int, int, int, int)
vector< pair< int, int > > getBondsTaggedMasked (int, double, const MNTCell &, int, int, int, int)
double getSumVolume2D (unsigned int)
double getSumVolume3D (unsigned int)
int getNrParticles (int)
void writePositions (ostream &)
void writeRadii (ostream &)
void writeIDs (ostream &)
void writeTags (ostream &)

Static Public Member Functions

static void SetOutputStyle (int)

Private Attributes

vector< vector< Sphere > > m_data

Static Private Attributes

static int s_output_style = 0

Friends

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

Detailed Description

class for a cell in a neighbor table (MNTable2D or MNTable3D)

Constructor & Destructor Documentation

MNTCell::MNTCell ( unsigned int  ngroups = 1)

construct MNTCell

Parameters
ngroupsinitial number of particle groups, can be extended later

References m_data.

Member Function Documentation

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

get all spheres from a group

Parameters
gidthe goup Id

References m_data.

Referenced by MNTable2D::getAllSpheresFromGroup(), and MNTable3D::getAllSpheresFromGroup().

vector< Sphere * > MNTCell::getAllSpheresFromGroupNC ( int  gid)

get all spheres from a group

Parameters
gidthe goup Id

References m_data.

Referenced by MNTable2D::tagParticlesToClosest(), MNTable3D::tagParticlesToClosest(), and MNTable3D::tagParticlesToClosestAnisotropic().

vector< pair< int, int > > MNTCell::getBonds ( int  gid,
double  tol 
)
vector< pair< int, int > > MNTCell::getBonds ( int  gid,
double  tol,
const MNTCell C 
)

inter-cell bonds

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell

References m_data.

vector< pair< int, int > > MNTCell::getBonds ( int  gid,
double  tol,
int  ptag,
int  mask 
)

intra-cell bonds between particles with the same, defined tag

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

References m_data.

vector< pair< int, int > > MNTCell::getBonds ( int  gid,
double  tol,
const MNTCell C,
int  ptag,
int  mask 
)

inter-cell bonds between particles with the same, defined tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell
ptagthe particle tag
maskthe mask for the particle tag

References m_data.

vector< pair< int, int > > MNTCell::getBondsDiff ( int  gid,
double  tol 
)

intra-cell bonds between particles with a different (arbitrary) tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.

References m_data.

Referenced by CircMNTable3D::generateClusterBonds(), MNTable2D::generateClusterBonds(), and MNTable3D::generateClusterBonds().

vector< pair< int, int > > MNTCell::getBondsDiff ( int  gid,
double  tol,
const MNTCell C 
)

inter-cell bonds between particles with a different (arbitrary) tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell

References m_data.

vector< pair< int, int > > MNTCell::getBondsSame ( int  gid,
double  tol 
)

intra-cell bonds between particles with the same (arbitrary) tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.

References m_data.

Referenced by CircMNTable3D::generateClusterBonds(), MNTable2D::generateClusterBonds(), and MNTable3D::generateClusterBonds().

vector< pair< int, int > > MNTCell::getBondsSame ( int  gid,
double  tol,
const MNTCell C 
)

inter-cell bonds between particles with the same (arbitrary) tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell

References m_data.

vector< pair< int, int > > MNTCell::getBondsTagged ( int  gid,
double  tol,
int  tag1,
int  tag2 
)

intra-cell bonds between particles with 2 defined tags

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
tag11st particle tag
tag22nd particle tag

References m_data.

Referenced by MNTable3D::generateBondsTagged().

vector< pair< int, int > > MNTCell::getBondsTagged ( int  gid,
double  tol,
const MNTCell C,
int  tag1,
int  tag2 
)

inter-cell bonds between particles with 2 defined tags

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell
tag11st particle tag
tag22nd particle tag

References m_data.

vector< pair< int, int > > MNTCell::getBondsTaggedMasked ( int  gid,
double  tol,
int  tag1,
int  mask1,
int  tag2,
int  mask2 
)

intra-cell bonds between particles with 2 defined tags

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
tag11st particle tag
tag22nd particle tag

References m_data.

Referenced by MNTable2D::generateBondsTaggedMasked().

vector< pair< int, int > > MNTCell::getBondsTaggedMasked ( int  gid,
double  tol,
const MNTCell C,
int  tag1,
int  mask1,
int  tag2,
int  mask2 
)

inter-cell bonds between particles with 2 defined tags

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.
Cthe other cell
tag11st particle tag
tag22nd particle tag

References m_data.

vector< BondWithPos > MNTCell::getBondsWithPos ( int  gid,
double  tol 
)

intra-cell bonds with positions

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.

References BondWithPos::first, BondWithPos::firstPos, m_data, BondWithPos::second, and BondWithPos::secondPos.

Referenced by MNTable3D::generateBondsWithJointSet().

vector< BondWithPos > MNTCell::getBondsWithPos ( int  gid,
double  tol,
const MNTCell C 
)

intra-cell bonds between particles with the same (arbitrary) tag

Parameters
gidgroup ID
tolmax. difference between bond length and equilibrium dist.

References BondWithPos::first, BondWithPos::firstPos, m_data, BondWithPos::second, and BondWithPos::secondPos.

const Sphere * MNTCell::getClosestSphereFromGroup ( const Sphere s,
int  gid,
double  md 
) const

get the sphere within a given group closest to given sphere

Parameters
sthe sphere
gidthe group
maximumdistance

References Sphere::Center(), Sphere::getDist(), m_data, and Sphere::Radius().

Referenced by MNTable2D::getClosestSphereFromGroup(), and MNTable3D::getClosestSphereFromGroup().

Here is the call graph for this function:

const Sphere * MNTCell::getClosestSphereFromGroup ( const Sphere s,
int  gid,
double  md,
double  wx,
double  wy,
double  wz 
) const

Get the sphere within a given group closest to given sphere, using anisotropic weighted distance.

Parameters
sthe sphere
gidthe group
mddistance

References Sphere::Center(), and m_data.

Here is the call graph for this function:

Sphere * MNTCell::getClosestSphereFromGroup ( const Vector3 p,
int  gid,
double  md 
)

get the sphere within a given group closest to given sphere

Parameters
sthe sphere
gidthe group
maximumdistance

References m_data.

vector< int > MNTCell::getIdList ( )

get Ids of particles in cell

References m_data.

Referenced by MNTable2D::WriteAsVtkXml(), and MNTable3D::WriteAsVtkXml().

int MNTCell::getNrParticles ( int  gid)

get the number of particles in a group

Parameters
gidthe group id

References m_data.

Referenced by MNTable2D::getNrParticles().

const multimap< double, const Sphere * > MNTCell::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 m_data.

Referenced by MNTable2D::getSpheresClosestTo(), and MNTable3D::getSpheresClosestTo().

const multimap< double, const Sphere * > MNTCell::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 m_data.

Referenced by MNTable2D::getSpheresFromGroupNear(), and MNTable3D::getSpheresFromGroupNear().

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

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 m_data.

Referenced by MNTable3D::tagParticlesInSphere().

const vector< Sphere * > MNTCell::getSpheresInVolume ( const AVolume V,
unsigned int  gid 
)

get particles inside a volume

Parameters
Vthe volume
gidthe group Id

References AVolume::isIn(), and m_data.

Referenced by MNTable2D::tagParticlesInVolume(), and MNTable3D::tagParticlesInVolume().

Here is the call graph for this function:

const multimap< double, const Sphere * > MNTCell::getSpheresNear ( const Vector3 P,
double  d 
) const

get all spheres within a given distance to a point, irrespective of group

Parameters
Pthe point
dmax. distance between the point and the surface of the sphere

References m_data.

const vector< Sphere * > MNTCell::getSpheresNearObject ( const AGeometricObject G,
double  dist,
unsigned int  gid 
)

get particles close to geometric object

Parameters
Gthe geometric object
distthe maximum distance
gidthe group Id

References AGeometricObject::getDist(), and m_data.

Referenced by MNTable2D::breakBondsAlongLineSegment(), MNTable3D::tagParticlesAlongJoints(), MNTable2D::tagParticlesAlongLine(), MNTable2D::tagParticlesAlongLineSegment(), MNTable2D::tagParticlesAlongLineWithMask(), MNTable3D::tagParticlesAlongPlane(), and MNTable3D::tagParticlesAlongPlaneWithMask().

Here is the call graph for this function:

double MNTCell::getSumVolume2D ( unsigned int  gid)

get the sum of the area/volume of all particles in a group, assuming 2D

Parameters
gidthe group id

References m_data.

Referenced by MNTable2D::getSumVolume().

double MNTCell::getSumVolume3D ( unsigned int  gid)

get the sum of the area/volume of all particles in a group, assuming 3D

Parameters
gidthe group id

References m_data.

Referenced by MNTable3D::getSumVolume().

int MNTCell::NParts ( ) const
void MNTCell::remove ( int  id,
int  gid 
)

remove particle with given id

Parameters
idthe particle id
gidthe group Id
void MNTCell::removeInVolume ( const AVolume Vol,
int  gid,
bool  full 
)

remove particles inside a volume

Parameters
Volthe volume
fullremove particles fully inside volume or center inside

References AVolume::isIn(), and m_data.

Referenced by MNTable3D::removeParticlesInVolume().

Here is the call graph for this function:

void MNTCell::removeTagged ( int  gid,
int  tag,
int  mask 
)

remove particles with a given tag

Parameters
tagthe particle tag
maskthe tag mask
gidthe group Id

References m_data.

Referenced by MNTable3D::removeParticlesWithTag(), MNTable3D::removeParticlesWithTagMask(), and MNTable2D::removeTagged().

int MNTCell::renumberParticlesContinuous ( int  id0)

change particle IDs so that they are continous

Parameters
id0lowest ID to be used
Returns
lowest free ID, i.e. highest used ID+1

References m_data.

Referenced by MNTable3D::renumberParticlesContinuous().

void MNTCell::SetNGroups ( unsigned int  ngroups)

increase the number of groups. If the number of groups is already greater then the given number, do nothing.

Parameters
ngroupsthe new number of groups

References m_data.

Referenced by MNTable2D::GrowNGroups(), MNTable3D::GrowNGroups(), MNTable2D::MNTable2D(), and MNTable3D::MNTable3D().

void MNTCell::SetOutputStyle ( int  style)
static

Set output style

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

References s_output_style.

Referenced by operator<<().

void MNTCell::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 m_data.

void MNTCell::tagSpheresInGroup ( int  gid,
int  tag,
int  mask 
)

References m_data.

Referenced by MNTable3D::tagParticlesInGroup().

void MNTCell::tagSpheresNear ( const Vector3 p,
double  dist,
int  gid,
int  tag 
)

tag the closest spheres to a given point

Parameters
pthe point
distmax. distance to which particles are tagged
gidthe group Id
tagthe tag

References m_data.

Referenced by MNTable2D::tagParticlesNear().

void MNTCell::writeIDs ( ostream &  ost)
void MNTCell::writePositions ( ostream &  ost)
void MNTCell::writeRadii ( ostream &  ost)
void MNTCell::writeTags ( ostream &  ost)

Friends And Related Function Documentation

ostream& operator<< ( ostream &  ost,
const MNTCell C 
)
friend

Member Data Documentation

int MNTCell::s_output_style = 0
staticprivate

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


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