summaryrefslogtreecommitdiffstats
path: root/Smoke/fluids.h
diff options
context:
space:
mode:
authorWilrik de Loose <wilrik@wilrik.nl>2007-12-14 12:24:12 (GMT)
committerWilrik de Loose <wilrik@wilrik.nl>2007-12-14 12:24:12 (GMT)
commitdbc6530ef4b5a5ce4284b0cb32e2f61677b47b18 (patch)
treea5f54b566e9c4b7fe34edb7ef0a271fa56bb8d2b /Smoke/fluids.h
parent9aaa000d79789033ea531c7d2c140fee1283305c (diff)
download2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.zip
2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.gz
2iv35-dbc6530ef4b5a5ce4284b0cb32e2f61677b47b18.tar.bz2
Diffstat (limited to 'Smoke/fluids.h')
-rw-r--r--Smoke/fluids.h291
1 files changed, 141 insertions, 150 deletions
diff --git a/Smoke/fluids.h b/Smoke/fluids.h
index 19f775b..452f1c5 100644
--- a/Smoke/fluids.h
+++ b/Smoke/fluids.h
@@ -5,154 +5,145 @@
#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
-
-//--- 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 int olivers_color;
-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);
-void rainbow(float value,float* R,float* G,float* B);
-void colormap_fire(float value,float* R,float* G,float* B);
-float remap(float value);
-struct color4f set_colormap(float vy, int draw_bar, float alpha);
-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 selectOliverscolor(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;
-};
-
-struct color4f {
- float r;
- float g;
- float b;
- float a;
-};
-
+//--- 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 *hight_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);
+
+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(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;
+};
+
#endif