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

Update the brute-force debugging star interaction loops used in the unit tests...

Update the brute-force debugging star interaction loops used in the unit tests to also check for feedback activity.
parent 9424d5e5
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,10 @@ __attribute__((always_inline)) INLINE static int feedback_do_feedback( ...@@ -48,6 +48,10 @@ __attribute__((always_inline)) INLINE static int feedback_do_feedback(
/** /**
* @brief Should this particle be doing any feedback-related operation? * @brief Should this particle be doing any feedback-related operation?
* *
* Note: Since this 'none' feedback mode is used for testing the neighbour
* loops only, we want to always do feedback irrespective of the particle
* or of the system's state.
*
* @param sp The #spart. * @param sp The #spart.
* @param time The current simulation time (Non-cosmological runs). * @param time The current simulation time (Non-cosmological runs).
* @param cosmo The cosmological model (cosmological runs). * @param cosmo The cosmological model (cosmological runs).
...@@ -57,7 +61,7 @@ __attribute__((always_inline)) INLINE static int feedback_is_active( ...@@ -57,7 +61,7 @@ __attribute__((always_inline)) INLINE static int feedback_is_active(
const struct spart* sp, const float time, const struct cosmology* cosmo, const struct spart* sp, const float time, const struct cosmology* cosmo,
const int with_cosmology) { const int with_cosmology) {
return 0; return 1;
} }
/** /**
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "chemistry.h" #include "chemistry.h"
#include "cosmology.h" #include "cosmology.h"
#include "error.h" #include "error.h"
#include "feedback.h"
#include "gravity.h" #include "gravity.h"
#include "hydro.h" #include "hydro.h"
#include "part.h" #include "part.h"
...@@ -424,6 +425,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci, ...@@ -424,6 +425,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci,
float r2, dx[3]; float r2, dx[3];
const double dim[3] = {r->e->s->dim[0], r->e->s->dim[1], r->e->s->dim[2]}; const double dim[3] = {r->e->s->dim[0], r->e->s->dim[1], r->e->s->dim[2]};
const struct engine *e = r->e; const struct engine *e = r->e;
const int with_cosmology = e->policy & engine_policy_cosmology;
const struct cosmology *cosmo = e->cosmology; const struct cosmology *cosmo = e->cosmology;
const float a = cosmo->a; const float a = cosmo->a;
const float H = cosmo->H; const float H = cosmo->H;
...@@ -437,6 +439,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci, ...@@ -437,6 +439,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci,
/* Skip inactive particles. */ /* Skip inactive particles. */
if (!spart_is_active(spi, e)) continue; if (!spart_is_active(spi, e)) continue;
if (!feedback_is_active(spi, e->time, cosmo, with_cosmology)) continue;
for (int j = 0; j < cj->hydro.count; ++j) { for (int j = 0; j < cj->hydro.count; ++j) {
...@@ -470,6 +473,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci, ...@@ -470,6 +473,7 @@ void pairs_all_stars_density(struct runner *r, struct cell *ci,
/* Skip inactive particles. */ /* Skip inactive particles. */
if (!spart_is_active(spj, e)) continue; if (!spart_is_active(spj, e)) continue;
if (!feedback_is_active(spj, e->time, cosmo, with_cosmology)) continue;
for (int i = 0; i < ci->hydro.count; ++i) { for (int i = 0; i < ci->hydro.count; ++i) {
...@@ -649,6 +653,7 @@ void self_all_stars_density(struct runner *r, struct cell *ci) { ...@@ -649,6 +653,7 @@ void self_all_stars_density(struct runner *r, struct cell *ci) {
struct spart *spi; struct spart *spi;
struct part *pj; struct part *pj;
const struct engine *e = r->e; const struct engine *e = r->e;
const int with_cosmology = e->policy & engine_policy_cosmology;
const struct cosmology *cosmo = e->cosmology; const struct cosmology *cosmo = e->cosmology;
const float a = cosmo->a; const float a = cosmo->a;
const float H = cosmo->H; const float H = cosmo->H;
...@@ -661,6 +666,7 @@ void self_all_stars_density(struct runner *r, struct cell *ci) { ...@@ -661,6 +666,7 @@ void self_all_stars_density(struct runner *r, struct cell *ci) {
hig2 = hi * hi * kernel_gamma2; hig2 = hi * hi * kernel_gamma2;
if (!spart_is_active(spi, e)) continue; if (!spart_is_active(spi, e)) continue;
if (!feedback_is_active(spi, e->time, cosmo, with_cosmology)) continue;
for (int j = 0; j < ci->hydro.count; ++j) { for (int j = 0; j < ci->hydro.count; ++j) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment