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

Simplify the terms D_soft_9 and D_soft_11

parent b0fd438b
......@@ -235,10 +235,10 @@ __attribute__((const)) INLINE static float D_soft_9(const float u,
error("Invalid choice of softening kernel shape");
#endif
/* (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;
/* 3 u^-1 - 4 u^-3 */
/* 3 u_inv - 4 u_inv^3 */
float phi = -4.f * u_inv;
phi = phi * u_inv + 3.f;
phi = phi * u_inv;
return phi;
......@@ -251,10 +251,10 @@ __attribute__((const)) INLINE static float D_soft_11(const float u,
error("Invalid choice of softening kernel shape");
#endif
/* 315 u^-3 - 1260 u^-5 */
/* 315 u_inv^3 - 1260 u_inv^5 */
float phi = -1260.f * u_inv;
phi = phi * u_inv + 315.f;
/* (1/3) u^-3 - (4/3) u^-5 */
/* (1/3) u_inv^3 - (4/3) u_inv^5 */
float phi = -1.3333333f * u_inv;
phi = phi * u_inv + 0.3333333f;
phi = phi * u_inv;
phi = phi * u_inv;
phi = phi * u_inv;
......
......@@ -78,7 +78,7 @@ truncated an softened gravity field $\varphi (\mathbf{r}, r_s, H)
\begin{align}
\mathsf{\tilde{D}}_{1}(r, r_s, H) =
\left\lbrace\begin{array}{rcl}
\left(-3u^7 + 15u^6 - 28u^5 + 21u^4 - 7u^2 + 3\right)\times H^{-1} & \mbox{if} & u < 1,\\
-\left(3u^7 - 15u^6 + 28u^5 - 21u^4 + 7u^2 - 3\right)\times H^{-1} & \mbox{if} & u < 1,\\
%r^{-1} & \mbox{if} & u \geq 1,
\chi(r, r_s) \times r^{-1} & \mbox{if} & u \geq 1,
\end{array}
......@@ -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(-35u^3 + 120u^2 - 140u + 56\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}
......@@ -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(-3u^{-1} + 4u^{-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}
......
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