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
No related branches found
No related tags found
1 merge request!301New time line
......@@ -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);
......
......@@ -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();
......
......@@ -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;
......
......@@ -22,6 +22,7 @@
/* Some standard headers. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
......
......@@ -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;
}
}
......
......@@ -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;
}
}
......
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment