diff --git a/src/runner.h b/src/runner.h index 2ee4b3e4c4d5c93a1180af245e18b4b68a2db188..53e78b00657385c7185e0730d421707c87ccf382 100644 --- a/src/runner.h +++ b/src/runner.h @@ -56,7 +56,10 @@ struct runner { void runner_do_ghost(struct runner *r, struct cell *c, int timer); void runner_do_extra_ghost(struct runner *r, struct cell *c, int timer); void runner_do_sort(struct runner *r, struct cell *c, int flag, int clock); -void runner_do_kick(struct runner *r, struct cell *c, int timer); +void runner_do_drift(struct runner *r, struct cell *c, int timer); +void runner_do_kick1(struct runner *r, struct cell *c, int timer); +void runner_do_kick2(struct runner *r, struct cell *c, int timer); +void runner_do_end_force(struct runner *r, struct cell *c, int timer); void runner_do_init(struct runner *r, struct cell *c, int timer); void runner_do_cooling(struct runner *r, struct cell *c, int timer); void runner_do_grav_external(struct runner *r, struct cell *c, int timer); diff --git a/tests/test125cells.c b/tests/test125cells.c index 3ae80d952f78e8f50235cf38af493501c1c97634..1c0e3e97b3c0a638c5c032f9ac18ac4f88d8d0eb 100644 --- a/tests/test125cells.c +++ b/tests/test125cells.c @@ -272,8 +272,7 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h, hydro_first_init_part(part, xpart); part->id = ++(*partId); - part->ti_begin = 0; - part->ti_end = 1; + part->time_bin = 1; #if defined(GIZMO_SPH) part->geometry.volume = part->conserved.mass / density; @@ -292,6 +291,11 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h, part->conserved.mass; #endif +#ifdef SWIFT_DEBUG_CHECKS + part->ti_drift = 1; + part->ti_kick = 1; +#endif + ++part; ++xpart; } @@ -364,10 +368,10 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, #else main_cell->parts[pid].density.div_v, #endif - hydro_get_entropy(&main_cell->parts[pid], 0.f), - hydro_get_internal_energy(&main_cell->parts[pid], 0.f), - hydro_get_pressure(&main_cell->parts[pid], 0.f), - hydro_get_soundspeed(&main_cell->parts[pid], 0.f), + hydro_get_entropy(&main_cell->parts[pid]), + hydro_get_internal_energy(&main_cell->parts[pid]), + hydro_get_pressure(&main_cell->parts[pid]), + hydro_get_soundspeed(&main_cell->parts[pid]), main_cell->parts[pid].a_hydro[0], main_cell->parts[pid].a_hydro[1], main_cell->parts[pid].a_hydro[2], main_cell->parts[pid].force.h_dt, #if defined(GADGET2_SPH) @@ -572,6 +576,12 @@ int main(int argc, char *argv[]) { const ticks tic = getticks(); + /* Start with a gentle kick */ + //runner_do_kick1(&runner, main_cell, 0); + + /* And a gentle drift */ + //runner_do_drift(&runner, main_cell, 0); + /* First, sort stuff */ for (int j = 0; j < 125; ++j) runner_do_sort(&runner, cells[j], 0x1FFF, 0); @@ -640,7 +650,8 @@ int main(int argc, char *argv[]) { #endif /* Finally, give a gentle kick */ - runner_do_kick(&runner, main_cell, 0); + runner_do_end_force(&runner, main_cell, 0); + //runner_do_kick2(&runner, main_cell, 0); const ticks toc = getticks(); time += toc - tic; @@ -663,6 +674,12 @@ int main(int argc, char *argv[]) { const ticks tic = getticks(); + /* Kick the central cell */ + //runner_do_kick1(&runner, main_cell, 0); + + /* And drift it */ + runner_do_drift(&runner, main_cell, 0); + /* Initialise the particles */ for (int j = 0; j < 125; ++j) runner_do_init(&runner, cells[j], 0); @@ -728,7 +745,8 @@ int main(int argc, char *argv[]) { #endif /* Finally, give a gentle kick */ - runner_do_kick(&runner, main_cell, 0); + runner_do_end_force(&runner, main_cell, 0); + //runner_do_kick2(&runner, main_cell, 0); const ticks toc = getticks(); diff --git a/tests/test27cells.c b/tests/test27cells.c index fe628e8a5a0d0040d89f112cf80042e30b002cd3..60d9ff835975fe7d34d33b3c971b94286f62def3 100644 --- a/tests/test27cells.c +++ b/tests/test27cells.c @@ -128,8 +128,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, part->entropy_one_over_gamma = 1.f; #endif - part->ti_begin = 0; - part->ti_end = 1; + part->time_bin = 0; ++part; } } @@ -147,9 +146,9 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, cell->loc[1] = offset[1]; cell->loc[2] = offset[2]; - cell->ti_old = 1; - cell->ti_end_min = 1; - cell->ti_end_max = 1; + cell->ti_old = 0; + cell->ti_end_min = 0; + cell->ti_end_max = 0; shuffle_particles(cell->parts, cell->count); @@ -390,7 +389,7 @@ int main(int argc, char *argv[]) { struct engine engine; engine.s = &space; engine.time = 0.1f; - engine.ti_current = 1; + engine.ti_current = 0; struct runner runner; runner.e = &engine; diff --git a/tests/testLogger.c b/tests/testLogger.c index 943e1d8b404b47c2dae566b1199e4c936f3c5817..ec3b33b6a9e38741e41b4678681e7afe9b9a7950 100644 --- a/tests/testLogger.c +++ b/tests/testLogger.c @@ -22,6 +22,7 @@ /* Some standard headers. */ #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> diff --git a/tests/testPair.c b/tests/testPair.c index ba1da815d92e100b0ebaaae1eb778bcbd3b82053..09d820c54dda1bcd1a92c9ead14f36a70816bd9a 100644 --- a/tests/testPair.c +++ b/tests/testPair.c @@ -68,8 +68,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, #else part->mass = density * volume / count; #endif - part->ti_begin = 0; - part->ti_end = 1; + part->time_bin = 1; ++part; } } diff --git a/tests/testSPHStep.c b/tests/testSPHStep.c index ff2ec841b27bd5ca6190517bc39f4da0c28fbc0c..0c7ae1d0d8855371b8f8f9fbf51c7c63b3221aaa 100644 --- a/tests/testSPHStep.c +++ b/tests/testSPHStep.c @@ -61,8 +61,7 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) { offset[2] * cellSize + z * cellSize / N + cellSize / (2 * N); part->h = h; part->id = x * N * N + y * N + z + id_offset; - part->ti_begin = 0; - part->ti_end = 1; + part->time_bin = 1; ++part; } } diff --git a/tests/testTimeIntegration.c b/tests/testTimeIntegration.c index f39adaee902ac3460b01857c002659b8bb2101f4..42a3d224f43d580e512119edc55051bd22719a3b 100644 --- a/tests/testTimeIntegration.c +++ b/tests/testTimeIntegration.c @@ -115,7 +115,7 @@ int main() { c.parts[0].a_hydro[1] = -(G * M_sun * c.parts[0].x[1] / r * r * r); /* Kick... */ - runner_do_kick(&run, &c, 0); + runner_do_kick2(&run, &c, 0); } /* Clean-up */