|
2 | 2 | $(SIGNATURES) |
3 | 3 | Perform a check procedure. Simulation status will be output every `ST_CHECK_INTERVAL` steps. |
4 | 4 | """ |
5 | | -function check!(i,ps4est,amr) |
6 | | - if amr.global_data.status.residual.step%amr.global_data.config.solver.ST_CHECK_INTERVAL==0 |
7 | | - max_vs_num,total_phase_num = check_vs_num(amr) |
8 | | - if MPI.Comm_rank(MPI.COMM_WORLD) == 0 |
9 | | - i+=1 |
10 | | - println("Iteration: $i") |
11 | | - sim_time = amr.global_data.status.sim_time |
12 | | - println("Simulation time: $sim_time") |
13 | | - res = maximum(amr.global_data.status.residual.residual) |
14 | | - println("Residual: $res") |
15 | | - ref_vs_num = amr.global_data.status.max_vs_num |
16 | | - println("MPI buffer size: $ref_vs_num") |
17 | | - println("Maximum number of velocity grids: $max_vs_num") |
18 | | - pp = PointerWrapper(ps4est) |
19 | | - global_num_quadrants = pp.global_num_quadrants[] |
20 | | - println("Total number of physical grids: $global_num_quadrants") |
21 | | - println("Total number of phase grids: $total_phase_num") |
22 | | - end |
| 5 | +function check!(ps4est,amr) |
| 6 | + if amr.global_data.status.step%amr.global_data.config.solver.ST_CHECK_INTERVAL==0 |
| 7 | + execute_check(ps4est,amr) |
23 | 8 | check_for_save!(ps4est,amr) |
24 | 9 | end |
25 | 10 | end |
| 11 | +function execute_check(ps4est,amr) |
| 12 | + max_vs_num,total_phase_num = check_vs_num(amr) |
| 13 | + if MPI.Comm_rank(MPI.COMM_WORLD) == 0 |
| 14 | + println("Iteration: $(amr.global_data.status.step)") |
| 15 | + sim_time = amr.global_data.status.sim_time |
| 16 | + println("Simulation time: $sim_time") |
| 17 | + res = maximum(amr.global_data.status.residual.residual) |
| 18 | + println("Residual: $res") |
| 19 | + ref_vs_num = amr.global_data.status.max_vs_num |
| 20 | + println("MPI buffer size: $ref_vs_num") |
| 21 | + println("Maximum number of velocity grids: $max_vs_num") |
| 22 | + pp = PointerWrapper(ps4est) |
| 23 | + global_num_quadrants = pp.global_num_quadrants[] |
| 24 | + println("Total number of physical grids: $global_num_quadrants") |
| 25 | + println("Total number of phase grids: $total_phase_num") |
| 26 | + end |
| 27 | +end |
26 | 28 | """ |
27 | 29 | $(SIGNATURES) |
28 | 30 | Start listening for the input from command line. Must be called before calling [`check_for_save!`](@ref). |
@@ -175,7 +177,6 @@ function check_vs_num(amr::KitAMR_Data) |
175 | 177 | for tree in trees |
176 | 178 | for ps_data in tree |
177 | 179 | isa(ps_data,InsideSolidData)&&continue |
178 | | - ps_data.bound_enc<0&&continue |
179 | 180 | vs_num = ps_data.vs_data.vs_num |
180 | 181 | buffer[1] = max(buffer[1],vs_num) |
181 | 182 | buffer[2] += vs_num |
|
0 commit comments