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