Core 1.0
Dla Class Reference

A base diffusion limited aggregation class. More...

#include <dla.h>

Inheritance diagram for Dla:
ParticleSet

Public Member Functions

 Dla (const double &)
 Initialize the DLA structure.
 
 Dla (const QVector< Vector > &, const double &)
 Initialize the structure with a given set of seeds.
 
 ~Dla ()
 Empty.
 
void Add (int=1)
 Add one particle to the cluster.
 
bool Try ()
 Seed a random particle away from the cluster, randomly moves and checks collision with the cluster.
 
double Radius () const
 Return the radius of the particles.
 
QVector< VectorGetCenters () const
 Return the centers of the spheres.
 
- Public Member Functions inherited from ParticleSet
 ParticleSet ()
 Empty constructor.
 
 ParticleSet (const double &)
 Create an empty set of particles.
 
 ParticleSet (const Vector &, const double &)
 Create a set of particles.
 
 ParticleSet (const QVector< Vector > &, const double &)
 Create a set of particles.
 
int Size () const
 Return the number of particles.
 
Sphere At (int) const
 Get the k-th particle.
 
double Radius () const
 Return the radius of the particles.
 
QVector< VectorGetCenters () const
 Return the centers of the particles.
 
Sphere GetSphere () const
 Computes the bounding circle of the centers of the particles.
 
Box GetBox () const
 Computes the bounding box of the centers of the particles.
 
void Append (const Vector &)
 Add a new particle to the set.
 
bool Intersect (const Sphere &) const
 Check the intersection between the cluster and a circle.
 
bool Intersect (const Box &) const
 Check the intersection between the cluster and a box.
 

Public Attributes

int nfar = 0
 Record of number of particles that moved too far away.
 
int nhit = 0
 Collisions.
 
int ntry = 0
 Number of growth tries.
 

Static Public Attributes

static Random random
 Random number generator.
 

Protected Attributes

Box box = Box::Null
 Bounding box of the particles.
 
QVector< int > v
 Tree structure topology, i.e., index of the collided particle during cluster growth.
 
- Protected Attributes inherited from ParticleSet
QVector< Vectorpoints
 Set of particles.
 
double r = 0.0
 Radius of particles.
 

Detailed Description

A base diffusion limited aggregation class.

Constructor & Destructor Documentation

◆ Dla() [1/2]

Dla::Dla ( const double & r)
explicit

Initialize the DLA structure.

Parameters
rRadius of particles.

◆ Dla() [2/2]

Dla::Dla ( const QVector< Vector > & s,
const double & r )
explicit

Initialize the structure with a given set of seeds.

Parameters
sSet of seeds.
rRadius of particles.

Member Function Documentation

◆ Add()

void Dla::Add ( int n = 1)

Add one particle to the cluster.

Repeatedly performs a random walk untill one particle collides with the cluster and aggregates.

Parameters
nNumber of particles.
See also
Dla::Try()