-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem.cpp
More file actions
38 lines (32 loc) · 849 Bytes
/
system.cpp
File metadata and controls
38 lines (32 loc) · 849 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
30
31
32
33
34
35
36
#include "sph.h"
#include "grid.h"
#include "object.h"
int main()
{
double hsml(2.5e-5);
double domain_width(1.0e-3);
double domain_height(0.5e-3);
int fp_count;
int bp_count;
int mbp_count;
double dt(1.0e-4);
double simulationtime(0.1);
int currentstep(0);
GridClass gridclass(hsml, domain_width, domain_height, fp_count, bp_count, mbp_count);
SphSolver sphsolver(hsml);
FloatingObject floatingbody(dt,currentstep);
for(int t=1; t<= (int) simulationtime/dt ; t++)
{
if(t==1)
gridclass.init_grid;
else{
gridclass.update_grid();
gridclass.check_limit();
gridclass.GlobalUpdate(); // so GridClass.GlobalUpdate actually only update fluid particles
gridclass.updateFP();
}
if( (t/10)==0)
gridclass.WriteResult();
//actually,all FP, BP are in GridCells, so the result should be through GridCells
}
}