Commit 4b880087 authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Fuse function into star_formation_logger_init()

parent b3106834
......@@ -2697,7 +2697,7 @@ void engine_collect_end_of_step_recurse_hydro(struct cell *c,
struct star_formation_history sfh_updated;
/* Initialize the star formation structs */
star_formation_logger_init_engine(&sfh_updated);
star_formation_logger_init(&sfh_updated);
/* Collect the values from the progeny. */
for (int k = 0; k < 8; k++) {
......@@ -2961,7 +2961,7 @@ void engine_collect_end_of_step_mapper(void *map_data, int num_elements,
struct star_formation_history sfh_updated;
/* Initialize the star formation structs for this engine to zero */
star_formation_logger_init_engine(&sfh_updated);
star_formation_logger_init(&sfh_updated);
for (int ind = 0; ind < num_elements; ind++) {
struct cell *c = &s->cells_top[local_cells[ind]];
......@@ -3116,7 +3116,7 @@ void engine_collect_end_of_step(struct engine *e, int apply) {
data.e = e;
/* Initialize the total SFH of the simulation to zero */
star_formation_logger_init_engine(&data.sfh);
star_formation_logger_init(&data.sfh);
/* Collect information from the local top-level cells */
threadpool_map(&e->threadpool, engine_collect_end_of_step_mapper,
......
......@@ -625,7 +625,7 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
star_formation_logger_log_inactive_cell(&c->stars.sfh);
return;
}
star_formation_logger_log_active_cell(&c->stars.sfh);
star_formation_logger_init(&c->stars.sfh);
/* Recurse? */
if (c->split) {
......
......@@ -274,7 +274,7 @@ void space_rebuild_recycle_mapper(void *map_data, int num_elements,
c->stars.ti_end_max = -1;
c->black_holes.ti_end_min = -1;
c->black_holes.ti_end_max = -1;
star_formation_logger_init_engine(&c->stars.sfh);
star_formation_logger_init(&c->stars.sfh);
#if defined(SWIFT_DEBUG_CHECKS) || defined(SWIFT_CELL_GRAPH)
c->cellID = 0;
#endif
......
......@@ -43,27 +43,6 @@ INLINE static void star_formation_logger_log_new_spart(
sf->new_stellar_mass += sp->mass;
}
/**
* @brief Initialize the star formation history struct if the cell is active
*
* @param sf the star_formation_history struct we want to initialize
*/
INLINE static void star_formation_logger_log_active_cell(
struct star_formation_history *sf) {
/* Initialize the stellar mass to zero*/
sf->new_stellar_mass = 0.f;
/* Initialize the active SFR */
sf->SFR_active = 0.f;
/* Initialize the SFR*dt active */
sf->SFRdt_active = 0.f;
/* Initialize the inactive SFR */
sf->SFR_inactive = 0.f;
}
/**
* @brief Initialize the star formation history struct in the case the cell is
* inactive
......@@ -113,7 +92,7 @@ INLINE static void star_formation_logger_add_first_to_second(
*
* @param sfh The pointer to the star formation history structure
*/
INLINE static void star_formation_logger_init_engine(
INLINE static void star_formation_logger_init(
struct star_formation_history *sfh) {
/* Initialize the collecting SFH structure to zero */
......
......@@ -46,14 +46,6 @@ INLINE static void star_formation_logger_log_new_spart(
INLINE static void star_formation_init_stellar_mass(
struct star_formation_history *sf) {}
/**
* @brief Initialize the star formation history struct if the cell is active
*
* @param sf the star_formation_history struct we want to initialize
*/
INLINE static void star_formation_logger_log_active_cell(
struct star_formation_history *sf) {}
/**
* @brief Initialize the star formation history struct in the case the cell is
* inactive
......@@ -80,7 +72,7 @@ INLINE static void star_formation_logger_add_first_to_second(
*
* @param sfh The pointer to the star formation history structure
*/
INLINE static void star_formation_logger_init_engine(
INLINE static void star_formation_logger_init(
struct star_formation_history *sfh) {}
/**
......
......@@ -46,14 +46,6 @@ INLINE static void star_formation_logger_log_new_spart(
INLINE static void star_formation_init_stellar_mass(
struct star_formation_history *sf) {}
/**
* @brief Initialize the star formation history struct if the cell is active
*
* @param sf the star_formation_history struct we want to initialize
*/
INLINE static void star_formation_logger_log_active_cell(
struct star_formation_history *sf) {}
/**
* @brief Initialize the star formation history struct in the case the cell is
* inactive
......@@ -80,7 +72,7 @@ INLINE static void star_formation_logger_add_first_to_second(
*
* @param sfh The pointer to the star formation history structure
*/
INLINE static void star_formation_logger_init_engine(
INLINE static void star_formation_logger_init(
struct star_formation_history *sfh) {}
/**
......
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