Eulerian Smoke Simulation on the GPU
GasSolver Class Reference

An OpenCL gas solver, that writes the simulation fields to 3D OpenGL textures. More...

#include <GasSolver.h>

List of all members.

Public Types

enum  DrivingFunction { NONE, SIN, COS, TAN }

Public Member Functions

 GasSolver (int _w, int _h, int _d, ComputeEngine *_compute, ImageUnitStack *_imageUnitStack)
 Constructor.
 ~GasSolver ()
 Destructor.
void init ()
 Initialization function.
void update ()
 Update function.
void updateObstacleData ()
 Updates the obstacle data.
PingPongVolumegetVelocity () const
 Accessor for the velocity ping-pong volume.
PingPongVolumegetPressure () const
 Accessor for the pressure ping-pong volume.
PingPongVolumegetTemperature () const
 Accessor for the temperature ping-pong volume.
PingPongVolumegetDensity () const
 Accessor for the density ping-pong volume.
ObstaclegetObstacles () const
 Accessor for the simulation obstacles.
void setCellSize (float _cellSize)
 Sets the simulation's cell size.
void setSplatRadius (float _splatRadius)
 Sets the splat radius.
void setAmbientTemperature (float _ambientTemperature)
 Sets the ambient temperature.
void setImpulseTemperature (float _impulseTemperature)
 Sets the impulse temperature.
void setImpulseDensity (float _impulseDensity)
 Sets the impulse density.
void setImpulsePosition (float _posX, float _posY, float _posZ)
 Sets the impulse position.
void setPoissonIterations (int _numPoissonIterations)
 Sets the number of iterations of the Poisson solver.
void setTimestep (float _timestep)
 Sets the time-step.
void setBuoyancyLift (float _buoyancyLift)
 Sets the buoyancy lift factor.
void setBuoyancyDirection (float _dirX, float _dirY, float _dirZ)
 Sets the buoyancy force direction.
void togglePeriodicNoise (bool _enablePeriodicNoise)
 Toggles the periodic noise function.
void setNoiseVariance (float _noiseVarianceX, float _noiseVarianceY, float _noiseVarianceZ)
 Sets the periodic noise variance.
void setNoiseDrivingFunc (int _funcIndexX, int _funcIndexY, int _funcIndexZ)
 Sets the periodic noise driving function.
void setGasWeight (float _gasWeight)
 Sets the gas' weight.
void setTemperatureDissipation (float _temperatureDissipation)
 Sets the temperature dissipation factor.
void setDensityDissipation (float _densityDissipation)
 Sets the density dissipation factor.
void setVelocityDissipation (float _velocityDissipation)
 Sets the velocity dissipation factor.

Detailed Description

An OpenCL gas solver, that writes the simulation fields to 3D OpenGL textures.

Author:
Nikolaos Verigakis
Version:
1.0
Date:
07/06/11 Revision History : Initial Version 07/06/11

Constructor & Destructor Documentation

GasSolver::GasSolver ( int  _w,
int  _h,
int  _d,
ComputeEngine _compute,
ImageUnitStack _imageUnitStack 
)

Constructor.

Parameters:
[in]_wthe simulation grid width
[in]_hthe simulation grid height
[in]_dthe simulation grid depth
[in]_computethe instance of the compute engine to use

Member Function Documentation

void GasSolver::setAmbientTemperature ( float  _ambientTemperature) [inline]

Sets the ambient temperature.

Parameters:
[in]_ambientTemperaturethe new ambient temperature
void GasSolver::setBuoyancyDirection ( float  _dirX,
float  _dirY,
float  _dirZ 
) [inline]

Sets the buoyancy force direction.

Parameters:
[in]_dirXthe direction in X
[in]_dirYthe direction in Y
[in]_dirZthe direction in Z
void GasSolver::setBuoyancyLift ( float  _buoyancyLift) [inline]

Sets the buoyancy lift factor.

Parameters:
[in]_buoyancyLiftthe new buoyancy lift constant
void GasSolver::setCellSize ( float  _cellSize) [inline]

Sets the simulation's cell size.

Parameters:
[in]_cellSizethe new cell size
void GasSolver::setDensityDissipation ( float  _densityDissipation) [inline]

Sets the density dissipation factor.

Parameters:
[in]_densityDissipationthe new density dissipation
void GasSolver::setGasWeight ( float  _gasWeight) [inline]

Sets the gas' weight.

Parameters:
[in]_gasWeightthe new gas weight
void GasSolver::setImpulseDensity ( float  _impulseDensity) [inline]

Sets the impulse density.

Parameters:
[in]_impulseDensitythe new impulse density
void GasSolver::setImpulsePosition ( float  _posX,
float  _posY,
float  _posZ 
) [inline]

Sets the impulse position.

Parameters:
[in]_posXthe X coordinate of the splat
[in]_posYthe Y coordinate of the splat
[in]_posZthe Z coordinate of the splat
void GasSolver::setImpulseTemperature ( float  _impulseTemperature) [inline]

Sets the impulse temperature.

Parameters:
[in]_impulseTemperaturethe new impulse temperature
void GasSolver::setNoiseDrivingFunc ( int  _funcIndexX,
int  _funcIndexY,
int  _funcIndexZ 
)

Sets the periodic noise driving function.

Parameters:
[in]_funcIndexXthe index of the driving function in X
[in]_funcIndexYthe index of the driving function in Y
[in]_funcIndexZthe index of the driving function in Z
void GasSolver::setNoiseVariance ( float  _noiseVarianceX,
float  _noiseVarianceY,
float  _noiseVarianceZ 
) [inline]

Sets the periodic noise variance.

Parameters:
[in]_noiseVarianceXthe turbulance variance in X
[in]_noiseVarianceYthe turbulance variance in Y
[in]_noiseVarianceZthe turbulance variance in Z
void GasSolver::setPoissonIterations ( int  _numPoissonIterations) [inline]

Sets the number of iterations of the Poisson solver.

Parameters:
[in]_numPoissonIterationsthe number of iterations
void GasSolver::setSplatRadius ( float  _splatRadius) [inline]

Sets the splat radius.

Parameters:
[in]_splatRadiusthe new splat radius
void GasSolver::setTemperatureDissipation ( float  _temperatureDissipation) [inline]

Sets the temperature dissipation factor.

Parameters:
[in]_temperatureDissipationthe new temperature dissipation
void GasSolver::setTimestep ( float  _timestep) [inline]

Sets the time-step.

Parameters:
[in]_timestepthe new time-step
void GasSolver::setVelocityDissipation ( float  _velocityDissipation) [inline]

Sets the velocity dissipation factor.

Parameters:
[in]_velocityDissipationthe new velocity dissipation
void GasSolver::togglePeriodicNoise ( bool  _enablePeriodicNoise) [inline]

Toggles the periodic noise function.

Parameters:
[in]_enablePeriodicNoisethe periodic noise toggling flag

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables