From 187597b3df80c1964af14901c078da60e47d6810 Mon Sep 17 00:00:00 2001
From: loikki <loic.hausammann@protonmail.ch>
Date: Tue, 13 Aug 2019 18:04:28 +0200
Subject: [PATCH] Remove drho_dh

---
 src/hydro/PressureEnergy/hydro.h       | 4 ----
 src/hydro/PressureEnergy/hydro_debug.h | 4 ++--
 src/hydro/PressureEnergy/hydro_iact.h  | 3 ---
 src/hydro/PressureEnergy/hydro_part.h  | 3 ---
 4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/hydro/PressureEnergy/hydro.h b/src/hydro/PressureEnergy/hydro.h
index 15f9a958a6..57e0091a7d 100644
--- a/src/hydro/PressureEnergy/hydro.h
+++ b/src/hydro/PressureEnergy/hydro.h
@@ -503,7 +503,6 @@ __attribute__((always_inline)) INLINE static void hydro_init_part(
   p->density.wcount = 0.f;
   p->density.wcount_dh = 0.f;
   p->rho = 0.f;
-  p->density.rho_dh = 0.f;
   p->pressure_bar = 0.f;
   p->density.pressure_bar_dh = 0.f;
 
@@ -537,7 +536,6 @@ __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->pressure_bar += p->mass * p->u * kernel_root;
   p->density.pressure_bar_dh -= hydro_dimension * p->mass * p->u * kernel_root;
   p->density.wcount += kernel_root;
@@ -545,7 +543,6 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
 
   /* Finish the calculation by inserting the missing h-factors */
   p->rho *= h_inv_dim;
-  p->density.rho_dh *= h_inv_dim_plus_one;
   p->pressure_bar *= (h_inv_dim * hydro_gamma_minus_one);
   p->density.pressure_bar_dh *= (h_inv_dim_plus_one * hydro_gamma_minus_one);
   p->density.wcount *= h_inv_dim;
@@ -590,7 +587,6 @@ __attribute__((always_inline)) INLINE static void hydro_part_has_no_neighbours(
   p->pressure_bar =
       p->mass * p->u * hydro_gamma_minus_one * kernel_root * h_inv_dim;
   p->density.wcount = kernel_root * h_inv_dim;
-  p->density.rho_dh = 0.f;
   p->density.wcount_dh = 0.f;
   p->density.pressure_bar_dh = 0.f;
 
diff --git a/src/hydro/PressureEnergy/hydro_debug.h b/src/hydro/PressureEnergy/hydro_debug.h
index 7ffc370ed4..861b16299f 100644
--- a/src/hydro/PressureEnergy/hydro_debug.h
+++ b/src/hydro/PressureEnergy/hydro_debug.h
@@ -30,13 +30,13 @@ __attribute__((always_inline)) INLINE static void hydro_debug_particle(
       "x=[%.3e,%.3e,%.3e], "
       "v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e], "
       "u=%.3e, du/dt=%.3e v_sig=%.3e, P=%.3e\n"
-      "h=%.3e, dh/dt=%.3e wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, \n"
+      "h=%.3e, dh/dt=%.3e wcount=%d, m=%.3e, rho=%.3e, \n"
       "p_dh=%.3e, p_bar=%.3e \n"
       "time_bin=%d wakeup=%d\n",
       p->x[0], p->x[1], p->x[2], p->v[0], p->v[1], p->v[2], xp->v_full[0],
       xp->v_full[1], xp->v_full[2], p->a_hydro[0], p->a_hydro[1], p->a_hydro[2],
       p->u, p->u_dt, p->force.v_sig, hydro_get_comoving_pressure(p), p->h,
-      p->force.h_dt, (int)p->density.wcount, p->mass, p->density.rho_dh, p->rho,
+      p->force.h_dt, (int)p->density.wcount, p->mass, p->rho,
       p->density.pressure_bar_dh, p->pressure_bar, p->time_bin, p->wakeup);
 }
 
diff --git a/src/hydro/PressureEnergy/hydro_iact.h b/src/hydro/PressureEnergy/hydro_iact.h
index aab8237c7b..62106bb35c 100644
--- a/src/hydro/PressureEnergy/hydro_iact.h
+++ b/src/hydro/PressureEnergy/hydro_iact.h
@@ -69,7 +69,6 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
   kernel_deval(ui, &wi, &wi_dx);
 
   pi->rho += mj * wi;
-  pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
 
   pi->pressure_bar += mj * wi * pj->u;
   pi->density.pressure_bar_dh -=
@@ -83,7 +82,6 @@ __attribute__((always_inline)) INLINE static void runner_iact_density(
   kernel_deval(uj, &wj, &wj_dx);
 
   pj->rho += mi * wj;
-  pj->density.rho_dh -= mi * (hydro_dimension * wj + uj * wj_dx);
   pj->pressure_bar += mi * wj * pi->u;
   pj->density.pressure_bar_dh -=
       mi * pi->u * (hydro_dimension * wj + uj * wj_dx);
@@ -149,7 +147,6 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_density(
   kernel_deval(ui, &wi, &wi_dx);
 
   pi->rho += mj * wi;
-  pi->density.rho_dh -= mj * (hydro_dimension * wi + ui * wi_dx);
 
   pi->pressure_bar += mj * wi * pj->u;
 
diff --git a/src/hydro/PressureEnergy/hydro_part.h b/src/hydro/PressureEnergy/hydro_part.h
index c8f02f518c..500569533a 100644
--- a/src/hydro/PressureEnergy/hydro_part.h
+++ b/src/hydro/PressureEnergy/hydro_part.h
@@ -132,9 +132,6 @@ struct part {
       /*! Derivative of the neighbour number with respect to h. */
       float wcount_dh;
 
-      /*! Derivative of density with respect to h */
-      float rho_dh;
-
       /*! Derivative of the weighted pressure with respect to h */
       float pressure_bar_dh;
 
-- 
GitLab