Commit 2e709b43 authored by lhausamm's avatar lhausamm
Browse files

Add chemistry in symmetry test

parent 4c4631a3
......@@ -47,6 +47,15 @@ int main(int argc, char *argv[]) {
*(((float *)&pj) + i) = (float)random_uniform(0., 2.);
}
/* Create a chemistry structure */
struct chemistry_data chemistry;
/* At one point, we will need to initialize the chemistry
chemistry_init(const struct swift_params* parameter_file,
const struct unit_system* us,
const struct phys_const* phys_const,
&chemistry);
*/
/* Make the particle smoothing length and position reasonable */
for (size_t i = 0; i < 3; ++i) pi.x[0] = random_uniform(-1., 1.);
for (size_t i = 0; i < 3; ++i) pj.x[0] = random_uniform(-1., 1.);
......@@ -137,13 +146,19 @@ int main(int argc, char *argv[]) {
/* Call the symmetric version */
runner_iact_density(r2, dx, pi.h, pj.h, &pi, &pj);
/* Now the chemistry. WARNING chemistry is not initialized */
runner_iact_chemistry(r2, dx, pi.h, pj.h, &pi, &pj, &chemistry);
/* Call the non-symmetric version */
runner_iact_nonsym_density(r2, dx, pi2.h, pj2.h, &pi2, &pj2);
/* Now the chemistry. WARNING chemistry is not initialized */
runner_iact_nonsym_chemistry(r2, dx, pi2.h, pj2.h, &pi2, &pj2, &chemistry);
dx[0] = -dx[0];
dx[1] = -dx[1];
dx[2] = -dx[2];
runner_iact_nonsym_density(r2, dx, pj2.h, pi2.h, &pj2, &pi2);
/* Now the chemistry. WARNING chemistry is not initialized */
runner_iact_nonsym_chemistry(r2, dx, pj2.h, pi2.h, &pj2, &pi2, &chemistry);
/* Check that the particles are the same */
i_ok = memcmp(&pi, &pi2, sizeof(struct part));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment