diff options
author | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-14 18:02:27 (GMT) |
---|---|---|
committer | Oliver Schinagl <oliver@schinagl.nl> | 2007-12-14 18:02:27 (GMT) |
commit | 5a422dac78479f396437b5f9c1e8efbecf2c9b0f (patch) | |
tree | b9910125b40708a3cd496ec46312012350886a7c /Smoke/fluids.h | |
parent | 241bfc64ed6446c295846d5ae635f6ba4e25a666 (diff) | |
download | 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.zip 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.tar.gz 2iv35-5a422dac78479f396437b5f9c1e8efbecf2c9b0f.tar.bz2 |
latest merge
Diffstat (limited to 'Smoke/fluids.h')
-rw-r--r-- | Smoke/fluids.h | 278 |
1 files changed, 136 insertions, 142 deletions
diff --git a/Smoke/fluids.h b/Smoke/fluids.h index 8ff6cbd..33d8d08 100644 --- a/Smoke/fluids.h +++ b/Smoke/fluids.h @@ -1,145 +1,139 @@ -#ifndef _FLUIDS_H
-#define _FLUIDS_H
-
-#include <rfftw.h>
-#include <GL/gl.h>
-#include <GL/glu.h>
-
-//--- SIMULATION PARAMETERS ------------------------------------------------------------------------
-
-extern const int DIM; //size of simulation grid
-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 *vx0, *vy0; //(vx0,vy0) = velocity field at the previous moment
-extern fftw_real *fx, *fy; //(fx,fy) = user-controlled simulation forces, steered with the mouse
-extern fftw_real *rho, *rho0; //smoke density at the current (rho) and previous (rho0) moment
-extern rfftwnd_plan plan_rc, plan_cr; //simulation domain discretization
+#ifndef _FLUIDS_H +#define _FLUIDS_H + +#include <rfftw.h> +#include <GL/gl.h> +#include <GL/glu.h> + +//--- SIMULATION PARAMETERS ------------------------------------------------------------------------ + +extern const int DIM; //size of simulation grid +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 *vx0, *vy0; //(vx0,vy0) = velocity field at the previous moment +extern fftw_real *fx, *fy; //(fx,fy) = user-controlled simulation forces, steered with the mouse +extern fftw_real *rho, *rho0; //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 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 COLOR_BLACKWHITE 0
-#define COLOR_RAINBOW 1
-#define COLOR_BANDS 2
-#define COLOR_BLUE_GREEN_RED 3
-#define COLOR_WILRIK 4
-#define COLOR_OLIVER 5
-
-#define MOUSE_SMOKE 0
-#define MOUSE_SCALE_MIN 1
-#define MOUSE_SCALE_MAX 2
-#define MOUSE_CLAMP_MIN 3
-#define MOUSE_CLAMP_MAX 4
-
-#define GLYPHS_OFF 0
-#define GLYPHS_ON 1
-
-#define SCALAR_RHO 0
-#define SCALAR_VEL 1
-#define SCALAR_FORCE 2
-
-#define VECTOR_VEL 0
-#define VECTOR_FORCE 1
-
-#define GLYPH_ARROWS 0
-#define GLYPH_LINES 1
-#define GLYPH_CYLINDERS 2
-#define GLYPH_SPHERES 3
-
-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 draw_smoke; //draw the smoke or not
-extern int draw_vecs; //draw the vector field or not
-extern int scalar_col; //method for scalar coloring
-extern int frozen; //toggles on/off the animation
-extern float clamp_min;
-extern float clamp_max;
-extern int autoscale;
-extern float scale_min;
-extern float scale_max;
-extern int vis_dataset;
-extern int mousebutton;
-extern int mousebuttonstate;
-extern int active_slider;
-extern int use_glyphs;
-extern int glyph_scalar;
-extern int glyph_vector;
-extern int draw_options;
-
-extern float xPos;
-extern float yPos;
-extern float zPos;
-
-void init_simulation(int n);
-
-int rescale_to_winwidth(float value);
-
-void drag(int mx, int my);
-
-void click(int button, int state, int mx, int my);
-
-void keyboard(unsigned char key, int x, int y);
-
-int get_glyph_usage(void);
-
-//////////////////
-
-void init_simulation(int n);
-int rescale_to_winwidth(float value);
-void FFT(int direction,void* vx);
-int clamp(float x);
-void solve(int n, fftw_real* vx, fftw_real* vy, fftw_real* vx0, fftw_real* vy0, fftw_real visc, fftw_real dt);
-void diffuse_matter(int n, fftw_real *vx, fftw_real *vy, fftw_real *rho, fftw_real *rho0, fftw_real dt);
-void set_forces(void);
-void calculate_hight_plot(void);
-void copy_frame(void);
-void calculate_one_simulation_step(void);
-float remap(float value);
-void direction_to_color(float x, float y, int method);
-float get_dataset(int index);
-void set_autoscaling(void);
-void draw_isolines(float threshold);
-void visualize(void);
-void keyboard(unsigned char key, int x, int y);
-void click(int button, int state, int mx, int my);
-void mouse_rotate(int mx, int my);
-void drag(int mx, int my);
-
-//////////////////
-
-void zoom_in(void);
-void zoom_out(void);
-int get_glyph_usage(void);
-void selectColor(int arg);
-void select_dataset(int arg);
-void toggle_autoscale(void);
-void toggle_clamping(void);
-void show_options(void);
-void toggle_glyph_usage(void);
-void toggle_smoke_usage(void);
-void toggle_mouse_rotate(void);
-void toggle_seed_insert(void);
-void set_glyph_scalar(int arg);
-void set_glyph_vector(int arg);
-
-int get_var_dims(void);
-void set_var_dims(int);
-int get_glyph_sort(void);
-void set_glyph_sort(int sort);
-
-struct point {
- float x;
- float y;
- float z;
-};
-
+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 MOUSE_SMOKE 0 +#define MOUSE_SCALE_MIN 1 +#define MOUSE_SCALE_MAX 2 +#define MOUSE_CLAMP_MIN 3 +#define MOUSE_CLAMP_MAX 4 + +#define SCALAR_RHO 0 +#define SCALAR_VEL 1 +#define SCALAR_FORCE 2 + +#define VECTOR_VEL 0 +#define VECTOR_FORCE 1 + +#define GLYPH_ARROWS 0 +#define GLYPH_LINES 1 +#define GLYPH_CYLINDERS 2 +#define GLYPH_SPHERES 3 + +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 draw_smoke; //draw the smoke or not +extern int draw_vecs; //draw the vector field or not +extern int scalar_col; //method for scalar coloring +extern int frozen; //toggles on/off the animation +extern float clamp_min; +extern float clamp_max; +extern int autoscale; +extern float scale_min; +extern float scale_max; +extern int vis_dataset; +extern int mousebutton; +extern int mousebuttonstate; +extern int active_slider; +extern int use_glyphs; +extern int glyph_scalar; +extern int glyph_vector; +extern int draw_options; + +extern float xPos; +extern float yPos; +extern float zPos; + +void init_simulation(int n); + +void visualize(void); + +int rescale_to_winwidth(float value); + +void drag(int mx, int my); + +void click(int button, int state, int mx, int my); + +void keyboard(unsigned char key, int x, int y); + +void calculate_one_simulation_step(void); + +int get_glyph_usage(void); + +////////////////// + +void init_simulation(int n); +int rescale_to_winwidth(float value); +void FFT(int direction,void* vx); +int clamp(float x); +void solve(int n, fftw_real* vx, fftw_real* vy, fftw_real* vx0, fftw_real* vy0, fftw_real visc, fftw_real dt); +void diffuse_matter(int n, fftw_real *vx, fftw_real *vy, fftw_real *rho, fftw_real *rho0, fftw_real dt); +void set_forces(void); +void calculate_hight_plot(void); +void copy_frame(void); +void calculate_one_simulation_step(void);; +float remap(float value); +void direction_to_color(float x, float y, int method); +float get_dataset(int index); +void set_autoscaling(void); +void draw_isolines(float threshold); +void visualize(void); +void keyboard(unsigned char key, int x, int y); +void click(int button, int state, int mx, int my); +void mouse_rotate(int mx, int my); +void drag(int mx, int my); + +////////////////// + +void zoom_in(int zoom); +void zoom_out(int zoom); +int get_glyph_usage(void); +void selectColor(int arg); +void select_dataset(int arg); +void toggle_autoscale(void); +void toggle_clamping(void); +void show_options(void); +void toggle_glyph_usage(void); +void toggle_smoke_usage(void); +void toggle_mouse_rotate(void); +void toggle_seed_insert(void); +void set_glyph_scalar(int arg); +void set_glyph_vector(int arg); + +int get_var_dims(void); +void set_var_dims(int); +int get_glyph_sort(void); +void set_glyph_sort(int sort); + +struct point { + float x; + float y; + float z; +}; + #endif |