Skip to content
Snippets Groups Projects
Commit 20f932f3 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fixed all the tests but three.

parent 39804a1b
Branches
Tags
1 merge request!301New time line
...@@ -56,7 +56,10 @@ struct runner { ...@@ -56,7 +56,10 @@ struct runner {
void runner_do_ghost(struct runner *r, struct cell *c, int timer); 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_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_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_init(struct runner *r, struct cell *c, int timer);
void runner_do_cooling(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); void runner_do_grav_external(struct runner *r, struct cell *c, int timer);
......
...@@ -272,8 +272,7 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h, ...@@ -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); hydro_first_init_part(part, xpart);
part->id = ++(*partId); part->id = ++(*partId);
part->ti_begin = 0; part->time_bin = 1;
part->ti_end = 1;
#if defined(GIZMO_SPH) #if defined(GIZMO_SPH)
part->geometry.volume = part->conserved.mass / density; 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, ...@@ -292,6 +291,11 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
part->conserved.mass; part->conserved.mass;
#endif #endif
#ifdef SWIFT_DEBUG_CHECKS
part->ti_drift = 1;
part->ti_kick = 1;
#endif
++part; ++part;
++xpart; ++xpart;
} }
...@@ -364,10 +368,10 @@ void dump_particle_fields(char *fileName, struct cell *main_cell, ...@@ -364,10 +368,10 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
#else #else
main_cell->parts[pid].density.div_v, main_cell->parts[pid].density.div_v,
#endif #endif
hydro_get_entropy(&main_cell->parts[pid], 0.f), hydro_get_entropy(&main_cell->parts[pid]),
hydro_get_internal_energy(&main_cell->parts[pid], 0.f), hydro_get_internal_energy(&main_cell->parts[pid]),
hydro_get_pressure(&main_cell->parts[pid], 0.f), hydro_get_pressure(&main_cell->parts[pid]),
hydro_get_soundspeed(&main_cell->parts[pid], 0.f), 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[0], main_cell->parts[pid].a_hydro[1],
main_cell->parts[pid].a_hydro[2], main_cell->parts[pid].force.h_dt, main_cell->parts[pid].a_hydro[2], main_cell->parts[pid].force.h_dt,
#if defined(GADGET2_SPH) #if defined(GADGET2_SPH)
...@@ -572,6 +576,12 @@ int main(int argc, char *argv[]) { ...@@ -572,6 +576,12 @@ int main(int argc, char *argv[]) {
const ticks tic = getticks(); 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 */ /* First, sort stuff */
for (int j = 0; j < 125; ++j) runner_do_sort(&runner, cells[j], 0x1FFF, 0); 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[]) { ...@@ -640,7 +650,8 @@ int main(int argc, char *argv[]) {
#endif #endif
/* Finally, give a gentle kick */ /* 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(); const ticks toc = getticks();
time += toc - tic; time += toc - tic;
...@@ -663,6 +674,12 @@ int main(int argc, char *argv[]) { ...@@ -663,6 +674,12 @@ int main(int argc, char *argv[]) {
const ticks tic = getticks(); 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 */ /* Initialise the particles */
for (int j = 0; j < 125; ++j) runner_do_init(&runner, cells[j], 0); for (int j = 0; j < 125; ++j) runner_do_init(&runner, cells[j], 0);
...@@ -728,7 +745,8 @@ int main(int argc, char *argv[]) { ...@@ -728,7 +745,8 @@ int main(int argc, char *argv[]) {
#endif #endif
/* Finally, give a gentle kick */ /* 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(); const ticks toc = getticks();
......
...@@ -128,8 +128,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, ...@@ -128,8 +128,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
part->entropy_one_over_gamma = 1.f; part->entropy_one_over_gamma = 1.f;
#endif #endif
part->ti_begin = 0; part->time_bin = 0;
part->ti_end = 1;
++part; ++part;
} }
} }
...@@ -147,9 +146,9 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, ...@@ -147,9 +146,9 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
cell->loc[1] = offset[1]; cell->loc[1] = offset[1];
cell->loc[2] = offset[2]; cell->loc[2] = offset[2];
cell->ti_old = 1; cell->ti_old = 0;
cell->ti_end_min = 1; cell->ti_end_min = 0;
cell->ti_end_max = 1; cell->ti_end_max = 0;
shuffle_particles(cell->parts, cell->count); shuffle_particles(cell->parts, cell->count);
...@@ -390,7 +389,7 @@ int main(int argc, char *argv[]) { ...@@ -390,7 +389,7 @@ int main(int argc, char *argv[]) {
struct engine engine; struct engine engine;
engine.s = &space; engine.s = &space;
engine.time = 0.1f; engine.time = 0.1f;
engine.ti_current = 1; engine.ti_current = 0;
struct runner runner; struct runner runner;
runner.e = &engine; runner.e = &engine;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
/* Some standard headers. */ /* Some standard headers. */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -68,8 +68,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h, ...@@ -68,8 +68,7 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
#else #else
part->mass = density * volume / count; part->mass = density * volume / count;
#endif #endif
part->ti_begin = 0; part->time_bin = 1;
part->ti_end = 1;
++part; ++part;
} }
} }
......
...@@ -61,8 +61,7 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) { ...@@ -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); offset[2] * cellSize + z * cellSize / N + cellSize / (2 * N);
part->h = h; part->h = h;
part->id = x * N * N + y * N + z + id_offset; part->id = x * N * N + y * N + z + id_offset;
part->ti_begin = 0; part->time_bin = 1;
part->ti_end = 1;
++part; ++part;
} }
} }
......
...@@ -115,7 +115,7 @@ int main() { ...@@ -115,7 +115,7 @@ int main() {
c.parts[0].a_hydro[1] = -(G * M_sun * c.parts[0].x[1] / r * r * r); c.parts[0].a_hydro[1] = -(G * M_sun * c.parts[0].x[1] / r * r * r);
/* Kick... */ /* Kick... */
runner_do_kick(&run, &c, 0); runner_do_kick2(&run, &c, 0);
} }
/* Clean-up */ /* Clean-up */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment