numerics
Loading...
Searching...
No Matches
kernel.hpp
Go to the documentation of this file.
1/// @file kernel.hpp
2/// @brief SPH smoothing kernels for 2D WCSPH — delegates to num::SPHKernel<2>.
3///
4/// The implementation lives in include/spatial/sph_kernel.hpp.
5/// This file keeps the Kernel:: API used by the 2D backends unchanged.
6#pragma once
7
9
10namespace physics {
11
12struct Kernel {
13 static float W(float r, float h) {
14 return num::SPHKernel<2>::W(r, h);
15 }
16 static float dW_dr(float r, float h) {
17 return num::SPHKernel<2>::dW_dr(r, h);
18 }
19 static float Spiky_dW_dr(float r, float h) {
21 }
22 static void Spiky_gradW(float rx, float ry, float r, float h,
23 float& gx, float& gy) {
24 auto g = num::SPHKernel<2>::Spiky_gradW({rx, ry}, r, h);
25 gx = g[0]; gy = g[1];
26 }
27};
28
29} // namespace physics
Dimension-generic SPH smoothing kernels.
static std::array< float, Dim > Spiky_gradW(std::array< float, Dim > r_vec, float r, float h)
static float dW_dr(float r, float h)
static float Spiky_dW_dr(float r, float h)
Radial derivative dW/dr of spiky kernel (<= 0, non-zero at r=0).
static float W(float r, float h)
2D/3D cubic spline density kernel. Support = 2h.
static float Spiky_dW_dr(float r, float h)
Definition kernel.hpp:19
static float dW_dr(float r, float h)
Definition kernel.hpp:16
static void Spiky_gradW(float rx, float ry, float r, float h, float &gx, float &gy)
Definition kernel.hpp:22
static float W(float r, float h)
Definition kernel.hpp:13