Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

ParticleFate Class Reference

#include <ParticleFate.h>

Inheritance diagram for ParticleFate:

Inheritance graph
[legend]
Collaboration diagram for ParticleFate:

Collaboration graph
[legend]
List of all members.

Detailed Description

This is the class which governs particle birth and death as described by Witkin and Heckbert.

Particles which are large and have low energy birth new particles and particles which are overcroweded are killed.

Definition at line 22 of file ParticleFate.h.

Public Member Functions

 MAKE_PARTICLESTUFF_NAME ()
int qlen ()
 Returns length of particle stuff parameters.

void getq (double *q)
 Get the parameters.

void setq (double *q)
 Set particle stuff parameters.

void qname (char **qn)
 Get the names of the parameters.

virtual char * tip ()
 Returns a tool-tip for the ParticleStuff.

virtual char * qtip (int i)
 Returns a tool-tip for the parameter i.

virtual void attachAttributes ()
 Attach all the attributes needed by the behavior.

 ParticleFate (Particles *ps=NULL, ParticleBoundingBox *b=NULL, std::string name=std::string("ParticleFate"))
 Creates a ParticleFate object.

double setSurfaceDiameter (double d)
 Allows for an awareness of surface diameter.

void setDesiredRadius (double &r)
 Allow the user to specify the desired radius.

void setBounds (ParticleBoundingBox *bounds)
 Allow the user to specify a bounding volume.

void cleanup ()
 We determine particle fate during the cleanup step.


Public Attributes

AdaptiveRepulsionDatarep_data
 Witkin-Heckbert repulsion data.

ParticleOrientationp_orient
 Particle orientations.

ParticleBoundingBoxp_bounds
 Bounding box.

double gamma
 Equilibrium speed (multiple of repulsion radius).

double nu
 Fraction of E_hat, for fissioning.

double delta
 Fraction of sigma_hat, for death.

int population


Constructor & Destructor Documentation

ParticleFate::ParticleFate Particles ps = NULL,
ParticleBoundingBox b = NULL,
std::string  name = std::string("ParticleFate")
 

Creates a ParticleFate object.

First it looks for the required attributes in the particle system, and then it sets default constants.

Definition at line 27 of file ParticleFate.cpp.

References delta, gamma, nu, p_bounds, population, WH_DELTA, WH_GAMMA, and WH_NU.


Member Function Documentation

void ParticleFate::attachAttributes  )  [virtual]
 

Attach all the attributes needed by the behavior.

Defaults to a nop.

Reimplemented from ParticleBehavior.

Definition at line 37 of file ParticleFate.cpp.

References ParticleStuff::attachAttribute(), ParticleBehavior::attachAttributes(), AdaptiveRepulsionData::diameter, INITIAL_DIAMETER, p_orient, rep_data, setSurfaceDiameter(), AdaptiveRepulsionData::sigma_hat, and AdaptiveRepulsionData::sigma_max.

void ParticleFate::cleanup  )  [virtual]
 

We determine particle fate during the cleanup step.

Determine whether or not particle is to die: 1) Particle velocity is small compared to nominal repulsion radius 2) Repulsion radius is smaller than minimum repulsion radius 3) Biased random test succeds OR 4) Particle falls outside of the bounding box

Determine whether or not to split: (Condition 1: particle is near equilibrium) AND (Condition 2a: repulsion radius is huge OR Condition 2b: particle is adequately energized and repulsion radius is higher than nominal)

Reimplemented from ParticleBehavior.

Definition at line 119 of file ParticleFate.cpp.

References Particles::addParticle(), AdaptiveRepulsionData::D, delta, AdaptiveRepulsionData::Ehat, gamma, ParticlePosition::getPosition(), ParticleOrientation::gradMag2, ParticleBoundingBox::keepInBounds(), ParticleOrientation::n, nu, p_bounds, p_orient, population, ParticleBehavior::position, ParticleStuff::ps, psRandom(), AdaptiveRepulsionData::r, randOrtho(), Particles::removeParticle(), rep_data, ParticlePosition::setPosition(), AdaptiveRepulsionData::sigma_hat, AdaptiveRepulsionData::sigma_max, Particles::size(), ParticleVelocity::v, and ParticleBehavior::velocity.

