diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index b90ba8f6e3e0b912c711179afb73e54be5a6d7fc..8e5fa52b236d91cabf51ce0c4f481a7334fd315d 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -763,7 +763,6 @@ INPUT = @top_srcdir@ @top_srcdir@/src @top_srcdir@/tests @top_ INPUT += @top_srcdir@/src/hydro/Minimal INPUT += @top_srcdir@/src/hydro/Gadget2 INPUT += @top_srcdir@/src/gravity/Default -INPUT += @top_srcdir@/src/stars/Default INPUT += @top_srcdir@/src/riemann INPUT += @top_srcdir@/src/potential/point_mass INPUT += @top_srcdir@/src/equation_of_state/ideal_gas @@ -776,6 +775,7 @@ INPUT += @top_srcdir@/src/entropy_floor/EAGLE INPUT += @top_srcdir@/src/star_formation/EAGLE INPUT += @top_srcdir@/src/tracers/EAGLE INPUT += @top_srcdir@/src/stars/EAGLE +INPUT += @top_srcdir@/src/feedback/EAGLE INPUT += @top_srcdir@/src/black_holes/Default # This tag can be used to specify the character encoding of the source files diff --git a/src/chemistry/EAGLE/chemistry.h b/src/chemistry/EAGLE/chemistry.h index a737a5ed2169f532b0c3471cfd8091533aed6d1e..8c0061eef618fa7c01c48ae0ace763a20d85e762 100644 --- a/src/chemistry/EAGLE/chemistry.h +++ b/src/chemistry/EAGLE/chemistry.h @@ -180,12 +180,8 @@ __attribute__((always_inline)) INLINE static void chemistry_first_init_part( * @brief Sets the chemistry properties of the sparticles to a valid start * state. * - * @param phys_const The physical constants in internal units. - * @param us The internal system of units. - * @param cosmo The current cosmological model. * @param data The global chemistry information. * @param sp Pointer to the sparticle data. - * @param xp Pointer to the extended particle data. */ __attribute__((always_inline)) INLINE static void chemistry_first_init_spart( const struct chemistry_global_data* data, struct spart* restrict sp) { diff --git a/src/engine.c b/src/engine.c index 54712d85d155beeee0e16141be8562a724dd3d07..b7878eae3d165e5ad88dc92f7f1a50a3a97cb01a 100644 --- a/src/engine.c +++ b/src/engine.c @@ -4802,6 +4802,7 @@ void engine_unpin(void) { * @param entropy_floor The #entropy_floor_properties for this run. * @param gravity The #gravity_props used for this run. * @param stars The #stars_props used for this run. + * @param feedback The #feedback_props used for this run. * @param mesh The #pm_mesh used for the long-range periodic forces. * @param potential The properties of the external potential. * @param cooling_func The properties of the cooling function. diff --git a/src/feedback/EAGLE/feedback.c b/src/feedback/EAGLE/feedback.c index e4d9c8ed4de1d052756a4a5b90d549673375816c..10500f5c12222178a070f5b4af4aa3e0c354982a 100644 --- a/src/feedback/EAGLE/feedback.c +++ b/src/feedback/EAGLE/feedback.c @@ -285,8 +285,8 @@ inline static void determine_bin_yield_SNII( * * @param log10_min_mass log10 mass at the end of step * @param log10_max_mass log10 mass at the beginning of step - * @param stars star properties data structure - * @param sp spart we are computing feedback from + * @param props properties of the feedback model + * @param sp #spart we are computing feedback from * @param star_age_Gyr age of star in Gyr * @param dt_Gyr timestep dt in Gyr */ @@ -356,25 +356,25 @@ inline static void evolve_SNIa(const float log10_min_mass, * @param log10_max_mass log10 mass at the beginning of step * @param stellar_yields array to store calculated yields for passing to * integrate_imf - * @param stars star properties data structure + * @param props properties of the feedback model. * @param sp spart we are computing feedback from */ -inline static void evolve_SNII( - float log10_min_mass, float log10_max_mass, float* stellar_yields, - const struct feedback_props* restrict feedback_props, - struct spart* restrict sp) { +inline static void evolve_SNII(float log10_min_mass, float log10_max_mass, + float* stellar_yields, + const struct feedback_props* props, + struct spart* sp) { int low_imf_mass_bin_index, high_imf_mass_bin_index, mass_bin_index; /* If mass at beginning of step is less than tabulated lower bound for IMF, * limit it.*/ - if (log10_min_mass < feedback_props->log10_SNII_min_mass_msun) - log10_min_mass = feedback_props->log10_SNII_min_mass_msun; + if (log10_min_mass < props->log10_SNII_min_mass_msun) + log10_min_mass = props->log10_SNII_min_mass_msun; /* If mass at end of step is greater than tabulated upper bound for IMF, limit * it.*/ - if (log10_max_mass > feedback_props->log10_SNII_max_mass_msun) - log10_max_mass = feedback_props->log10_SNII_max_mass_msun; + if (log10_max_mass > props->log10_SNII_max_mass_msun) + log10_max_mass = props->log10_SNII_max_mass_msun; /* Don't do anything if the stellar mass hasn't decreased by the end of the * step */ @@ -382,11 +382,12 @@ inline static void evolve_SNII( /* determine which IMF mass bins contribute to the integral */ determine_imf_bins(log10_min_mass, log10_max_mass, &low_imf_mass_bin_index, - &high_imf_mass_bin_index, feedback_props); + &high_imf_mass_bin_index, props); /* Integrate IMF to determine number of SNII */ - sp->feedback_data.to_distribute.num_SNII = integrate_imf( - log10_min_mass, log10_max_mass, 0, stellar_yields, feedback_props); + sp->feedback_data.to_distribute.num_SNII = + integrate_imf(log10_min_mass, log10_max_mass, + eagle_imf_integration_no_weight, stellar_yields, props); /* determine which metallicity bin and offset this star belongs to */ int iz_low = 0, iz_high = 0, low_index_3d, high_index_3d, low_index_2d, @@ -394,7 +395,7 @@ inline static void evolve_SNII( float dz = 0.; determine_bin_yield_SNII(&iz_low, &iz_high, &dz, log10(sp->chemistry_data.metal_mass_fraction_total), - feedback_props); + props); /* compute metals produced */ float metal_mass_released[chemistry_element_count], metal_mass_released_total; @@ -415,18 +416,17 @@ inline static void evolve_SNII( eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = (1 - dz) * - (feedback_props->yield_SNII.yield_IMF_resampled[low_index_3d] + + (props->yield_SNII.yield_IMF_resampled[low_index_3d] + sp->chemistry_data.metal_mass_fraction[elem] * - feedback_props->yield_SNII - .ejecta_IMF_resampled[low_index_2d]) + - dz * (feedback_props->yield_SNII.yield_IMF_resampled[high_index_3d] + + props->yield_SNII.ejecta_IMF_resampled[low_index_2d]) + + dz * (props->yield_SNII.yield_IMF_resampled[high_index_3d] + sp->chemistry_data.metal_mass_fraction[elem] * - feedback_props->yield_SNII - .ejecta_IMF_resampled[high_index_2d]); + props->yield_SNII.ejecta_IMF_resampled[high_index_2d]); } - metal_mass_released[elem] = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + metal_mass_released[elem] = integrate_imf( + log10_min_mass, log10_max_mass, eagle_imf_integration_yield_weight, + stellar_yields, props); } /* Compute mass produced */ @@ -439,20 +439,17 @@ inline static void evolve_SNII( eagle_feedback_SNII_N_metals, eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = - (1 - dz) * (feedback_props->yield_SNII - .total_metals_IMF_resampled[low_index_2d] + + (1 - dz) * (props->yield_SNII.total_metals_IMF_resampled[low_index_2d] + sp->chemistry_data.metal_mass_fraction_total * - feedback_props->yield_SNII - .ejecta_IMF_resampled[low_index_2d]) + - dz * (feedback_props->yield_SNII - .total_metals_IMF_resampled[high_index_2d] + + props->yield_SNII.ejecta_IMF_resampled[low_index_2d]) + + dz * (props->yield_SNII.total_metals_IMF_resampled[high_index_2d] + sp->chemistry_data.metal_mass_fraction_total * - feedback_props->yield_SNII - .ejecta_IMF_resampled[high_index_2d]); + props->yield_SNII.ejecta_IMF_resampled[high_index_2d]); } - metal_mass_released_total = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + metal_mass_released_total = + integrate_imf(log10_min_mass, log10_max_mass, + eagle_imf_integration_yield_weight, stellar_yields, props); /* yield normalization */ float mass_ejected, mass_released; @@ -473,13 +470,13 @@ inline static void evolve_SNII( eagle_feedback_SNII_N_metals, eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = - (1 - dz) * - feedback_props->yield_SNII.ejecta_IMF_resampled[low_index_2d] + - dz * feedback_props->yield_SNII.ejecta_IMF_resampled[high_index_2d]; + (1 - dz) * props->yield_SNII.ejecta_IMF_resampled[low_index_2d] + + dz * props->yield_SNII.ejecta_IMF_resampled[high_index_2d]; } - mass_ejected = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + mass_ejected = + integrate_imf(log10_min_mass, log10_max_mass, + eagle_imf_integration_yield_weight, stellar_yields, props); /* compute the total mass released */ mass_released = metal_mass_released_total + @@ -518,20 +515,20 @@ inline static void evolve_SNII( * @param log10_max_mass log10 mass at the beginning of step * @param stellar_yields array to store calculated yields for passing to * integrate_imf - * @param feedback_props star properties data structure - * @param sp spart we are computing feedback from + * @param props Properties of the feedback model. + * @param sp spart we are computing feedback for. */ -inline static void evolve_AGB( - float log10_min_mass, float log10_max_mass, float* stellar_yields, - const struct feedback_props* restrict feedback_props, - struct spart* restrict sp) { +inline static void evolve_AGB(const float log10_min_mass, float log10_max_mass, + float* stellar_yields, + const struct feedback_props* props, + struct spart* sp) { int low_imf_mass_bin_index, high_imf_mass_bin_index, mass_bin_index; /* If mass at end of step is greater than tabulated lower bound for IMF, limit * it.*/ - if (log10_max_mass > feedback_props->log10_SNII_min_mass_msun) - log10_max_mass = feedback_props->log10_SNII_min_mass_msun; + if (log10_max_mass > props->log10_SNII_min_mass_msun) + log10_max_mass = props->log10_SNII_min_mass_msun; /* Don't do anything if the stellar mass hasn't decreased by the end of the * step */ @@ -539,7 +536,7 @@ inline static void evolve_AGB( /* determine which IMF mass bins contribute to the integral */ determine_imf_bins(log10_min_mass, log10_max_mass, &low_imf_mass_bin_index, - &high_imf_mass_bin_index, feedback_props); + &high_imf_mass_bin_index, props); /* determine which metallicity bin and offset this star belongs to */ int iz_low = 0, iz_high = 0, low_index_3d, high_index_3d, low_index_2d, @@ -547,7 +544,7 @@ inline static void evolve_AGB( float dz = 0.f; determine_bin_yield_AGB(&iz_low, &iz_high, &dz, log10(sp->chemistry_data.metal_mass_fraction_total), - feedback_props); + props); /* compute metals produced */ float metal_mass_released[chemistry_element_count], metal_mass_released_total; @@ -567,19 +564,17 @@ inline static void evolve_AGB( eagle_feedback_AGB_N_metals, eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = - (1 - dz) * - (feedback_props->yield_AGB.yield_IMF_resampled[low_index_3d] + - sp->chemistry_data.metal_mass_fraction[elem] * - feedback_props->yield_AGB - .ejecta_IMF_resampled[low_index_2d]) + - dz * (feedback_props->yield_AGB.yield_IMF_resampled[high_index_3d] + + (1 - dz) * (props->yield_AGB.yield_IMF_resampled[low_index_3d] + + sp->chemistry_data.metal_mass_fraction[elem] * + props->yield_AGB.ejecta_IMF_resampled[low_index_2d]) + + dz * (props->yield_AGB.yield_IMF_resampled[high_index_3d] + sp->chemistry_data.metal_mass_fraction[elem] * - feedback_props->yield_AGB - .ejecta_IMF_resampled[high_index_2d]); + props->yield_AGB.ejecta_IMF_resampled[high_index_2d]); } - metal_mass_released[elem] = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + metal_mass_released[elem] = integrate_imf( + log10_min_mass, log10_max_mass, eagle_imf_integration_yield_weight, + stellar_yields, props); } /* Compute mass produced */ @@ -592,20 +587,17 @@ inline static void evolve_AGB( row_major_index_2d(iz_high, mass_bin_index, eagle_feedback_AGB_N_metals, eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = - (1 - dz) * - (feedback_props->yield_AGB - .total_metals_IMF_resampled[low_index_2d] + - sp->chemistry_data.metal_mass_fraction_total * - feedback_props->yield_AGB.ejecta_IMF_resampled[low_index_2d]) + - dz * - (feedback_props->yield_AGB - .total_metals_IMF_resampled[high_index_2d] + - sp->chemistry_data.metal_mass_fraction_total * - feedback_props->yield_AGB.ejecta_IMF_resampled[high_index_2d]); + (1 - dz) * (props->yield_AGB.total_metals_IMF_resampled[low_index_2d] + + sp->chemistry_data.metal_mass_fraction_total * + props->yield_AGB.ejecta_IMF_resampled[low_index_2d]) + + dz * (props->yield_AGB.total_metals_IMF_resampled[high_index_2d] + + sp->chemistry_data.metal_mass_fraction_total * + props->yield_AGB.ejecta_IMF_resampled[high_index_2d]); } - metal_mass_released_total = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + metal_mass_released_total = + integrate_imf(log10_min_mass, log10_max_mass, + eagle_imf_integration_yield_weight, stellar_yields, props); /* yield normalization */ float mass_ejected, mass_released; @@ -626,13 +618,13 @@ inline static void evolve_AGB( row_major_index_2d(iz_high, mass_bin_index, eagle_feedback_AGB_N_metals, eagle_feedback_N_imf_bins); stellar_yields[mass_bin_index] = - (1 - dz) * - feedback_props->yield_AGB.ejecta_IMF_resampled[low_index_2d] + - dz * feedback_props->yield_AGB.ejecta_IMF_resampled[high_index_2d]; + (1 - dz) * props->yield_AGB.ejecta_IMF_resampled[low_index_2d] + + dz * props->yield_AGB.ejecta_IMF_resampled[high_index_2d]; } - mass_ejected = integrate_imf(log10_min_mass, log10_max_mass, 2, - stellar_yields, feedback_props); + mass_ejected = + integrate_imf(log10_min_mass, log10_max_mass, + eagle_imf_integration_yield_weight, stellar_yields, props); /* compute the total mass released */ mass_released = metal_mass_released_total + @@ -665,7 +657,8 @@ inline static void evolve_AGB( * @brief calculates stellar mass in spart that died over the timestep, calls * functions to calculate feedback due to SNIa, SNII and AGB * - * @param star_properties feedback_props_props data structure + * @param feedback_props feedback_props data structure + * @param cosmo The cosmological model. * @param sp spart that we're evolving * @param us unit_system data structure * @param age age of spart at beginning of step @@ -745,11 +738,12 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props, * * By default, takes the values provided by the hydro. * - * @param sp The #feedback_properties. + * @param fp The #feedback_props. * @param phys_const The physical constants in the internal unit system. * @param us The internal unit system. * @param params The parsed parameters. - * @param p The already read-in properties of the hydro scheme. + * @param hydro_props The already read-in properties of the hydro scheme. + * @param cosmo The cosmological model. */ void feedback_props_init(struct feedback_props* fp, const struct phys_const* phys_const, diff --git a/src/feedback/EAGLE/feedback.h b/src/feedback/EAGLE/feedback.h index ed1183a53c2196264bdae8c7a976ae001bfcf04e..18012ff47edbc0c845185173a91d6260d8e6999b 100644 --- a/src/feedback/EAGLE/feedback.h +++ b/src/feedback/EAGLE/feedback.h @@ -109,7 +109,7 @@ __attribute__((always_inline)) INLINE static void feedback_prepare_spart( * this information to a different MPI rank. * * @param sp The particle to act upon - * @param feedback_propss The #feedback_props structure. + * @param feedback_props The #feedback_props structure. * @param cosmo The current cosmological model. * @param us The unit system. * @param star_age_beg_step The age of the star at the star of the time-step in diff --git a/src/feedback/EAGLE/feedback_iact.h b/src/feedback/EAGLE/feedback_iact.h index 188ec66744b304270371707aa6cd53594bcacc87..93937677317c28b7e298e3ace45b5e03bd341e93 100644 --- a/src/feedback/EAGLE/feedback_iact.h +++ b/src/feedback/EAGLE/feedback_iact.h @@ -28,19 +28,18 @@ * @param hj Comoving smoothing-length of particle j. * @param si First sparticle. * @param pj Second particle (not updated). - * @param a Current scale factor. - * @param H Current Hubble parameter. - * @param xp Extra particle data + * @param xp Extra particle data (not updated). + * @param cosmo The cosmological model. * @param ti_current Current integer time value */ __attribute__((always_inline)) INLINE static void -runner_iact_nonsym_feedback_density(float r2, const float *dx, float hi, - float hj, struct spart *restrict si, +runner_iact_nonsym_feedback_density(const float r2, const float *dx, + const float hi, const float hj, + struct spart *restrict si, const struct part *restrict pj, - const struct cosmology *restrict cosmo, - const struct feedback_props *feedback_props, const struct xpart *restrict xp, - integertime_t ti_current) { + const struct cosmology *restrict cosmo, + const integertime_t ti_current) { /* Get the gas mass. */ const float mj = hydro_get_mass(pj); @@ -75,21 +74,21 @@ runner_iact_nonsym_feedback_density(float r2, const float *dx, float hi, * @param dx Comoving vector separating both particles (si - pj). * @param hi Comoving smoothing-length of particle i. * @param hj Comoving smoothing-length of particle j. - * @param si First (star) particle. + * @param si First (star) particle (not updated). * @param pj Second (gas) particle. - * @param a Current scale factor. - * @param H Current Hubble parameter. * @param xp Extra particle data + * @param cosmo The cosmological model. * @param ti_current Current integer time used value for seeding random number * generator */ __attribute__((always_inline)) INLINE static void -runner_iact_nonsym_feedback_apply( - float r2, const float *dx, float hi, float hj, - const struct spart *restrict si, struct part *restrict pj, - const struct cosmology *restrict cosmo, - const struct feedback_props *restrict feedback_props, - struct xpart *restrict xp, integertime_t ti_current) { +runner_iact_nonsym_feedback_apply(const float r2, const float *dx, + const float hi, const float hj, + const struct spart *restrict si, + struct part *restrict pj, + struct xpart *restrict xp, + const struct cosmology *restrict cosmo, + const integertime_t ti_current) { /* Get r and 1/r. */ const float r_inv = 1.0f / sqrtf(r2); diff --git a/src/feedback/EAGLE/feedback_properties.h b/src/feedback/EAGLE/feedback_properties.h index c8fab9aec3cfe858db59b26a10deeebfc3ea63eb..a18a0582bdd5a2389d54f9b5b40211e27d0ba32c 100644 --- a/src/feedback/EAGLE/feedback_properties.h +++ b/src/feedback/EAGLE/feedback_properties.h @@ -93,12 +93,14 @@ struct feedback_props { /* Array of mass bins for yield calculations */ double *yield_mass_bins; - /* Table of lifetime values */ - struct lifetime_table lifetimes; - /* Location of yield tables */ char yield_table_path[200]; + /* ------------- Lifetime tracks --------------- */ + + /* Table of lifetime values */ + struct lifetime_table lifetimes; + /* ------------- SNII parameters --------------- */ /* Array of adjustment factors for SNII */ diff --git a/src/feedback/EAGLE/imf.h b/src/feedback/EAGLE/imf.h index 17bf5445543312b9cf9475609ef21ec77901be9e..9997990e70ad3db431a225df3c8fb99b7f543ef9 100644 --- a/src/feedback/EAGLE/imf.h +++ b/src/feedback/EAGLE/imf.h @@ -44,7 +44,7 @@ enum eagle_imf_integration_type { * @param log10_max_mass Upper mass bound * @param i_min (return) Index of IMF mass bin containing log10_min_mass * @param i_max (return) Index of IMF mass bin containing log10_max_mass - * @param star_properties the #stars_props data struct + * @param feedback_props the #feedback_props data struct */ inline static void determine_imf_bins( double log10_min_mass, double log10_max_mass, int *i_min, int *i_max, @@ -87,7 +87,7 @@ inline static void determine_imf_bins( * @param mode Type of weighting for the IMF integration. * @param stellar_yields Array of weights based on yields. Used only for * yield-weighted integration. - * @param star_properties the #stars_props data structure + * @param feedback_props the #feedback_props data structure */ inline static float integrate_imf(const float log10_min_mass, const float log10_max_mass, @@ -192,7 +192,8 @@ inline static float integrate_imf(const float log10_min_mass, * @brief Allocate space for IMF table and compute values to populate this * table. * - * @param star_properties #stars_props data structure */ + * @param feedback_props #feedback_props data structure + */ inline static void init_imf(struct feedback_props *feedback_props) { /* Compute size of mass bins in log10 space */ @@ -265,7 +266,7 @@ inline static void init_imf(struct feedback_props *feedback_props) { * * @param age_Gyr age of star in Gyr. * @param Z Star's metallicity (metal mass fraction). - * @param star_properties the #stars_props data structure. + * @param feedback_props the #feedback_props data structure. * @return Mass of stars died up to that age in solar masses. */ inline static float dying_mass_msun( diff --git a/src/feedback/EAGLE/yield_tables.h b/src/feedback/EAGLE/yield_tables.h index 9a4b39f900964b4df96f9111d2ce1ef6596c02dc..2bdd8e784ab3b1de48e27937dc3a81a2e0b5aefb 100644 --- a/src/feedback/EAGLE/yield_tables.h +++ b/src/feedback/EAGLE/yield_tables.h @@ -81,7 +81,7 @@ inline static int get_element_index(const char *element_name, * @brief reads yield tables, flattens and stores them in stars_props data * struct * - * @param stars the #stars_props data structure + * @param feedback_props the #feedback_props data struct to read the table into. */ inline static void read_yield_tables(struct feedback_props *feedback_props) { @@ -384,7 +384,7 @@ inline static void read_yield_tables(struct feedback_props *feedback_props) { /** * @brief allocates space for the yield tables * - * @param stars the #stars_props data struct to store the tables in + * @param feedback_props the #feedback_props data struct to store the tables in */ inline static void allocate_yield_tables( struct feedback_props *feedback_props) { @@ -604,7 +604,7 @@ inline static void allocate_yield_tables( /** * @brief resamples yields based on IMF mass bins * - * @param stars the #stars_props data structure + * @param feedback_props the #feedback_props data struct. */ inline static void compute_yields(struct feedback_props *feedback_props) { @@ -754,7 +754,7 @@ inline static void compute_yields(struct feedback_props *feedback_props) { /** * @brief resamples ejecta based on IMF mass bins * - * @param stars the #stars_props data structure + * @param feedback_props the #feedback_props data struct. */ inline static void compute_ejecta(struct feedback_props *feedback_props) { diff --git a/src/runner_doiact_stars.h b/src/runner_doiact_stars.h index 3dc1f1e5d07739ac1d8db6bc5bbbb3cb758b9835..841515b0b079bf29a9c3dfd5c28ec8cc8848de32 100644 --- a/src/runner_doiact_stars.h +++ b/src/runner_doiact_stars.h @@ -90,7 +90,6 @@ void DOSELF1_STARS(struct runner *r, struct cell *c, int timer) { const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Anything to do here? */ if (c->hydro.count == 0 || c->stars.count == 0) return; @@ -146,11 +145,11 @@ void DOSELF1_STARS(struct runner *r, struct cell *c, int timer) { if (r2 < hig2) { IACT_STARS(r2, dx, hi, hj, si, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, xpj, cosmo, + ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in ci. */ @@ -178,7 +177,6 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci, const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Anything to do here? */ if (cj->hydro.count == 0 || ci->stars.count == 0) return; @@ -244,11 +242,11 @@ void DO_NONSYM_PAIR1_STARS_NAIVE(struct runner *r, struct cell *restrict ci, IACT_STARS(r2, dx, hi, hj, si, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, si, pj, xpj, cosmo, + ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, si, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in cj. */ @@ -270,7 +268,6 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj, const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Cosmological terms */ const float a = cosmo->a; @@ -408,11 +405,11 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj, IACT_STARS(r2, dx, hi, hj, spi, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj, + cosmo, ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in cj. */ @@ -534,11 +531,11 @@ void DO_SYM_PAIR1_STARS(struct runner *r, struct cell *ci, struct cell *cj, IACT_STARS(r2, dx, hj, hi, spj, pi, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hj, hi, spj, pi, cosmo, - feedback_props, xpi, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hj, hi, spj, pi, xpi, + cosmo, ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hj, hi, spj, pi, cosmo, - feedback_props, xpi, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hj, hi, spj, pi, xpi, cosmo, + ti_current); #endif } } /* loop over the parts in ci. */ @@ -587,7 +584,6 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci, const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Cosmological terms */ const float a = cosmo->a; @@ -653,11 +649,11 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci, IACT_STARS(r2, dx, hi, hj, spi, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj, + cosmo, ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in cj. */ @@ -713,11 +709,11 @@ void DOPAIR1_SUBSET_STARS(struct runner *r, struct cell *restrict ci, IACT_STARS(r2, dx, hi, hj, spi, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj, + cosmo, ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in cj. */ @@ -751,7 +747,6 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci, const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Cosmological terms */ const float a = cosmo->a; @@ -811,11 +806,11 @@ void DOPAIR1_SUBSET_STARS_NAIVE(struct runner *r, struct cell *restrict ci, IACT_STARS(r2, dx, hi, hj, spi, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, hj, spi, pj, xpj, cosmo, + ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, hj, spi, pj, xpj, cosmo, + ti_current); #endif } } /* loop over the parts in cj. */ @@ -843,7 +838,6 @@ void DOSELF1_SUBSET_STARS(struct runner *r, struct cell *restrict ci, const struct engine *e = r->e; const integertime_t ti_current = e->ti_current; const struct cosmology *cosmo = e->cosmology; - const struct feedback_props *feedback_props = e->feedback_props; /* Cosmological terms */ const float a = cosmo->a; @@ -899,11 +893,11 @@ void DOSELF1_SUBSET_STARS(struct runner *r, struct cell *restrict ci, if (r2 < hig2) { IACT_STARS(r2, dx, hi, pj->h, spi, pj, a, H); #if (FUNCTION_TASK_LOOP == TASK_LOOP_DENSITY) - runner_iact_nonsym_feedback_density(r2, dx, hi, pj->h, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_density(r2, dx, hi, pj->h, spi, pj, xpj, + cosmo, ti_current); #elif (FUNCTION_TASK_LOOP == TASK_LOOP_FEEDBACK) - runner_iact_nonsym_feedback_apply(r2, dx, hi, pj->h, spi, pj, cosmo, - feedback_props, xpj, ti_current); + runner_iact_nonsym_feedback_apply(r2, dx, hi, pj->h, spi, pj, xpj, + cosmo, ti_current); #endif } } /* loop over the parts in cj. */ diff --git a/src/stars/Default/stars.h b/src/stars/Default/stars.h index c33c234bd5b694c0e40d0171595c63ba05d88486..0cf6fbdcb214575155f27bd3247e6b80228b24c5 100644 --- a/src/stars/Default/stars.h +++ b/src/stars/Default/stars.h @@ -40,6 +40,7 @@ __attribute__((always_inline)) INLINE static float stars_compute_timestep( * read in to do some conversions. * * @param sp The particle to act upon + * @param stars_properties The properties of the stellar model. */ __attribute__((always_inline)) INLINE static void stars_first_init_spart( struct spart* sp, const struct stars_props* stars_properties) { @@ -143,21 +144,6 @@ __attribute__((always_inline)) INLINE static void stars_spart_has_no_neighbours( sp->density.wcount_dh = 0.f; } -/** - * @brief Evolve the stellar properties of a #spart. - * - * This function allows for example to compute the SN rate before sending - * this information to a different MPI rank. - * - * @param sp The particle to act upon - * @param cosmo The current cosmological model. - * @param stars_properties The #stars_props - */ -__attribute__((always_inline)) INLINE static void stars_evolve_spart( - struct spart* restrict sp, const struct stars_props* stars_properties, - const struct cosmology* cosmo, const struct unit_system* us, - double star_age, double dt) {} - /** * @brief Reset acceleration fields of a particle * diff --git a/src/stars/Default/stars_io.h b/src/stars/Default/stars_io.h index ce54191e39901a1056abdefecb069563e60fd0cb..5ff57549b9d0db37d6929c1e9fbb8da8372d7e6c 100644 --- a/src/stars/Default/stars_io.h +++ b/src/stars/Default/stars_io.h @@ -103,6 +103,7 @@ INLINE static void stars_write_particles(const struct spart *sparts, * @param us The internal unit system. * @param params The parsed parameters. * @param p The already read-in properties of the hydro scheme. + * @param cosmo The cosmological model. */ INLINE static void stars_props_init(struct stars_props *sp, const struct phys_const *phys_const, diff --git a/src/stars/EAGLE/stars_io.h b/src/stars/EAGLE/stars_io.h index 55efa9fef8f053d18c5923a7578161aa92133f69..9f5b263e2f1af597d1422749eb3ff0e248ad797f 100644 --- a/src/stars/EAGLE/stars_io.h +++ b/src/stars/EAGLE/stars_io.h @@ -97,6 +97,7 @@ INLINE static void stars_write_particles(const struct spart *sparts, * @param us The internal unit system. * @param params The parsed parameters. * @param p The already read-in properties of the hydro scheme. + * @param cosmo The cosmological model. */ INLINE static void stars_props_init(struct stars_props *sp, const struct phys_const *phys_const,