lbm_reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
particles::ParticleSystem Class Reference

Particle system that handles creation, movement and visualization of particles. More...

#include <particles/ParticleSystem.h>

+ Collaboration diagram for particles::ParticleSystem:

Public Member Functions

 ParticleSystem ()
 Default constructor. More...
 
 ParticleSystem (std::string configFileName)
 Constructor that initializes the particle system according to given configuration file. More...
 
void run ()
 Main simulation loop. More...
 
void setup (ConfBlock &base)
 Set up the particle system according to configuration options. More...
 
virtual ~ParticleSystem ()
 Destructor. More...
 

Protected Member Functions

void emitParticles ()
 Go over all emitters and emit new particles. More...
 
void generateBlackBodyColorTable (float maxTemp)
 Generate a black body color table. More...
 
float getTime (timeval &start, timeval &end)
 
void updateParticles ()
 Go over all particles and update position, color and size. More...
 

Protected Attributes

float alpha_
 Thermal conservation coefficient. More...
 
float ambTemp_
 Ambient temperature. More...
 
std::vector< video::SColor > bbColorTable_
 Black body color table. More...
 
float beta_
 Thermal transferability coefficient. More...
 
IrrlichtDevice * device_
 Irrlicht OpenGL device. More...
 
video::IVideoDriver * drvr_
 Irrlicht OpenGL video driver. More...
 
bool dynamicLights_
 
std::vector< Emitteremitters_
 Vector containing all emitters of the particle system. More...
 
std::vector< float > gaussTable_
 Table of a precomputed Gaussian distribution. More...
 
core::vector3df gravity_
 Vector of inversed gravity. More...
 
std::string irrFileName_
 
float k_
 Thermal expansion coefficient. More...
 
int maxSteps_
 Total simulation timesteps. More...
 
int numParticles_
 Total number of generated particles. More...
 
int numSprites_
 Number of sprites assigned to each particle. More...
 
std::vector< core::aabbox3df > obstacles_
 Vector of axis-aligned cuboid obstacles. More...
 
std::string screenshots_
 
int screenStep_
 
float sizeBase_
 Basic particle size. More...
 
float sizeVar_
 Variable particle size, multiplied with a factor depending on lifetime. More...
 
int sizeX_
 Domain size in x-direction. More...
 
int sizeY_
 Domain size in y-direction. More...
 
int sizeZ_
 Domain size in z-direction. More...
 
scene::ISceneManager * smgr_
 Irrlicht scene manager. More...
 
float smokeTemp_
 Temperature threshold for a fire particle to turn into a smoke particle. More...
 
lbm::LBM< float > solver_
 Lattice Boltzmann fluid solver. More...
 
std::vector< Spherespheres_
 
std::vector< video::ITexture * > textures_
 Vector of particle textures. More...
 
std::string updFileName_
 

Detailed Description

Particle system that handles creation, movement and visualization of particles.

Irrlicht 3D engine is used for OpenGL visualization.

Definition at line 58 of file ParticleSystem.h.

Constructor & Destructor Documentation

particles::ParticleSystem::ParticleSystem ( )
inline

Default constructor.

Does nothing.

Definition at line 70 of file ParticleSystem.h.

particles::ParticleSystem::ParticleSystem ( std::string  configFileName)

Constructor that initializes the particle system according to given configuration file.

Parameters
[in]configFileNamePath to configuration file to parse

Definition at line 11 of file ParticleSystem.cpp.

References confparser::ConfParser::parse(), setup(), lbm::LBM< T >::setup(), and solver_.

virtual particles::ParticleSystem::~ParticleSystem ( )
inlinevirtual

Destructor.

Does nothing.

Definition at line 83 of file ParticleSystem.h.

Member Function Documentation

void particles::ParticleSystem::emitParticles ( )
inlineprotected

Go over all emitters and emit new particles.

Definition at line 651 of file ParticleSystem.cpp.

References bbColorTable_, device_, dynamicLights_, emitters_, numParticles_, numSprites_, sizeBase_, sizeVar_, smgr_, smokeTemp_, and textures_.

Referenced by run().

void particles::ParticleSystem::generateBlackBodyColorTable ( float  maxTemp)
protected

Generate a black body color table.

Parameters
[in]maxTempMaximum emitted particle temperature

Definition at line 688 of file ParticleSystem.cpp.

References bbColorTable_, smokeTemp_, and lbm::w.

Referenced by setup().

float particles::ParticleSystem::getTime ( timeval &  start,
timeval &  end 
)
inlineprotected

Definition at line 115 of file ParticleSystem.h.

Referenced by run().

void particles::ParticleSystem::run ( )
void particles::ParticleSystem::setup ( ConfBlock base)
void particles::ParticleSystem::updateParticles ( )
inlineprotected

Go over all particles and update position, color and size.

Definition at line 558 of file ParticleSystem.cpp.

