Commit 1d91e15a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fix mistake in the high-order softened derivative terms

parent 6975c66e
......@@ -209,10 +209,10 @@ __attribute__((const)) INLINE static float D_soft_5(const float u,
error("Invalid choice of softening kernel shape");
#endif
/* (phi'(u)/u)'/u = 105u^3 - 360u^2 + 420u - 168 */
float phi = 105.f * u - 360.f;
phi = phi * u + 420.f;
phi = phi * u - 168.f;
/* (phi'(u)/u)'/u = 35u^3 - 120u^2 + 140u - 56 */
float phi = 35.f * u - 120.f;
phi = phi * u + 140.f;
phi = phi * u - 56.f;
return phi;
}
......@@ -223,7 +223,9 @@ __attribute__((const)) INLINE static float D_soft_7(const float u,
error("Invalid choice of softening kernel shape");
#endif
return 315.f * u - 720.f + 420.f * u_inv;
/* 21 u - 48 + 28 u^-1 */
/* 21 u - 48 + 28 u_inv */
return 21.f * u - 48.f + 28.f * u_inv;
}
__attribute__((const)) INLINE static float D_soft_9(const float u,
......@@ -233,10 +235,10 @@ __attribute__((const)) INLINE static float D_soft_9(const float u,
error("Invalid choice of softening kernel shape");
#endif
/* -315 u^-1 + 420 u^-3 */
/* -315 u_inv + 420 u_inv^3 */
float phi = -420.f * u_inv;
phi = phi * u_inv + 315.f;
/* (1/3) u^-1 - (4/3) u^-3 */
/* (1/3) u_inv - (4/3) u_inv^3 */
float phi = 1.3333333f * u_inv;
phi = phi * u_inv + 0.3333333f;
phi = phi * u_inv;
return phi;
......
......@@ -98,7 +98,7 @@ truncated an softened gravity field $\varphi (\mathbf{r}, r_s, H)
\begin{align}
\mathsf{\tilde{D}}_{5}(r, r_s, H) =
\left\lbrace\begin{array}{rcl}
\left(-105u^3 + 360u^2 - 420u + 168\right)\times H^{-5}& \mbox{if} & u < 1,\\
\left(-35u^3 + 120u^2 - 140u + 56\right)\times H^{-5}& \mbox{if} & u < 1,\\
%3\times r^{-5} & \mbox{if} & u \geq 1,
\left(r^2\chi''(r, r_s) - 3r\chi'(r, r_s) + 3\chi(r, r_s) \right)\times r^{-5} & \mbox{if} & u \geq 1,
\end{array}
......@@ -108,7 +108,7 @@ truncated an softened gravity field $\varphi (\mathbf{r}, r_s, H)
\begin{align}
\mathsf{\tilde{D}}_{7}(r, r_s, H) =
\left\lbrace\begin{array}{rcl}
-\left(315u - 720 + 420u^{-1}\right)\times H^{-7} & \mbox{if} & u < 1,\\
-\left(21u - 48 + 28u^{-1}\right)\times H^{-7} & \mbox{if} & u < 1,\\
%-15\times r^{-7} & \mbox{if} & u \geq 1,
\left(r^3\chi^{(3)}(r, r_s) - 6r^2\chi''(r, r_s)+15r\chi'(r, r_s)-15\chi(r, r_s)\right) \times r^{-7} & \mbox{if} & u \geq 1,
\end{array}
......@@ -118,7 +118,7 @@ truncated an softened gravity field $\varphi (\mathbf{r}, r_s, H)
\begin{align}
\mathsf{\tilde{D}}_{9}(r, r_s, H) =
\left\lbrace\begin{array}{rcl}
\left(-315u^{-1} + 420u^{-3}\right)\times H^{-9}& \mbox{if} & u < 1,\\
\left(-3u^{-1} + 4u^{-3}\right)\times H^{-9}& \mbox{if} & u < 1,\\
%105\times r^{-9} & \mbox{if} & u \geq 1.
\left(r^4\chi^{(4)}(r, r_s) - 10r^3\chi^{(3)} + 45r^2\chi''(r, r_s) - 105r\chi'(r, r_s) + 105\chi(r, r_s) \right) \times r^{-9} & \mbox{if} & u \geq 1
\end{array}
......@@ -128,7 +128,7 @@ truncated an softened gravity field $\varphi (\mathbf{r}, r_s, H)
\begin{align}
\mathsf{\tilde{D}}_{11}(r, r_s, H) =
\left\lbrace\begin{array}{rcl}
-\left(315u^{-3} - 1260u^{-5}\right)\times H^{-11}& \mbox{if} & u < 1,\\
-\left(\frac{1}{3}u^{-3} - \frac{4}{3}u^{-5}\right)\times H^{-11}& \mbox{if} & u < 1,\\
%-945\times r^{-11} & \mbox{if} & u \geq 1.
\left(r^5\chi^{(5)}(r, r_s) - 15r^4\chi^{(4)}(r, r_s) + 105r^3\chi^{(3)}(r, r_s) - 420r^2\chi''(r, r_s) + 945r \chi'(r, r_s) - 945\chi(r, r_s)\right) \times r^{-11} & \mbox{if} & u \geq 1.
\end{array}
......@@ -262,7 +262,7 @@ r_y \mathsf{\tilde{D}}_{5}(r, r_s, H) \nonumber
r_x^2 r_y^2 r_z \mathsf{\tilde{D}}_{11}(r, r_s, H) +
r_x^2 r_z \mathsf{\tilde{D}}_{9}(r, r_s, H) +
r_y^2 r_z \mathsf{\tilde{D}}_{9}(r, r_s, H) +
r_z \mathsf{\tilde{D}}_{y}(r, r_s, H)
r_z \mathsf{\tilde{D}}_{7}(r, r_s, H)
\nonumber
\end{align}
......
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