Public Member Functions
Simulation Class Reference

List of all members.

Public Member Functions

 Simulation ()
 ~Simulation ()
void restart ()
void loadNewScenario (SWE_Scenario *scene)
void resize (float factor)
void setBathBuffer (float *output)
void runCuda (struct cudaGraphicsResource **vbo_resource, struct cudaGraphicsResource **vbo_normals)
int getNx ()
int getNy ()
const Float2DgetBathymetry ()
void getScalingApproximation (float &bScale, float &bOffset, float &wScale)

Constructor & Destructor Documentation

Constructor. Initializes SWE_BlockCUDA and creates a new instance of it.


Member Function Documentation

void Simulation::getScalingApproximation ( float &  bScale,
float &  bOffset,
float &  wScale 

Computes a first approximation of the scaling values needed for visualization. Gets called before simulation starts and determines the average, mininimum and maximum values of the bathymetry and water surface data. Uses latter values to estimate the scaling factors.

Restarts the simulation. Restores the initial bondaries.

void Simulation::runCuda ( struct cudaGraphicsResource **  vbo_resource,
struct cudaGraphicsResource **  vbo_normals 

This is the main simulation procedure. Simulates one timestep and computes normals afterwards.

vbo_resourcecuda resource holding the vertex positions
vbo_normalscuda resource holding the normals
void Simulation::setBathBuffer ( float *  bath)

Sets the bathymetry buffer. Buffer contains vertex position and vertex normal in sequence.

bathfloat array in which computed values will be stored

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends