-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.h
58 lines (47 loc) · 1.45 KB
/
params.h
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
#ifndef PARAMS_H
#define PARAMS_H
#include <cassert>
// relevant systemwide parameters should go here
/* GUI parameters */
#define WINDOW_HEIGHT 600
#define WINDOW_WIDTH 600
#define WINDOW_Y 100
#define WINDOW_X 400
#define DISPLAY_KEY 0
#define ADD_AMT_INIT 0.5f
#define FORCE_SCALE 5.0f
#define ALPHA_OPTION 0.4f
#define COLOR_SCALE 20
#define RAINBOW_HOLD_NSTEPS 20
/* Colors */
#define RED {1.0f, 0.0f, 0.0f}
#define GREEN {0.0f, 1.0f, 0.0f}
#define BLUE {0.0f, 0.0f, 1.0f}
#define YELLOW {0.5f, 0.5f, 0.0f}
#define CYAN {0.0f, 0.5f, 0.5f}
#define MAGENTA {0.5f, 0.0f, 0.5f}
#define WHITE {0.33f, 0.33f, 0.33f}
#define ALL_COLORS {RED, GREEN, BLUE, YELLOW, CYAN, MAGENTA, WHITE}
/* Grid parameters */
#define NDIM 3
#define CELLS_Z 200
#define CELLS_Y 200
#define CELLS_X 200
#define NUM_FLUIDS 5
/* Fluid parameters */
#define DISSIPATION 0.01F
#define VISCOSITY 1e-9F
#define BUOYANCY 2e-4F
#define AMBIENT_DENSITY 0.1F
/* Simulation parameters */
#define NUM_ITER 5
#define DT 0.01F
#define CLEANUP false
/* Computed */
#define num_cells (CELLS_Z * CELLS_Y * CELLS_X)
/* Functions */
// inline int idx3d(const int z, const int y, const int x) {
// return z * CELLS_Y * CELLS_X + y * CELLS_X + x;
// }
#define idx3d(z, y, x) ((z) * CELLS_Y * CELLS_X + (y) * CELLS_X + (x))
#endif