#ifndef _FLUIDS_H #define _FLUIDS_H //--- SIMULATION PARAMETERS ------------------------------------------------------------------------ extern double dt; //simulation time step extern float visc; //fluid viscosity extern fftw_real *vx, *vy; //(vx,vy) = velocity field at the current moment extern fftw_real *fx, *fy; //(fx,fy) = user-controlled simulation forces, steered with the mouse extern fftw_real *rho; //smoke density at the current (rho) and previous (rho0) moment extern rfftwnd_plan plan_rc, plan_cr; //simulation domain discretization extern fftw_real *height_array; //used for hight plot struct point *normal_array; //used for normal vectors extern int *frame_hist; extern int frame_index; //--- VISUALIZATION PARAMETERS --------------------------------------------------------------------- #define DATASET_RHO 0 #define DATASET_VEL 1 #define DATASET_FORCE 2 #define DATASET_DIVV 3 #define DATASET_DIVF 4 #define DATASET_HIST 5 #define SCALAR_RHO 0 #define SCALAR_VEL 1 #define SCALAR_FORCE 2 #define VECTOR_VEL 0 #define VECTOR_FORCE 1 #define HISTORY_SIZE 80 extern int winWidth, winHeight; //size of the graphics window, in pixels ////////////////// int fluids_get_var_dim(void); void fluids_set_var_dim(int); struct point { float x; float y; float z; }; struct point2f { float x; float y; }; struct fftw_real_xy { fftw_real *x; fftw_real *y; }; struct vis_data_arrays { fftw_real *rho; fftw_real *vel; fftw_real *force; struct fftw_real_xy scalars; fftw_real *div_vel; fftw_real *div_force; fftw_real *height; struct point *normals; fftw_real *history_frame[HISTORY_SIZE]; struct fftw_real_xy *history_scalars[HISTORY_SIZE]; }; void fluids_set_calculate(int calculate); int fluids_get_calculate(void); void fluids_insert_smoke(int x, int y); int fluids_get_dim(void); void fluids_init_simulation(int n, struct vis_data_arrays *vis_data); void fluids_reset_simulation(void); void fluids_calculate_one_simulation_step(struct vis_data_arrays *vis_data); int fluids_get_hisdex(void); #endif