Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammath::SPHKernelGen< Tscal_, BaseKernel > Class Template Reference

Public Types

using Generator = BaseKernel
using Tscal = Tscal_

Static Public Member Functions

static Tscal f (Tscal q)
 the base function for this SPH kernel
static Tscal df (Tscal q)
 derivative of M4::f
static Tscal ddf (Tscal q)
static Tscal W_1d (Tscal r, Tscal h)
static Tscal W_2d (Tscal r, Tscal h)
static Tscal W_3d (Tscal r, Tscal h)
 compute the normed & resized version of the kernel :
static Tscal dW_3d (Tscal r, Tscal h)
static Tscal ddW_3d (Tscal r, Tscal h)
static Tscal dhW_3d (Tscal r, Tscal h)
template<int np>
static Tscal f3d_integ_z (Tscal x)
 Riemann sum of \( f(\sqrt{x^2 + z^2}) \) along z over the kernel support.
static Tscal f3d_integ_z (Tscal x, int np=32)
static Tscal Y_3d (Tscal r, Tscal h, int np)
template<int np>
static Tscal Y_3d (Tscal r, Tscal h)
static Tscal phi_tilde_3d (Tscal q)
static Tscal phi_tilde_3d_prime (Tscal q)
static Tscal phi_3D (Tscal r, Tscal h)
static Tscal phi_3D_prime (Tscal r, Tscal h)

Static Public Attributes

static constexpr Tscal Rkern = BaseKernel::Rkern
static constexpr Tscal hfactd = BaseKernel::hfactd
static constexpr bool has_3d_phi_soft = ::shammath::has_phi_tilde_3d<BaseKernel, Tscal>::value
static constexpr bool has_3d_phi_soft_prime = ::shammath::has_phi_tilde_3d_prime<BaseKernel, Tscal>::value

Detailed Description

template<class Tscal_, class BaseKernel>
class shammath::SPHKernelGen< Tscal_, BaseKernel >

Definition at line 2287 of file sphkernels.hpp.

Member Typedef Documentation

◆ Generator

template<class Tscal_, class BaseKernel>
using shammath::SPHKernelGen< Tscal_, BaseKernel >::Generator = BaseKernel

Definition at line 2289 of file sphkernels.hpp.

◆ Tscal

template<class Tscal_, class BaseKernel>
using shammath::SPHKernelGen< Tscal_, BaseKernel >::Tscal = Tscal_

Definition at line 2290 of file sphkernels.hpp.

Member Function Documentation

◆ ddf()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::ddf ( Tscal q)
inlinestatic

Definition at line 2313 of file sphkernels.hpp.

◆ ddW_3d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::ddW_3d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2338 of file sphkernels.hpp.

◆ df()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::df ( Tscal q)
inlinestatic

derivative of M4::f

Parameters
qparameter of the function
Returns
Tscal the value of \( f'(q) \)

Definition at line 2311 of file sphkernels.hpp.

◆ dhW_3d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::dhW_3d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2342 of file sphkernels.hpp.

◆ dW_3d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::dW_3d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2334 of file sphkernels.hpp.

◆ f()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::f ( Tscal q)
inlinestatic

the base function for this SPH kernel

Such that : \(\int f(\vert\vert q\vert\vert) {\rm d}^n \mathbf{q} = 1\) Also : \( f(q > Rkern) = 0\)

Parameters
qparameter of the function
Returns
Tscal the value of \( f(q) \)

Definition at line 2303 of file sphkernels.hpp.

◆ f3d_integ_z() [1/2]

template<class Tscal_, class BaseKernel>
template<int np>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::f3d_integ_z ( Tscal x)
inlinestatic

Riemann sum of \( f(\sqrt{x^2 + z^2}) \) along z over the kernel support.

Samples the grid z_k = k * step, step = Rkern / np, for k = -np, ..., np - 1. These are the points visited by integ_riemann_sum(-Rkern, Rkern, step, ...) whenever its accumulated z += step is exact (e.g. a power of two np with the kernels here). The grid is symmetric around 0, so \( f(\sqrt{x^2 + z^2}) \) is evaluated once at z = 0 (as f(|x|), equal to f(sqrt(x * x)) barring over/underflow) and once per k = 1, ..., np - 1, counted twice for its mirror -z_k. The z = -Rkern sample is dropped since its argument \( \sqrt{x^2 + R_{\rm kern}^2} \ge R_{\rm kern} \) is outside the compact support, where f is 0.

x * x + z * z is computed as fma(z, z, x * x) and step is factored out of the sum, so the operations are reordered with respect to the plain Riemann sum: both match up to a few ulp per term, not bitwise. The runtime np overload below still computes the plain Riemann sum.

Definition at line 2364 of file sphkernels.hpp.

◆ f3d_integ_z() [2/2]

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::f3d_integ_z ( Tscal x,
int np = 32 )
inlinestatic

Definition at line 2378 of file sphkernels.hpp.

◆ phi_3D()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::phi_3D ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2415 of file sphkernels.hpp.

◆ phi_3D_prime()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::phi_3D_prime ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2419 of file sphkernels.hpp.

◆ phi_tilde_3d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::phi_tilde_3d ( Tscal q)
inlinestatic

Definition at line 2396 of file sphkernels.hpp.

◆ phi_tilde_3d_prime()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::phi_tilde_3d_prime ( Tscal q)
inlinestatic

Definition at line 2407 of file sphkernels.hpp.

◆ W_1d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::W_1d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2315 of file sphkernels.hpp.

◆ W_2d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::W_2d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2317 of file sphkernels.hpp.

◆ W_3d()

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::W_3d ( Tscal r,
Tscal h )
inlinestatic

compute the normed & resized version of the kernel :

\[ W(r,h) = C_{\rm norm} \frac{1}{h^3} f(\frac{r}{h}) \]

Parameters
r
h
Returns
Tscal

Definition at line 2330 of file sphkernels.hpp.

◆ Y_3d() [1/2]

template<class Tscal_, class BaseKernel>
template<int np>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::Y_3d ( Tscal r,
Tscal h )
inlinestatic

Definition at line 2389 of file sphkernels.hpp.

◆ Y_3d() [2/2]

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::Y_3d ( Tscal r,
Tscal h,
int np )
inlinestatic

Definition at line 2384 of file sphkernels.hpp.

Member Data Documentation

◆ has_3d_phi_soft

template<class Tscal_, class BaseKernel>
bool shammath::SPHKernelGen< Tscal_, BaseKernel >::has_3d_phi_soft = ::shammath::has_phi_tilde_3d<BaseKernel, Tscal>::value
staticconstexpr

Definition at line 2393 of file sphkernels.hpp.

◆ has_3d_phi_soft_prime

template<class Tscal_, class BaseKernel>
bool shammath::SPHKernelGen< Tscal_, BaseKernel >::has_3d_phi_soft_prime = ::shammath::has_phi_tilde_3d_prime<BaseKernel, Tscal>::value
staticconstexpr

Definition at line 2404 of file sphkernels.hpp.

◆ hfactd

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::hfactd = BaseKernel::hfactd
inlinestaticconstexpr

default $h_{\rm fact}$ for this kernel

Definition at line 2292 of file sphkernels.hpp.

◆ Rkern

template<class Tscal_, class BaseKernel>
Tscal shammath::SPHKernelGen< Tscal_, BaseKernel >::Rkern = BaseKernel::Rkern
inlinestaticconstexpr

Radius of the support

Definition at line 2291 of file sphkernels.hpp.


The documentation for this class was generated from the following file: