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

Don't forget to re-initialize the particles before running the brute-force equivalent in test_125.

parent cbd37e3d
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,18 @@ void get_solution(const struct cell *main_cell, struct solution_part *solution,
}
}
void reset_particles(struct cell *c, enum velocity_field vel,
enum pressure_field press, float size, float density) {
for (size_t i = 0; i < c->count; ++i) {
struct part *p = &c->parts[i];
set_velocity(p, vel, size);
set_energy_state(p, press, size, density);
}
}
/**
* @brief Constructs a cell and all of its particle in a valid state prior to
* a SPH time-step.
......@@ -596,6 +608,9 @@ int main(int argc, char *argv[]) {
/* Output timing */
message("SWIFT calculation took : %15lli ticks.", time / runs);
for (int j = 0; j < 125; ++j)
reset_particles(cells[j], vel, press, size, rho);
/* NOW BRUTE-FORCE CALCULATION */
const ticks tic = getticks();
......
#!/bin/bash
rm brute_force_standard.dat swift_dopair_standard.dat
echo ""
rm -f brute_force_standard.dat swift_dopair_standard.dat
./testPair -p 6 -r 1 -d 0 -f standard
python @srcdir@/difffloat.py brute_force_standard.dat swift_dopair_standard.dat @srcdir@/tolerance_pair.dat
python @srcdir@/difffloat.py brute_force_standard.dat swift_dopair_standard.dat @srcdir@/tolerance_pair_normal.dat
exit $?
#!/bin/bash
rm brute_force_perturbed.dat swift_dopair_perturbed.dat
echo ""
rm -f brute_force_perturbed.dat swift_dopair_perturbed.dat
./testPair -p 6 -r 1 -d 0.1 -f perturbed
python @srcdir@/difffloat.py brute_force_perturbed.dat swift_dopair_perturbed.dat @srcdir@/tolerance_pair.dat
python @srcdir@/difffloat.py brute_force_perturbed.dat swift_dopair_perturbed.dat @srcdir@/tolerance_pair_perturbed.dat
exit $?
#!/bin/bash
rm parser_output.yml
rm -f parser_output.yml
./testParser @srcdir@/testParserInput.yaml
# ID pos_x pos_y pos_z v_x v_y v_z rho rho_dh wcount wcount_dh div_v curl_vx curl_vy curl_vz
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1.2e-6 2e-6 2e-5 2e-3 2e-6 2e-6 2e-6 2e-6
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-5 1e-4 2e-5 1.5e-4 1.5e-4 1.5e-4
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1.2e-6 2e-6 2.1e-5 2e-3 2.1e-6 2e-6 2e-6 2e-6
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-5 1e-4 2e-5 4e-4 4e-4 4e-4
File moved
# ID pos_x pos_y pos_z v_x v_y v_z rho rho_dh wcount wcount_dh div_v curl_vx curl_vy curl_vz
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-5 1e-5 2e-5 3e-2 1e-5 1e-5 1e-5 1e-5
0 1e-6 1e-6 1e-6 1e-6 1e-6 1e-6 1e-3 4e-4 8e-3 2e-2 1e-4 1.6e-4 1.6e-4 1.6e-4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment