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

Do not update the internals of each individual scheme.

parent a5cc0145
No related branches found
No related tags found
1 merge request!926Alternative definition of the number of neighbours
......@@ -501,7 +501,7 @@ __attribute__((always_inline)) INLINE static void hydro_remove_part(
__attribute__((always_inline)) INLINE static void hydro_init_part(
struct part *restrict p, const struct hydro_space *hs) {
p->density.wcount = 1.f;
p->density.wcount = 0.f;
p->density.wcount_dh = 0.f;
p->rho = 0.f;
p->density.rho_dh = 0.f;
......@@ -539,17 +539,14 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Final operation on the density (add self-contribution). */
p->rho += p->mass * kernel_root;
p->density.rho_dh -= hydro_dimension * p->mass * kernel_root;
// p->density.wcount += kernel_root;
// p->density.wcount_dh -= hydro_dimension * kernel_root;
p->density.wcount += kernel_root;
p->density.wcount_dh -= hydro_dimension * kernel_root;
/* Finish the calculation by inserting the missing h-factors */
p->rho *= h_inv_dim;
p->density.rho_dh *= h_inv_dim_plus_one;
// p->density.wcount *= h_inv_dim;
// p->density.wcount_dh *= h_inv_dim_plus_one;
p->density.wcount = p->rho / p->mass;
p->density.wcount_dh = p->density.rho_dh / p->mass;
p->density.wcount *= h_inv_dim;
p->density.wcount_dh *= h_inv_dim_plus_one;
const float rho_inv = 1.f / p->rho;
const float a_inv2 = cosmo->a2_inv;
......
......@@ -65,8 +65,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
pi->rho += mj * wi;
pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
// pi->density.wcount += wi;
// pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
pi->density.wcount += wi;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
/* Compute density of pj. */
const float hj_inv = 1.f / hj;
......@@ -75,8 +76,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
pj->rho += mi * wj;
pj->density.rho_dh -= mi * (hydro_dimension * wj + uj * wj_dx);
// pj->density.wcount += wj;
// pj->density.wcount_dh -= (hydro_dimension * wj + uj * wj_dx);
pj->density.wcount += wj;
pj->density.wcount_dh -= (hydro_dimension * wj + uj * wj_dx);
/* Now we need to compute the div terms */
const float r_inv = 1.f / r;
......@@ -138,8 +139,9 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
pi->rho += mj * wi;
pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
// pi->density.wcount += wi;
// pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
pi->density.wcount += wi;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
const float r_inv = 1.f / r;
const float faci = mj * wi_dx * r_inv;
......
......@@ -470,7 +470,7 @@ __attribute__((always_inline)) INLINE static void hydro_timestep_extra(
__attribute__((always_inline)) INLINE static void hydro_init_part(
struct part *restrict p, const struct hydro_space *hs) {
p->density.wcount = 1.f;
p->density.wcount = 0.f;
p->density.wcount_dh = 0.f;
p->rho = 0.f;
p->density.rho_dh = 0.f;
......@@ -505,17 +505,14 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Final operation on the density (add self-contribution). */
p->rho += p->mass * kernel_root;
p->density.rho_dh -= hydro_dimension * p->mass * kernel_root;
// p->density.wcount += kernel_root;
// p->density.wcount_dh -= hydro_dimension * kernel_root;
p->density.wcount += kernel_root;
p->density.wcount_dh -= hydro_dimension * kernel_root;
/* Finish the calculation by inserting the missing h-factors */
p->rho *= h_inv_dim;
p->density.rho_dh *= h_inv_dim_plus_one;
// p->density.wcount *= h_inv_dim;
// p->density.wcount_dh *= h_inv_dim_plus_one;
p->density.wcount = p->rho / p->mass;
p->density.wcount_dh = p->density.rho_dh / p->mass;
p->density.wcount *= h_inv_dim;
p->density.wcount_dh *= h_inv_dim_plus_one;
const float rho_inv = 1.f / p->rho;
const float a_inv2 = cosmo->a2_inv;
......
......@@ -77,8 +77,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
pi->rho += mj * wi;
pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
// pi->density.wcount += wi;
// pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
pi->density.wcount += wi;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
/* Compute density of pj. */
const float hj_inv = 1.f / hj;
......@@ -87,8 +87,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
pj->rho += mi * wj;
pj->density.rho_dh -= mi * (hydro_dimension * wj + uj * wj_dx);
// pj->density.wcount += wj;
// pj->density.wcount_dh -= (hydro_dimension * wj + uj * wj_dx);
pj->density.wcount += wj;
pj->density.wcount_dh -= (hydro_dimension * wj + uj * wj_dx);
/* Compute dv dot r */
float dv[3], curlvr[3];
......@@ -156,8 +156,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
pi->rho += mj * wi;
pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
// pi->density.wcount += wi;
// pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
pi->density.wcount += wi;
pi->density.wcount_dh -= (hydro_dimension * wi + ui * wi_dx);
/* Compute dv dot r */
float dv[3], curlvr[3];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment