Commit 4f6ed809 authored by Matthieu Schaller's avatar Matthieu Schaller

Added the timebin interaction check to the testSymmetry unit test

parent 87d83f8f
......@@ -32,8 +32,9 @@
* @param H Current Hubble parameter.
*/
__attribute__((always_inline)) INLINE static void runner_iact_timebin(
float r2, const float *dx, float hi, float hj, struct part *restrict pi,
struct part *restrict pj, float a, float H) {
const float r2, const float *dx, const float hi, const float hj,
struct part *restrict pi, struct part *restrict pj, const float a,
const float H) {
/* Update the minimal time-bin */
if (pj->time_bin > 0)
......@@ -58,8 +59,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_timebin(
* @param H Current Hubble parameter.
*/
__attribute__((always_inline)) INLINE static void runner_iact_nonsym_timebin(
float r2, const float *dx, float hi, float hj, struct part *restrict pi,
const struct part *restrict pj, float a, float H) {
const float r2, const float *dx, const float hi, const float hj,
struct part *restrict pi, const struct part *restrict pj, const float a,
const float H) {
/* Update the minimal time-bin */
if (pj->time_bin > 0)
......@@ -71,8 +73,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_timebin(
* @brief Timestep limiter loop
*/
__attribute__((always_inline)) INLINE static void runner_iact_limiter(
float r2, const float *dx, float hi, float hj, struct part *restrict pi,
struct part *restrict pj, float a, float H) {
const float r2, const float *dx, const float hi, const float hj,
struct part *restrict pi, struct part *restrict pj, const float a,
const float H) {
/* Nothing to do here if both particles are active */
}
......@@ -81,8 +84,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_limiter(
* @brief Timestep limiter loop (non-symmetric version)
*/
__attribute__((always_inline)) INLINE static void runner_iact_nonsym_limiter(
float r2, const float *dx, float hi, float hj, struct part *restrict pi,
struct part *restrict pj, float a, float H) {
const float r2, const float *dx, const float hi, const float hj,
const struct part *restrict pi, struct part *restrict pj, const float a,
const float H) {
/* Wake up the neighbour? */
if (pj->time_bin > pi->time_bin + time_bin_neighbour_max_delta_bin) {
......
......@@ -24,6 +24,7 @@
#include <string.h>
#include "swift.h"
#include "timestep_limiter_iact.h"
void print_bytes(void *p, size_t len) {
printf("(");
......@@ -219,13 +220,16 @@ void test(void) {
/* Call the symmetric version */
runner_iact_force(r2, dx, pi.h, pj.h, &pi, &pj, a, H);
runner_iact_timebin(r2, dx, pi.h, pj.h, &pi, &pj, a, H);
/* Call the non-symmetric version */
runner_iact_nonsym_force(r2, dx, pi2.h, pj2.h, &pi2, &pj2, a, H);
runner_iact_nonsym_timebin(r2, dx, pi2.h, pj2.h, &pi2, &pj2, a, H);
dx[0] = -dx[0];
dx[1] = -dx[1];
dx[2] = -dx[2];
runner_iact_nonsym_force(r2, dx, pj2.h, pi2.h, &pj2, &pi2, a, H);
runner_iact_nonsym_timebin(r2, dx, pj2.h, pi2.h, &pj2, &pi2, a, H);
/* Check that the particles are the same */
#if defined(GIZMO_MFV_SPH)
......
Markdown is supported
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