GenGeo  1.1
MNTable3D Class Reference

Multi-group Neighbour table. More...

#include <MNTable3D.h>

Inheritance diagram for MNTable3D:
Collaboration diagram for MNTable3D:

Public Types

typedef pair< int, int > bond

Public Member Functions

 MNTable3D ()
 MNTable3D (const Vector3 &, const Vector3 &, double, unsigned int)
virtual ~MNTable3D ()
bool insertFromRawFile (const string &, double, double)
virtual bool insert (const Sphere &, unsigned int)
virtual bool insertChecked (const Sphere &, unsigned int, double=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
int getTagOfClosestSphereFromGroup (const Sphere &, int) const
const SpheregetClosestSphereFromGroup (const Sphere &, int, double, double, double) const
int getTagOfClosestSphereFromGroup (const Sphere &, int, double, double, double) const
void tagParticlesAlongPlane (const Plane &, double, int, unsigned int)
void tagParticlesAlongPlaneWithMask (const Plane &, double, int, int, unsigned int)
void tagParticlesInSphere (const Sphere &, int, unsigned int)
void tagParticlesInGroupNT (int tag, int gid)
void tagParticlesInGroup (int, int, int)
void tagParticlesToClosest (int, int)
void tagParticlesToClosestAnisotropic (int, int, double, double, double)
void removeParticlesWithTag (int, unsigned int)
void removeParticlesWithTagMask (unsigned int, int, int)
void removeParticlesInVolume (AVolume3D *, int, bool)
void removeParticlesInGroup (unsigned int)
void tagParticlesAlongJoints (const TriPatchSet &, double, int, int, unsigned int)
void tagParticlesInVolume (const AVolume &, int, unsigned int)
void renumberParticlesContinuous ()
virtual void calculateTightBoundingBox ()
void setBoundingBoxTracking (bool)
boost::python::list getSphereListFromGroup (int) const
boost::python::list getSphereListDist (const Vector3 &, double, int) const
virtual void generateBonds (int, double, int)
virtual void generateClusterBonds (int, double, int, int)
virtual void generateBondsWithJointSet (const TriPatchSet &, int, double, int)
virtual void generateBondsTagged (int, double, int, int, int)
virtual void generateRandomBonds (int, double, double, int, int, int)
void insertBond (int, int, int)
double getSumVolume (int)
void SetOutputPrecision (int)
void SetWriteTightBoundingBox (bool)
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, int k) const
void WriteAsVtkXml (ostream &) const
virtual void set_x_circ ()
virtual void set_y_circ ()
virtual void set_z_circ ()

Protected Attributes

MNTCellm_data
map< int, set< bond > > m_bonds
Vector3 m_origin
 origin
Vector3 m_min_pt
Vector3 m_max_pt
double m_celldim
 cell size
int m_nx
int m_ny
int m_nz
 number of cells in x-, y- and z-direction
unsigned int m_ngroups
int m_x_periodic
int m_y_periodic
int m_z_periodic
bool m_bbx_tracking
 if true, bbx is updated for each insert operation
bool m_has_tight_bbx
 true if a tight bounding box has been calculated
bool m_write_tight_bbx
 if true, tight bbx is written instead of min/max
Vector3 m_min_tbbx
Vector3 m_max_tbbx
 corner points of tight bounding box
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 MNTable3D &)

Detailed Description

Multi-group Neighbour table.

Neighbour table supporting multiple tagged groups of particles

Member Typedef Documentation

typedef pair<int,int> MNTable3D::bond

Constructor & Destructor Documentation

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

construct MNTable3D

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

References m_bbx_tracking, m_celldim, m_data, m_has_tight_bbx, m_max_pt, m_max_tbbx, m_min_pt, m_min_tbbx, m_ngroups, m_nx, m_ny, m_nz, m_origin, m_write_prec, m_write_tight_bbx, set_x_circ(), set_y_circ(), set_z_circ(), MNTCell::SetNGroups(), Vector3::X(), Vector3::Y(), and Vector3::Z().

Here is the call graph for this function:

MNTable3D::~MNTable3D ( )
virtual

destruct MNTable3D

References m_data.

Member Function Documentation

void MNTable3D::calculateTightBoundingBox ( )
virtual

Calculate a the axis-aligned bounding box of the current particle set

bool MNTable3D::checkInsertable ( const Sphere S,
unsigned int  gid 
)
virtual
void MNTable3D::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 CircMNTable3D, and FullCircMNTable3D.

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

Referenced by exportMNTable3D(), generate_granular_gouge(), and main().

Here is the call graph for this function:

void MNTable3D::generateBondsTagged ( int  gid,
double  tol,
int  btag,
int  tag1,
int  tag2 
)
virtual

generate bonds between particles with given tags of a group

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

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::generateBondsWithJointSet ( const TriPatchSet Joints,
int  gid,
double  tol,
int  tag 
)
virtual

generate bonds taking a list of joint surfaces into account, i.e. bonds which cross one of the surface get tagged differently (according to the tag of the joint)

Parameters
Jointsthe set of joint surfaces
gidthe particle group id
tolthe bond generation tolerance, i.e. bonds up to length (equilibrium length*tol) get generated
tagthe tag for the bonds not crossing any surface

References MNTCell::getBondsWithPos(), idx(), TriPatchSet::isCrossing(), m_bonds, m_data, m_nx, m_ny, and m_nz.

Referenced by exportMNTable3D().

Here is the call graph for this function:

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

Generate bonds between clusters of particles of a group, i.e. bonds with one tag between particles with the same ID and bonds with another tag between particles with different ID.

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)

Reimplemented in CircMNTable3D.

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::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
ptagparticle tag
mask

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

const vector< const Sphere * > MNTable3D::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, m_ny, and m_nz.

Referenced by generate_granular_gouge(), and getSphereListFromGroup().

Here is the call graph for this function:

const Sphere * MNTable3D::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, m_nz, and Sphere::Radius().

Referenced by getTagOfClosestSphereFromGroup().

Here is the call graph for this function:

const Sphere * MNTable3D::getClosestSphereFromGroup ( const Sphere s,
int  gid,
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
wxweighting of the x-component of the distance
wyweighting of the y-component of the distance
wzweighting of the z-component of the distance

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

Here is the call graph for this function:

int MNTable3D::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 FullCircMNTable3D, and CircMNTable3D.

References idx(), m_celldim, m_nx, m_ny, m_nz, m_origin, Vector3::x(), Vector3::y(), and Vector3::z().

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

Here is the call graph for this function:

boost::python::list MNTable3D::getSphereListDist ( const Vector3 pos,
double  dist,
int  gid 
) const

References getSpheresFromGroupNear().

Referenced by exportMNTable3D().

Here is the call graph for this function:

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

References getAllSpheresFromGroup().

Referenced by exportMNTable3D().

Here is the call graph for this function:

const multimap< double, const Sphere * > MNTable3D::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 HexAggregateInsertGenerator3D::fillIn(), and InsertGenerator3D::fillIn().

Here is the call graph for this function:

const multimap< double, const Sphere * > MNTable3D::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 FullCircMNTable3D::checkInsertable(), CircMNTable3D::checkInsertable(), checkInsertable(), getSphereListDist(), FullCircMNTable3D::insertChecked(), CircMNTable3D::insertChecked(), and insertChecked().

Here is the call graph for this function:

double MNTable3D::getSumVolume ( int  gid)

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

Referenced by exportCircMNTable3D(), exportMNTable3D(), InsertGenerator3D::fillIn(), and main().

Here is the call graph for this function:

int MNTable3D::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(), and tagParticlesToClosestAnisotropic().

Here is the call graph for this function:

int MNTable3D::getTagOfClosestSphereFromGroup ( const Sphere s,
int  gid,
double  wx,
double  wy,
double  wz 
) const

Convenience function which calls getClosestSphereFromGroup, using anisotropic weighted distance and returns the tag of the found sphere or -1 if none is found.

Parameters
sthe sphere
gidthe group
wxweighting of the x-component of the distance
wyweighting of the y-component of the distance
wzweighting of the z-component of the distance

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

Here is the call graph for this function:

void MNTable3D::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, m_nz, and MNTCell::SetNGroups().

Referenced by exportMNTable3D(), and generate_granular_gouge().

Here is the call graph for this function:

bool MNTable3D::insert ( const Sphere S,
unsigned int  gid 
)
virtual
void MNTable3D::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 exportMNTable3D(), HexAggregateShape::insert(), GenericShape::insert(), and HexAggregateInsertGenerator3D::ParticleToAggregate().

bool MNTable3D::insertChecked ( const Sphere S,
unsigned int  gid,
double  tol = s_small_value 
)
virtual
bool MNTable3D::insertFromRawFile ( const string &  filename,
double  scale,
double  tol 
)

Load particle from raw file: x y z r

Parameters
filenamethe name of the input file
scalefactor by which all data are scaled before insertion
tolallowed overlap

References insertChecked().

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::removeParticlesInGroup ( unsigned int  gid)

Remove all particle in a group. Convenience function combining tagParticlesInGroup and removeTaggedParticles

Parameters
gidthe ID of the group of the particles to be removed

References removeParticlesWithTag(), and tagParticlesInGroup().

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::removeParticlesInVolume ( AVolume3D Vol,
int  gid,
bool  full 
)

Remove all particles inside a given volume. The parameter "full" decides if only particles completely inside the volume are removed (full==true) or all particles with the center inside the volume (full==false)

Parameters
Volthe volume
fullremove particles fully inside / center inside

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::removeParticlesWithTag ( int  tag,
unsigned int  gid 
)

remove all particles with a given tag within a group, using default mask -1

Parameters
tagthe tag
gidthe group Id

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

Referenced by exportMNTable3D(), and removeParticlesInGroup().

Here is the call graph for this function:

void MNTable3D::removeParticlesWithTagMask ( unsigned int  gid,
int  tag,
int  mask 
)

remove all particles with a given tag within a group

Parameters
tagthe tag
gidthe group Id
maskthe mask

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::renumberParticlesContinuous ( )

change particle IDs so that they are continous

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::set_x_circ ( )
protectedvirtual

set circularity of x-dimension to 0

Reimplemented in CircMNTable3D.

References m_x_periodic.

Referenced by MNTable3D().

void MNTable3D::set_y_circ ( )
protectedvirtual

set circularity of y-dimension to 0

Reimplemented in FullCircMNTable3D.

References m_y_periodic.

Referenced by MNTable3D().

void MNTable3D::set_z_circ ( )
protectedvirtual

set circularity of z-dimension to 0

Reimplemented in FullCircMNTable3D.

References m_z_periodic.

Referenced by MNTable3D().

void MNTable3D::setBoundingBoxTracking ( bool  b)

Set bounding box tracking on/off

References m_bbx_tracking.

void MNTable3D::SetOutputPrecision ( int  prec)

Set output precision

Parameters
precnumber of significant digits

References m_write_prec.

Referenced by exportMNTable3D().

void MNTable3D::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 MNTable3D::SetWriteTightBoundingBox ( bool  b)

Switch if initial min/max points or current bounding box is written to geo file

References m_has_tight_bbx, and m_write_tight_bbx.

void MNTable3D::tagParticlesAlongJoints ( const TriPatchSet T,
double  dist,
int  tag,
int  mask,
unsigned int  gid 
)

tag all particles close to a joint set

Parameters
Tthe joint set
distmax. distance
thetag mask
tagthe tag
gidgroup Id

References MNTCell::getSpheresNearObject(), idx(), m_data, m_nx, m_ny, m_nz, TriPatchSet::triangles_begin(), and TriPatchSet::triangles_end().

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::tagParticlesAlongPlane ( const Plane P,
double  dist,
int  tag,
unsigned int  gid 
)

tag all particles close to a plane

Parameters
Pthe plane
distmax. distance
tagthe tag
gidgroup Id

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

Referenced by exportCircMNTable3D(), exportMNTable3D(), generate_lower_tri_rough_block(), and generate_upper_tri_rough_block().

Here is the call graph for this function:

void MNTable3D::tagParticlesAlongPlaneWithMask ( const Plane P,
double  dist,
int  tag,
int  mask,
unsigned int  gid 
)

tag all particles close to a plane

Parameters
Pthe plane
distmax. distance
thetag mask
tagthe tag
gidgroup Id

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::tagParticlesInGroup ( int  gid,
int  tag,
int  mask 
)

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

Referenced by exportMNTable3D(), removeParticlesInGroup(), and tagParticlesInGroupNT().

Here is the call graph for this function:

void MNTable3D::tagParticlesInGroupNT ( int  tag,
int  gid 
)
inline

References tagParticlesInGroup().

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::tagParticlesInSphere ( const Sphere S,
int  tag,
unsigned int  gid 
)

tag all particles fully within a sphere

Parameters
Sthe sphere
tagthe tag
gidgroup Id

References Sphere::Center(), getIndex(), MNTCell::getSpheresFromGroupNearNC(), idx(), m_celldim, m_data, and Sphere::Radius().

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::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, m_ny, and m_nz.

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::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, m_ny, and m_nz.

Referenced by exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::tagParticlesToClosestAnisotropic ( int  gid1,
int  gid2,
double  wx,
double  wy,
double  wz 
)

Tag the spheres in a group A according to the tag of the closest spheres from a another group B, using an anisotropic distance measure

Parameters
gid1the group Id A
gid1the group Id B
wxweighting of the x-component of the distance
wyweighting of the y-component of the distance
wzweighting of the z-component of the distance

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

Referenced by exportMNTable3D().

Here is the call graph for this function:

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

References m_write_prec, and SetOutputStyle().

Referenced by exportCircMNTable3D(), and exportMNTable3D().

Here is the call graph for this function:

void MNTable3D::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, m_nz, 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 MNTable3D T 
)
friend

