Commit 8a904dc5 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

When recovering the mass of a particle, use the 'hydro_get_mass()' function...

When recovering the mass of a particle, use the 'hydro_get_mass()' function such that the subgrid model also works for gizmoid schemes.
parent ee0b0bf8
......@@ -92,7 +92,7 @@ __attribute__((always_inline)) INLINE static void chemistry_end_density(
const float h = p->h;
const float h_inv = 1.0f / h; /* 1/h */
const float factor = pow_dimension(h_inv) / p->rho; /* 1 / h^d * rho */
const float m = p->mass;
const float m = hydro_get_mass(p);
struct chemistry_part_data* cpd = &p->chemistry_data;
......
......@@ -48,8 +48,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_chemistry(
float wj;
/* Get the masses. */
const float mi = pi->mass;
const float mj = pj->mass;
const float mi = hydro_get_mass(pi);
const float mj = hydro_get_mass(pj);
/* Get r */
const float r = sqrtf(r2);
......@@ -106,7 +106,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_chemistry(
float wi;
/* Get the masses. */
const float mj = pj->mass;
const float mj = hydro_get_mass(pj);
/* Get r */
const float r = sqrtf(r2);
......
......@@ -294,7 +294,7 @@ INLINE static void star_formation_compute_SFR(
if (physical_density >
starform->max_gas_density * phys_const->const_proton_mass) {
xp->sf_data.SFR = p->mass / dt_star;
xp->sf_data.SFR = hydro_get_mass(p) / dt_star;
return;
}
......@@ -316,7 +316,7 @@ INLINE static void star_formation_compute_SFR(
}
/* Store the SFR */
xp->sf_data.SFR = SFRpergasmass * p->mass;
xp->sf_data.SFR = SFRpergasmass * hydro_get_mass(p);
}
/**
......@@ -338,7 +338,7 @@ INLINE static int star_formation_should_convert_to_star(
const double dt_star) {
/* Calculate the propability of forming a star */
const double prob = xp->sf_data.SFR * dt_star / p->mass;
const double prob = xp->sf_data.SFR * dt_star / hydro_get_mass(p);
/* Get a unique random number between 0 and 1 for star formation */
const double random_number =
......@@ -393,10 +393,10 @@ INLINE static void star_formation_copy_properties(
const struct cosmology* cosmo, const int with_cosmology) {
/* Store the current mass */
sp->mass = p->mass;
sp->mass = hydro_get_mass(p);
/* Store the current mass as the initial mass */
sp->mass_init = p->mass;
sp->mass_init = hydro_get_mass(p);
/* Store either the birth_scale_factor or birth_time depending */
if (with_cosmology) {
......
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