forked from rlguy/GridFluidSim3D
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (21 loc) · 635 Bytes
/
main.cpp
File metadata and controls
29 lines (21 loc) · 635 Bytes
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
#include "main.h"
int main() {
// This example will drop a ball of fluid in the center
// of the fluid simulation domain.
int isize = 64;
int jsize = 64;
int ksize = 64;
double dx = 0.125;
FluidSimulation fluidsim(isize, jsize, ksize, dx);
fluidsim.setSurfaceSubdivisionLevel(2);
double x, y, z;
fluidsim.getSimulationDimensions(&x, &y, &z);
fluidsim.addImplicitFluidPoint(x/2, y/2, z/2, 7.0);
fluidsim.addBodyForce(0.0, -25.0, 0.0);
fluidsim.initialize();
double timestep = 1.0 / 30.0;
for (;;) {
fluidsim.update(timestep);
}
return 0;
}