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

Store the number of times a particle was hit by SNII or AGN feedback, not only whether it was hit.

parent 34e3b79e
No related branches found
No related tags found
No related merge requests found
...@@ -145,7 +145,7 @@ static INLINE void tracers_first_init_xpart( ...@@ -145,7 +145,7 @@ static INLINE void tracers_first_init_xpart(
*/ */
static INLINE void tracers_after_feedback(struct xpart *xp) { static INLINE void tracers_after_feedback(struct xpart *xp) {
xp->tracers_data.hit_by_SNII_feedback = 1; xp->tracers_data.hit_by_SNII_feedback++;
} }
/** /**
...@@ -163,7 +163,7 @@ static INLINE void tracers_after_black_holes_feedback( ...@@ -163,7 +163,7 @@ static INLINE void tracers_after_black_holes_feedback(
struct xpart *xp, const int with_cosmology, const float scale_factor, struct xpart *xp, const int with_cosmology, const float scale_factor,
const double time, const double delta_energy) { const double time, const double delta_energy) {
xp->tracers_data.hit_by_AGN_feedback = 1; xp->tracers_data.hit_by_AGN_feedback++;
xp->tracers_data.AGN_feedback_energy += delta_energy; xp->tracers_data.AGN_feedback_energy += delta_energy;
} }
......
...@@ -77,13 +77,15 @@ __attribute__((always_inline)) INLINE static int tracers_write_particles( ...@@ -77,13 +77,15 @@ __attribute__((always_inline)) INLINE static int tracers_write_particles(
io_make_output_field("HeatedBySNIIFeedback", CHAR, 1, UNIT_CONV_NO_UNITS, io_make_output_field("HeatedBySNIIFeedback", CHAR, 1, UNIT_CONV_NO_UNITS,
0.f, xparts, tracers_data.hit_by_SNII_feedback, 0.f, xparts, tracers_data.hit_by_SNII_feedback,
"Flags the particles that have been directly hit by " "Flags the particles that have been directly hit by "
"a SNII feedback event at some point in the past."); "a SNII feedback event at some point in the past. "
"If > 0, contains the number of individual events.");
list[3] = list[3] =
io_make_output_field("HeatedByAGNFeedback", CHAR, 1, UNIT_CONV_NO_UNITS, io_make_output_field("HeatedByAGNFeedback", CHAR, 1, UNIT_CONV_NO_UNITS,
0.f, xparts, tracers_data.hit_by_AGN_feedback, 0.f, xparts, tracers_data.hit_by_AGN_feedback,
"Flags the particles that have been directly hit by " "Flags the particles that have been directly hit by "
"an AGN feedback event at some point in the past."); "an AGN feedback event at some point in the past. "
"If > 0, contains the number of individual events.");
list[4] = io_make_output_field("EnergiesReceivedFromAGNFeedback", FLOAT, 1, list[4] = io_make_output_field("EnergiesReceivedFromAGNFeedback", FLOAT, 1,
UNIT_CONV_ENERGY, 0.f, xparts, UNIT_CONV_ENERGY, 0.f, xparts,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment