#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 extern int color_dir; //use direction color-coding or not extern float vec_scale; //scaling of hedgehogs extern int vis_dataset; extern int glyph_scalar; extern int glyph_vector; ////////////////// void select_dataset(int arg); void set_glyph_scalar(int arg); void set_glyph_vector(int arg); int fluids_get_var_dim(void); void fluids_set_var_dim(int); struct point { float x; float y; float z; }; struct scalar_frame { fftw_real *x; fftw_real *y; }; struct scalar_history { fftw_real *x[HISTORY_SIZE]; fftw_real *y[HISTORY_SIZE]; }; struct vis_data_arrays { fftw_real *rho; fftw_real *vel; fftw_real *force; struct scalar_frame frame; fftw_real *div_vel; fftw_real *div_force; fftw_real *height; struct point *normals; fftw_real *frame_history[HISTORY_SIZE]; struct scalar_history history; }; extern int active_slider; 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