void ParticleFate::getq double *  q  )  [virtual]
 

Get the parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 54 of file ParticleFate.cpp.

References delta, gamma, nu, and population.

ParticleFate::MAKE_PARTICLESTUFF_NAME  ) 
 

int ParticleFate::qlen  )  [virtual]
 

Returns length of particle stuff parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 49 of file ParticleFate.cpp.

void ParticleFate::qname char **  qn  )  [virtual]
 

Get the names of the parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 70 of file ParticleFate.cpp.

virtual char* ParticleFate::qtip int  i  )  [inline, virtual]
 

Returns a tool-tip for the parameter i.

Reimplemented from ParticleStuff.

Definition at line 42 of file ParticleFate.h.

void ParticleFate::setBounds ParticleBoundingBox bounds  )  [inline]
 

Allow the user to specify a bounding volume.

Stops new particles from being spawned out of bounds.

Definition at line 65 of file ParticleFate.h.

References p_bounds.

void ParticleFate::setDesiredRadius double &  r  ) 
 

Allow the user to specify the desired radius.

This will modify the number and size of particles on the surface.

Parameters:
r Desired radius.
Note:
The resulting radius is bounded by the surface rep_data->diameter.

Definition at line 100 of file ParticleFate.cpp.

References AdaptiveRepulsionData::diameter, rep_data, AdaptiveRepulsionData::sigma_hat, and AdaptiveRepulsionData::sigma_max.

void ParticleFate::setq double *  q  )  [virtual]
 

Set particle stuff parameters.

Defaults to no parameters.

Reimplemented from ParticleStuff.

Definition at line 62 of file ParticleFate.cpp.

References delta, gamma, nu, and population.

double ParticleFate::setSurfaceDiameter double  d  ) 
 

Allows for an awareness of surface diameter.

Parameters:
d New surface rep_data->diameter.
Returns:
New desired readius.

Definition at line 83 of file ParticleFate.cpp.

References AdaptiveRepulsionData::diameter, rep_data, AdaptiveRepulsionData::sigma_hat, and AdaptiveRepulsionData::sigma_max.

Referenced by attachAttributes().

virtual char* ParticleFate::tip  )  [inline, virtual]
 

Returns a tool-tip for the ParticleStuff.

Reimplemented from ParticleStuff.

Definition at line 40 of file ParticleFate.h.


Member Data Documentation

double ParticleFate::delta
 

Fraction of sigma_hat, for death.

Definition at line 32 of file ParticleFate.h.

Referenced by cleanup(), getq(), ParticleFate(), and setq().

double ParticleFate::gamma
 

Equilibrium speed (multiple of repulsion radius).

Definition at line 30 of file ParticleFate.h.

Referenced by cleanup(), getq(), ParticleFate(), and setq().

double ParticleFate::nu
 

Fraction of E_hat, for fissioning.

Definition at line 31 of file ParticleFate.h.

Referenced by cleanup(), getq(), ParticleFate(), and setq().

ParticleBoundingBox* ParticleFate::p_bounds
 

Bounding box.

Definition at line 26 of file ParticleFate.h.

Referenced by cleanup(), ParticleFate(), and setBounds().

ParticleOrientation* ParticleFate::p_orient
 

Particle orientations.

Definition at line 25 of file ParticleFate.h.

Referenced by attachAttributes(), and cleanup().

int ParticleFate::population
 

Definition at line 33 of file ParticleFate.h.

Referenced by cleanup(), getq(), ParticleFate(), and setq().

AdaptiveRepulsionData* ParticleFate::rep_data
 

Witkin-Heckbert repulsion data.

Definition at line 24 of file ParticleFate.h.

Referenced by attachAttributes(), cleanup(), setDesiredRadius(), and setSurfaceDiameter().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:02:41 2004 for Advanced Surface Library by doxygen 1.3.4