blob: b8383d3c3a7888f1f7c84f97c5f1810a396a4cad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#ifndef _FLUIDS_H
#define _FLUIDS_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
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 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
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;
fftw_real *init_simulation(int n);
int rescale_to_winwidth(float value);
void calculate_one_simulation_step(fftw_real *field);
float get_dataset(int index);
void set_autoscaling(void);
//////////////////
void select_dataset(int arg);
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 isolines_nr;
extern float threshold1;
extern float threshold2;
extern int active_slider;
void fluids_set_calculate(int calculate);
int fluids_get_calculate(void);
#endif
|