SPH#
Pusher kernels#
- struphy.pic.pushing.pusher_kernels_sph.push_v_sph_pressure()#
Update each marker \(p\) according to
\[\frac{\mathbf v_p^{n+1} - \mathbf v_p^n}{\Delta t} = \mathbf g - \sum_{i=1}^N w_i \left( \frac{\kappa}{\rho^{N,h}(\boldsymbol \eta_p)} + \frac{\kappa}{\rho^{N,h}(\boldsymbol \eta_i)} \right) DF^{-\top}\nabla W_h(\boldsymbol \eta_p - \boldsymbol \eta_i) \,,\]where \(\mathbf g\) is a constant acceleration, the second term corresponds to the pressure gradient in the isothermal closure (with constant \(\kappa\)), and \(DF^{-\top}\) denotes the inverse transpose Jacobian arising in the pull back of the gradient of the smoothing kernel \(W_h\) chosen from
sph_smoothing_kernels.The smoothed SPH density is given by
\[\rho^{N,h}(\boldsymbol \eta_p) = \sum_j w_j \, W_h(\boldsymbol \eta_p - \boldsymbol \eta_j)\,.\]This kernel requires:
The density \(\rho^{N,h}(\boldsymbol \eta_p)\) to be pre-computed for each particle and stored at
markers[:, first_free_idx])The coefficient \(w_i/\rho^{N,h}(\boldsymbol \eta_i)\) to be pre-computed for each particle and stored at
markers[:, first_free_idx + 1])
This is accomplished by the kernel
sph_pressure_coeffs(), which needs to be passed as aninit_kernelto thePusher.- Parameters:
boxes (2d array) – Box array of the sorting boxes structure.
neighbours (2d array) – Array containing the 27 neighbouring boxes of each box.
holes (bool) – 1D array of length markers.shape[0]. True if markers[i] is a hole.
periodic1 (bool) – True if periodic in that dimension.
periodic2 (bool) – True if periodic in that dimension.
periodic3 (bool) – True if periodic in that dimension.
kernel_type (int) – Number of the smoothing kernel.
h1 (float) – Kernel width in respective dimension.
h2 (float) – Kernel width in respective dimension.
h3 (float) – Kernel width in respective dimension.
gravity (xp.ndarray) – Constant gravitational force as 3-vector.
kappa (float) – Constant isothermal coefficient.
- struphy.pic.pushing.pusher_kernels_sph.push_v_sph_pressure_ideal_gas()#
Update each marker \(p\) according to
\[\frac{\mathbf v_p^{n+1} - \mathbf v_p^n}{\Delta t} = \mathbf g - \sum_{i=1}^N w_i \left( \kappa (\rho^{N,h}(\boldsymbol \eta_p))^{\gamma - 2} + \kappa (\rho^{N,h}(\boldsymbol \eta_i))^{\gamma - 2} \right) DF^{-\top}\nabla W_h(\boldsymbol \eta_p - \boldsymbol \eta_i) \,,\]where \(\mathbf g\) is a constant acceleration, the second term corresponds to the pressure gradient in the polytropic closure (with constant \(\kappa\) and \(\gamma = 5/3\)), and \(DF^{-\top}\) denotes the inverse transpose Jacobian arising in the pull back of the gradient of the smoothing kernel \(W_h\) chosen from
sph_smoothing_kernels.The smoothed SPH density is given by
\[\rho^{N,h}(\boldsymbol \eta_p) = \sum_j w_j \, W_h(\boldsymbol \eta_p - \boldsymbol \eta_j)\,.\]This kernel requires:
The density \(\rho^{N,h}(\boldsymbol \eta_p)\) to be pre-computed for each particle and stored at
markers[:, first_free_idx])The coefficient \(w_i (\rho^{N,h}(\boldsymbol \eta_i))^{\gamma - 2}\) to be pre-computed for each particle and stored at
markers[:, first_free_idx + 2])
This is accomplished by the kernel
sph_pressure_coeffs(), which needs to be passed as aninit_kernelto thePusher.- Parameters:
boxes (2d array) – Box array of the sorting boxes structure.
neighbours (2d array) – Array containing the 27 neighbouring boxes of each box.
holes (bool) – 1D array of length markers.shape[0]. True if markers[i] is a hole.
periodic1 (bool) – True if periodic in that dimension.
periodic2 (bool) – True if periodic in that dimension.
periodic3 (bool) – True if periodic in that dimension.
kernel_type (int) – Number of the smoothing kernel.
h1 (float) – Kernel width in respective dimension.
h2 (float) – Kernel width in respective dimension.
h3 (float) – Kernel width in respective dimension.
gravity (xp.ndarray) – Constant gravitational force as 3-vector.
kappa (float) – Polytropic coefficient in the ideal gas closure.
- struphy.pic.pushing.pusher_kernels_sph.push_v_viscosity()#
Update each marker \(p\) according to
\[\frac{v_{p,j}^{n+1} - v_{p,j}^n}{\Delta t} = \sum_{i=1}^N \frac{w_i \, \sigma_{jk}(\boldsymbol \eta_i)}{\rho^{N,h}(\boldsymbol \eta_i)} \, \bigl(DF^{-\top} \nabla W_h\bigr)_k(\boldsymbol \eta_p - \boldsymbol \eta_i)\,,\]where \(\sigma_{jk} = \mu \left[(\partial_k v_j^{N,h} + \partial_j v_k^{N,h}) - \tfrac{2}{3}\delta_{jk}\partial_l v_l^{N,h}\right]\) is the deviatoric strain rate, and \(DF^{-\top}\) denotes the inverse transpose Jacobian arising in the pull back of the gradient of the smoothing kernel \(W_h\) chosen from
sph_smoothing_kernels.This kernel requires the 9 coefficients
\(w_i \, \sigma_{jk}(\boldsymbol \eta_i) / \rho^{N,h}(\boldsymbol \eta_i)\) to be pre-computed for each particle and stored at
markers[:, first_free_idx + 3*(j+1) + k]for \(j, k = 0, 1, 2\)
This is accomplished by the kernel
sph_viscosity_tensor(), which itself requires the mean velocity coefficients \(w_i v_{k,i} / \rho^{N,h}(\boldsymbol \eta_i)\) to be stored atmarkers[:, first_free_idx:first_free_idx + 3]viasph_mean_velocity_coeffs(). Both kernels must be passed asinit_kernelentries to thePusher.- Parameters:
boxes (2d array) – Box array of the sorting boxes structure.
neighbours (2d array) – Array containing the 27 neighbouring boxes of each box.
holes (bool) – 1D array of length markers.shape[0]. True if markers[i] is a hole.
periodic1 (bool) – True if periodic in that dimension.
periodic2 (bool) – True if periodic in that dimension.
periodic3 (bool) – True if periodic in that dimension.
kernel_type (int) – Number of the smoothing kernel.
h1 (float) – Kernel width in respective dimension.
h2 (float) – Kernel width in respective dimension.
h3 (float) – Kernel width in respective dimension.
Coefficient kernels#
- struphy.pic.pushing.eval_kernels_sph.sph_isotherm_kappa()#
None yet.
- struphy.pic.pushing.eval_kernels_sph.sph_mean_velocity_coeffs()#
For each particle, evaluate the smoothed SPH density \(\rho^{N,h}(\boldsymbol \eta_i)\) and store the coefficient
\(w_i v_{k,i} / \rho^{N,h}(\boldsymbol \eta_i)\) at
markers[:, column_nr + k]for \(k = 0, 1, 2\)
where the smoothed SPH density is given by
\[\rho^{N,h}(\boldsymbol \eta_i) = \sum_j w_j \, W_h(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]These coefficients serve as kernel weights so that one can evaluate the SPH mean velocity field
\[v_k^{N,h}(\boldsymbol \eta_i) = \sum_j \frac{w_j \, v_{k,j}}{\rho^{N,h}(\boldsymbol \eta_j)} \, W_h(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]
- struphy.pic.pushing.eval_kernels_sph.sph_pressure_coeffs()#
For each particle, evaluate
the density \(\rho^{N,h}(\boldsymbol \eta_i)\) abd stored it at
markers[:, column_nr])the coefficient \(w_i/\rho^{N,h}(\boldsymbol \eta_i)\) and stored it at
markers[:, column_nr + 1])the coefficient \(w_i (\rho^{N,h}(\boldsymbol \eta_i))^{\gamma - 2}\) and stored it at
markers[:, column_nr + 2])
where the smoothed SPH density is given by
\[\rho^{N,h}(\boldsymbol \eta_i) = \sum_j w_j \, W_h(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]
- struphy.pic.pushing.eval_kernels_sph.sph_viscosity_tensor()#
For each particle, evaluate the smoothed SPH density \(\rho^{N,h}(\boldsymbol \eta_i)\) and the deviatoric strain rate, and store the 9 coefficients
\(- w_i \, \sigma_{jk}(\boldsymbol \eta_i) / \rho^{N,h}(\boldsymbol \eta_i)\) at
markers[:, column_nr + 3*j + k]for \(j, k = 0, 1, 2\)
where the smoothed SPH density is given by
\[\rho^{N,h}(\boldsymbol \eta_i) = \sum_l w_l \, W_h(\boldsymbol \eta_i - \boldsymbol \eta_l)\,,\]and the deviatoric strain rate is the traceless symmetric part of the mean velocity gradient,
\[\sigma_{jk}(\boldsymbol \eta_i) = \mu\bigl[ \partial_j v_k^{N,h}(\boldsymbol \eta_i) + \partial_k v_j^{N,h}(\boldsymbol \eta_i) - \tfrac{2}{3}\delta_{jk}\bigr] \, \partial_l v_l^{N,h}(\boldsymbol \eta_i)\,.\]These coefficients serve as kernel weights so that one can evaluate the viscous force
\[(-\nabla \cdot \Pi_{\textrm{vis}})^{N,h}_j(\boldsymbol \eta_i) = \sum_l \frac{ w_l \, \sigma_{jk}(\boldsymbol \eta_l)}{\rho^{N,h}(\boldsymbol \eta_l)} \, (\nabla W_h)_k(\boldsymbol \eta_i - \boldsymbol \eta_l)\,.\]This kernel requires the coefficients of the mean velocity \(v_k^{N,h}\) for each particle to be pre-evaluated and stored at
markers[:, first_free_idx:first_free_idx + 3], which can be achieved by the kernelsph_mean_velocity_coeffs().
Evaluation kernels#
- struphy.pic.sph_eval_kernels.box_based_evaluation_flat()#
Box-based SPH evaluation on a flat array of points, see
box_based_kernel().- Parameters:
args_markers (MarkerArguments) – Container holding the markers array and the total number of particles
Np.eta1 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).eta2 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).eta3 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).n1 (int) – Number of sorting boxes in each dimension.
n2 (int) – Number of sorting boxes in each dimension.
n3 (int) – Number of sorting boxes in each dimension.
domain_array (float[:]) – Flat description of the local MPI sub-domain, used by
find_box()to locate boxes.boxes (int[:,:]) – Box array of the sorting-box structure (particles sorted into boxes).
neighbours (int[:,:]) –
neighbours[b, :]lists the 27 box indices neighbouring boxb.holes (bool[:]) – 1D array of length
markers.shape[0].Trueif particleiis a hole (inactive).periodic1 (bool) –
Trueif the domain is periodic in that dimension.periodic2 (bool) –
Trueif the domain is periodic in that dimension.periodic3 (bool) –
Trueif the domain is periodic in that dimension.index (int) – Column index in the markers array of the coefficient \(\beta_k\) multiplying the kernel.
kernel_type (int) – Integer identifier of the smoothing kernel. See Smoothing kernels.
h1 (float) – Kernel width in the respective dimension.
h2 (float) – Kernel width in the respective dimension.
h3 (float) – Kernel width in the respective dimension.
out (float[:]) – Output array of the same length as
eta1. Modified in place. Points outside the local domain are left at zero.
- struphy.pic.sph_eval_kernels.box_based_evaluation_meshgrid()#
Box-based SPH evaluation on a 3-D meshgrid of points, see
box_based_kernel().- Parameters:
args_markers (MarkerArguments) – Container holding the markers array and the total number of particles
Np.eta1 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
eta2 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
eta3 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
n1 (int) – Number of sorting boxes in each dimension.
n2 (int) – Number of sorting boxes in each dimension.
n3 (int) – Number of sorting boxes in each dimension.
domain_array (float[:]) – Flat description of the local MPI sub-domain, used by
find_box()to locate boxes.boxes (int[:,:]) – Box array of the sorting-box structure (particles sorted into boxes).
neighbours (int[:,:]) –
neighbours[b, :]lists the 27 box indices neighbouring boxb.holes (bool[:]) – 1D array of length
markers.shape[0].Trueif particleiis a hole (inactive).periodic1 (bool) –
Trueif the domain is periodic in that dimension.periodic2 (bool) –
Trueif the domain is periodic in that dimension.periodic3 (bool) –
Trueif the domain is periodic in that dimension.index (int) – Column index in the markers array of the coefficient \(\beta_k\) multiplying the kernel.
kernel_type (int) – Integer identifier of the smoothing kernel. See Smoothing kernels.
h1 (float) – Kernel width in the respective dimension.
h2 (float) – Kernel width in the respective dimension.
h3 (float) – Kernel width in the respective dimension.
out (float[:,:,:]) – Output array of the same shape as
eta1. Modified in place. Points outside the local domain are left at zero.
- struphy.pic.sph_eval_kernels.box_based_kernel()#
Perform a single-point SPH evaluation of a function \(\rho: [0, 1]^3 \to \mathbb R\) in the following sense:
\[\rho(\boldsymbol \eta_i) = \sum_{j=0}^{N-1} \rho_j\, W_h(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]The coefficients \(\rho_j\) must be available in the marker array, stored at some index
self.markers[j, index]. In case that derivative=k where k is not zero, the k-th component of the gradient of \(\rho\) is computed:\[\textrm{derivative}=k:\qquad [\nabla \rho(\boldsymbol \eta_i)]_k = \sum_{j=0}^{N-1} \rho_j \frac{\partial W_h}{\partial \eta_k}(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]The possible choices for \(W_h\) are listed in Smoothing kernels and in
ker_dct().The sum is restricted to the 27 neighbouring boxes of the box containing \(\boldsymbol\eta_i\), making the cost \(\mathcal{O}(1)\) in the number of particles when the kernel support is proportional to the box size.
- Parameters:
eta1 (float) – Evaluation point in logical space.
eta2 (float) – Evaluation point in logical space.
eta3 (float) – Evaluation point in logical space.
loc_box (int) – Box of the evaluation point.
boxes (2d array) – Box array of the sorting boxes structure.
neighbours (2d array) – Array containing the 27 neighbouring boxes of each box.
markers (array[float]) – Markers array.
Np (int) – Total number of particles.
holes (bool) – 1D array of length markers.shape[0]. True if markers[i] is a hole.
periodic1 (bool) – True if periodic in that dimension.
periodic2 (bool) – True if periodic in that dimension.
periodic3 (bool) – True if periodic in that dimension.
index (int) – Column index in markers array where the value multiplying the kernel in the evaluation is stored.
kernel_type (int) – Number of the smoothing kernel.
h1 (float) – Kernel width in respective dimension.
h2 (float) – Kernel width in respective dimension.
h3 (float) – Kernel width in respective dimension.
- struphy.pic.sph_eval_kernels.distance()#
Return the signed one-dimensional distance
x - y, adjusted for periodicity on[0, 1].- Parameters:
x (float) – Two coordinates on the domain.
y (float) – Two coordinates on the domain.
periodic (bool) – If
True, the result is folded into \((-\tfrac{1}{2}, \tfrac{1}{2}]\) so that the shortest path across the periodic boundary is returned.
- Returns:
Signed distance
x - y, adjusted for periodicity.- Return type:
float
- struphy.pic.sph_eval_kernels.naive_evaluation_flat()#
Naive SPH evaluation on a flat array of points, see
naive_evaluation_kernel().- Parameters:
args_markers (MarkerArguments) – Container holding the markers array and the total number of particles
Np.eta1 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).eta2 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).eta3 (float[:]) – Evaluation points in logical space. The \(i\)-th point is
(eta1[i], eta2[i], eta3[i]).holes (bool[:]) – 1D array of length
markers.shape[0].Trueif particleiis a hole (inactive).periodic1 (bool) –
Trueif the domain is periodic in that dimension.periodic2 (bool) –
Trueif the domain is periodic in that dimension.periodic3 (bool) –
Trueif the domain is periodic in that dimension.index (int) – Column index in the markers array of the coefficient \(\beta_k\) multiplying the kernel.
kernel_type (int) – Integer identifier of the smoothing kernel. See Smoothing kernels.
h1 (float) – Kernel width in the respective dimension.
h2 (float) – Kernel width in the respective dimension.
h3 (float) – Kernel width in the respective dimension.
out (float[:]) – Output array of the same length as
eta1. Modified in place and also returned.
- struphy.pic.sph_eval_kernels.naive_evaluation_kernel()#
Perform a single-point SPH evaluation of a function \(\rho: [0, 1]^3 \to \mathbb R\) in the following sense:
\[\rho(\boldsymbol \eta_i) = \sum_{j=0}^{N-1} \rho_j\, W_h(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]The coefficients \(\rho_j\) must be available in the marker array, stored at some index
self.markers[j, index]. In case that derivative=k where k is not zero, the k-th component of the gradient of \(\rho\) is computed:\[\textrm{derivative}=k:\qquad [\nabla \rho(\boldsymbol \eta_i)]_k = \sum_{j=0}^{N-1} \rho_j \frac{\partial W_h}{\partial \eta_k}(\boldsymbol \eta_i - \boldsymbol \eta_j)\,.\]The possible choices for \(W_h\) are listed in Smoothing kernels and in
ker_dct().ATTENTION: The sum is done over all particles in the markers array (ignoring holes), no neighbour search is performed. Hence, the cost of this evaluation is \(\mathcal{O}(N)\) in the number of particles, and it should only be used for testing and verification purposes.
- Parameters:
args_markers (MarkerArguments) – Container holding the markers array and the total number of particles
Np.eta1 (float) – Evaluation point in logical space.
eta2 (float) – Evaluation point in logical space.
eta3 (float) – Evaluation point in logical space.
holes (bool[:]) – 1D array of length
markers.shape[0].Trueif particleiis a hole (inactive).periodic1 (bool) –
Trueif the domain is periodic in that dimension.periodic2 (bool) –
Trueif the domain is periodic in that dimension.periodic3 (bool) –
Trueif the domain is periodic in that dimension.index (int) – Column index in the markers array of the coefficient \(\beta_k\) multiplying the kernel.
kernel_type (int) – Integer identifier of the smoothing kernel. See Smoothing kernels.
h1 (float) – Kernel width in the respective dimension.
h2 (float) – Kernel width in the respective dimension.
h3 (float) – Kernel width in the respective dimension.
- Returns:
SPH estimate of \(b\) at the evaluation point.
- Return type:
float
- struphy.pic.sph_eval_kernels.naive_evaluation_meshgrid()#
Naive SPH evaluation on a 3-D meshgrid of points, see
naive_evaluation_kernel().- Parameters:
args_markers (MarkerArguments) – Container holding the markers array and the total number of particles
Np.eta1 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
eta2 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
eta3 (float[:,:,:]) – Evaluation points in logical space on a 3-D meshgrid.
holes (bool[:]) – 1D array of length
markers.shape[0].Trueif particleiis a hole (inactive).periodic1 (bool) –
Trueif the domain is periodic in that dimension.periodic2 (bool) –
Trueif the domain is periodic in that dimension.periodic3 (bool) –
Trueif the domain is periodic in that dimension.index (int) – Column index in the markers array of the coefficient \(\beta_k\) multiplying the kernel.
kernel_type (int) – Integer identifier of the smoothing kernel. See Smoothing kernels.
h1 (float) – Kernel width in the respective dimension.
h2 (float) – Kernel width in the respective dimension.
h3 (float) – Kernel width in the respective dimension.
out (float[:,:,:]) – Output array of the same shape as
eta1. Modified in place.
Smoothing kernels#
- struphy.pic.sph_smoothing_kernels.gaussian_1d()#
1d kernel S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.gaussian_2d()#
Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.gaussian_3d()#
Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.gaussian_uni()#
Uni-variate S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_1d()#
Derivative of S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_2d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_2d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_3d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_3d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_3d_3()#
3rd component of gradient of Tensor product of kernels S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_gaussian_uni()#
Derivative of S(x, h) = 1/(sqrt(pi)*h/3) * exp(-(x**2/(h/3)**2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_1d()#
Derivative of S(x, h) = (1 - x)/h if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_2d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_2d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_3d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_3d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_3d_3()#
3rd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_linear_isotropic_3d_1()#
1st component of gradient of S(r,h) = C(h)F(r/h) with F(x) = 1-x if x<1, 0 else, and C(h)=3/(pi*h^3) is a normalization coefficient so the the kernel has unit integral.
- struphy.pic.sph_smoothing_kernels.grad_linear_isotropic_3d_2()#
1st component of gradient of S(r,h) = C(h)F(r/h) with F(x) = 1-x if x<1, 0 else, and C(h)=3/(pi*h^3) is a normalization coefficient so the the kernel has unit integral.
- struphy.pic.sph_smoothing_kernels.grad_linear_isotropic_3d_3()#
1st component of gradient of S(r,h) = C(h)F(r/h) with F(x) = 1-x if x<1, 0 else, and C(h)=3/(pi*h^3) is a normalization coefficient so the the kernel has unit integral.
- struphy.pic.sph_smoothing_kernels.grad_linear_uni()#
Derivative of S(x, h) = (1 - x)/h if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_1d()#
Derivative of S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_2d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_2d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_3d_1()#
1st component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_3d_2()#
2nd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_3d_3()#
3rd component of gradient of Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.grad_trigonometric_uni()#
Derivative of S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.linear_2d()#
Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.linear_3d()#
Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.linear_isotropic_3d()#
Smoothing kernel S(r,h) = C(h)F(r/h) with F(x) = 1-x if x<1, 0 else, and C(h)=3/(pi*h^3) is a normalization coefficient so the the kernel has unit integral.
- struphy.pic.sph_smoothing_kernels.smoothing_kernel()#
Each smoothing kernel is normalized to 1.
The kernel type numbers must have 3 digits, where the last digit is reserved for the gradient; if a kernel has the type number n, the i-th components of its gradient has the number n + i. This means we have space for 99 kernels (and its gradient components) in principle.
1d kernels <= 330
2d kernels <= 660
3d kernels >= 670
If you add a kernel, make sure it is also added to
ker_dct().
- struphy.pic.sph_smoothing_kernels.trigonometric_1d()#
1d kernel S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.
- struphy.pic.sph_smoothing_kernels.trigonometric_2d()#
Tensor product of kernels S(x, h) = pi/4/h * cos(x*pi/2) if |x|<1, 0 else.