References alpha_, ambTemp_, bbColorTable_, beta_, device_, emitters_, particles::FIRE, gaussTable_, lbm::LBM< T >::getVelocity(), gravity_, k_, numParticles_, obstacles_, sizeBase_, sizeVar_, sizeX_, sizeY_, sizeZ_, smokeTemp_, solver_, and spheres_.

Referenced by run().

Member Data Documentation

float particles::ParticleSystem::alpha_
protected

Thermal conservation coefficient.

Definition at line 146 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

float particles::ParticleSystem::ambTemp_
protected

Ambient temperature.

Definition at line 155 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

std::vector< video::SColor > particles::ParticleSystem::bbColorTable_
protected

Black body color table.

Definition at line 176 of file ParticleSystem.h.

Referenced by emitParticles(), generateBlackBodyColorTable(), and updateParticles().

float particles::ParticleSystem::beta_
protected

Thermal transferability coefficient.

Definition at line 149 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

IrrlichtDevice* particles::ParticleSystem::device_
protected

Irrlicht OpenGL device.

Definition at line 179 of file ParticleSystem.h.

Referenced by emitParticles(), run(), setup(), and updateParticles().

video::IVideoDriver* particles::ParticleSystem::drvr_
protected

Irrlicht OpenGL video driver.

Definition at line 185 of file ParticleSystem.h.

Referenced by run(), and setup().

bool particles::ParticleSystem::dynamicLights_
protected

Definition at line 201 of file ParticleSystem.h.

Referenced by emitParticles(), and setup().

std::vector< Emitter > particles::ParticleSystem::emitters_
protected

Vector containing all emitters of the particle system.

Definition at line 128 of file ParticleSystem.h.

Referenced by emitParticles(), setup(), and updateParticles().

std::vector<float> particles::ParticleSystem::gaussTable_
protected

Table of a precomputed Gaussian distribution.

Definition at line 173 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

core::vector3df particles::ParticleSystem::gravity_
protected

Vector of inversed gravity.

Definition at line 161 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

std::string particles::ParticleSystem::irrFileName_
protected

Definition at line 196 of file ParticleSystem.h.

Referenced by run(), and setup().

float particles::ParticleSystem::k_
protected

Thermal expansion coefficient.

Definition at line 158 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

int particles::ParticleSystem::maxSteps_
protected

Total simulation timesteps.

Definition at line 140 of file ParticleSystem.h.

Referenced by run(), and setup().

int particles::ParticleSystem::numParticles_
protected

Total number of generated particles.

Definition at line 143 of file ParticleSystem.h.

Referenced by emitParticles(), run(), and updateParticles().

int particles::ParticleSystem::numSprites_
protected

Number of sprites assigned to each particle.

Definition at line 170 of file ParticleSystem.h.

Referenced by emitParticles(), run(), and setup().

std::vector< core::aabbox3df > particles::ParticleSystem::obstacles_
protected

Vector of axis-aligned cuboid obstacles.

Definition at line 191 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

std::string particles::ParticleSystem::screenshots_
protected

Definition at line 198 of file ParticleSystem.h.

Referenced by run(), and setup().

int particles::ParticleSystem::screenStep_
protected

Definition at line 199 of file ParticleSystem.h.

Referenced by run(), and setup().

float particles::ParticleSystem::sizeBase_
protected

Basic particle size.

Definition at line 164 of file ParticleSystem.h.

Referenced by emitParticles(), setup(), and updateParticles().

float particles::ParticleSystem::sizeVar_
protected

Variable particle size, multiplied with a factor depending on lifetime.

Definition at line 167 of file ParticleSystem.h.

Referenced by emitParticles(), setup(), and updateParticles().

int particles::ParticleSystem::sizeX_
protected

Domain size in x-direction.

Definition at line 131 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

int particles::ParticleSystem::sizeY_
protected

Domain size in y-direction.

Definition at line 134 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

int particles::ParticleSystem::sizeZ_
protected

Domain size in z-direction.

Definition at line 137 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

scene::ISceneManager* particles::ParticleSystem::smgr_
protected

Irrlicht scene manager.

Definition at line 182 of file ParticleSystem.h.

Referenced by emitParticles(), run(), and setup().

float particles::ParticleSystem::smokeTemp_
protected

Temperature threshold for a fire particle to turn into a smoke particle.

Definition at line 152 of file ParticleSystem.h.

Referenced by emitParticles(), generateBlackBodyColorTable(), setup(), and updateParticles().

lbm::LBM<float> particles::ParticleSystem::solver_
protected

Lattice Boltzmann fluid solver.

Definition at line 125 of file ParticleSystem.h.

Referenced by ParticleSystem(), run(), and updateParticles().

std::vector< Sphere > particles::ParticleSystem::spheres_
protected

Definition at line 193 of file ParticleSystem.h.

Referenced by setup(), and updateParticles().

std::vector< video::ITexture* > particles::ParticleSystem::textures_
protected

Vector of particle textures.

Definition at line 188 of file ParticleSystem.h.

Referenced by emitParticles(), and setup().

std::string particles::ParticleSystem::updFileName_
protected

Definition at line 195 of file ParticleSystem.h.

Referenced by run(), and setup().


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