Commit 1290a351 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Define kernel_norm to simply code readability

parent ecd3b766
......@@ -103,8 +103,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p->rho *= ih * ih2;
p->rho_dh *= ih4;
p->density.wcount *= (4.0f / 3.0f * M_PI * kernel_gamma3);
p->density.wcount_dh *= ih * (4.0f / 3.0f * M_PI * kernel_gamma4);
p->density.wcount *= kernel_norm;
p->density.wcount_dh *= ih * kernel_gamma * kernel_norm;
const float irho = 1.f / p->rho;
......
......@@ -97,8 +97,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p->rho *= ih * ih2;
p->rho_dh *= ih4;
p->density.wcount *= (4.0f / 3.0f * M_PI * kernel_gamma3);
p->density.wcount_dh *= ih * (4.0f / 3.0f * M_PI * kernel_gamma4);
p->density.wcount *= kernel_norm;
p->density.wcount_dh *= ih * kernel_gamma * kernel_norm;
const float irho = 1.f / p->rho;
......
......@@ -106,8 +106,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p->rho *= ih * ih2;
p->rho_dh *= ih4;
p->density.wcount *= (4.0f / 3.0f * M_PI * kernel_gamma3);
p->density.wcount_dh *= ih * (4.0f / 3.0f * M_PI * kernel_gamma4);
p->density.wcount *= kernel_norm;
p->density.wcount_dh *= ih * kernel_gamma * kernel_norm;
const float irho = 1.f / p->rho;
......
......@@ -154,6 +154,9 @@ static const float kernel_coeffs[(kernel_degree + 1) * (kernel_ivals + 1)]
#define kernel_root \
((float)(kernel_coeffs[kernel_degree]) * kernel_constant * kernel_igamma3)
/* Kernel normalisation constant (volume term) */
#define kernel_norm ((float)(4.0 * M_PI * kernel_gamma3 / 3.0))
/**
* @brief Computes the kernel function and its derivative.
*
......
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