Output the content of a MNTable3D to an ostream. The output format depends on the value of MNTable3D::s_output_style (see MNTable3D::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 MNTable3D::s_output_style is set to 2, the output format is VTK-XML.

Parameters
ostthe output stream
Tthe table

Member Data Documentation

bool MNTable3D::m_bbx_tracking
protected

if true, bbx is updated for each insert operation

Referenced by insert(), insertChecked(), MNTable3D(), and setBoundingBoxTracking().

bool MNTable3D::m_has_tight_bbx
protected

true if a tight bounding box has been calculated

Referenced by MNTable3D(), operator<<(), and SetWriteTightBoundingBox().

Vector3 MNTable3D::m_max_tbbx
protected

corner points of tight bounding box

Referenced by insert(), insertChecked(), MNTable3D(), and operator<<().

Vector3 MNTable3D::m_min_tbbx
protected
int MNTable3D::m_write_prec
protected

precision (nr. of significant digits) for file output

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

bool MNTable3D::m_write_tight_bbx
protected

if true, tight bbx is written instead of min/max

Referenced by MNTable3D(), operator<<(), and SetWriteTightBoundingBox().

int MNTable3D::m_x_periodic
protected
int MNTable3D::m_y_periodic
protected
int MNTable3D::m_z_periodic
protected
int MNTable3D::s_output_style = 0
staticprotected

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


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