API Reference

Exported Types

SPHKernels.CubicType
Cubic(T::DataType=Float64, dim::Integer=3)

Set up a Cubic kernel for a given DataType T and dimensin dim.

source
SPHKernels.CubicMethod
Cubic(dim::Integer)

Define Cubic kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.DoubleCosineMethod
DoubleCosine(dim::Integer)

Define DoubleCosine kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.QuinticType
Quintic(T::DataType=Float64, dim::Integer=3)

Set up a Quintic kernel for a given DataType T.

source
SPHKernels.QuinticMethod
Quintic(dim::Integer)

Define Quintic kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.TophatType
Tophat(dim::Integer)

Define Tophat kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.WendlandC2Method
WendlandC2(dim::Integer)

Define WendlandC2 kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.WendlandC4Method
WendlandC4(dim::Integer)

Define WendlandC4 kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.WendlandC6Method
WendlandC6(dim::Integer)

Define WendlandC6 kernel with dimension dim for the native DataType of the OS.

source
SPHKernels.WendlandC8Method
WendlandC8(dim::Integer)

Define WendlandC8 kernel with dimension dim for the native DataType of the OS.

source

Exported Functions

SPHKernels.bias_correctionMethod
bias_correction( kernel::Cubic{T}, 
                 density::Real, m::Real, h_inv::Real, 
                 n_neighbours::Integer )  where T

Does not do anything for the BSplines. Implemented for stability.

source
SPHKernels.bias_correctionMethod
bias_correction( kernel::DoubleCosine{T}, 
                 density::Real, m::Real, h_inv::Real, 
                 n_neighbours::Integer )  where T

Does not do anything for the DoubleCosine. Implemented for stability.

source
SPHKernels.bias_correctionMethod
bias_correction( kernel::Quintic{T}, 
                 density::Real, m::Real, h_inv::Real, 
                 n_neighbours::Integer ) where T

Does not do anything for the BSplines. Implemented for stability.

source
SPHKernels.bias_correctionMethod
bias_correction(kernel::Tophat{T},
                density::Real, m::Real, h_inv::Real,
                n_neighbours::Integer) where {T}

Corrects the density estimate for the kernel bias. Not implemented for Tophat.

source
SPHKernels.bias_correctionMethod
bias_correction( kernel::Union{WendlandC2_1D{T}, WendlandC2{T}}, 
                 density::Real, m::Real, h_inv::Real,
                 n_neighbours::Integer ) where T

Corrects the density estimate for the kernel bias. See Dehnen&Aly 2012, eq. 18+19.

source
SPHKernels.bias_correctionMethod
bias_correction( kernel::Union{WendlandC4_1D{T}, WendlandC4{T}}, 
                 density::Real, m::Real, h_inv::Real, 
                 n_neighbours::Int64 ) where T

Corrects the density estimate for the kernel bias. See Dehnen&Aly 2012, eq. 18+19.

source
SPHKernels.bias_correctionMethod
bias_correction( kernel::Union{WendlandC6_1D{T}, WendlandC6{T}}, 
                 density::Real, m::Real, h_inv::Real, 
                 n_neighbours::Integer ) where T

Corrects the density estimate for the kernel bias. See Dehnen&Aly 2012, eq. 18+19.

source
SPHKernels.bias_correctionMethod
bias_correction(kernel::WendlandC8, density::Real, m::Real, h_inv::Real)

Corrects the density estimate for the kernel bias. See Dehnen&Aly 2012, eq. 18+19.

source
SPHKernels.d𝒩Method
d𝒩(kernel::AbstractSPHKernel, h_inv::Real)

Calculate the normalisation factor for the kernel derivative.

source
SPHKernels.d𝒲Method
d𝒲(kernel::AbstractSPHKernel, u::Real, h_inv::Real)

Evaluate derivative at position $u = \frac{x}{h}$.

source
SPHKernels.d𝒲Method
d𝒲(kernel::AbstractSPHKernel, u::Real)

Evaluate derivative at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_curlMethod
kernel_curl(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2) where {T1,T2}

Compute the kernel curl ∇x𝒲 between particle i and neighbour j for some SPH quantity A.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::AbstractSPHKernel, u::Real, h_inv::Real) where T

Evaluate the derivative of the kernel at position $u = \frac{x}{h}$.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::Cubic{T}, u::Real) where T

Evaluate the derivative of the Cubic spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::DoubleCosine, u::Real)

Evaluate the derivative of the DoubleCosine spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::Quintic{T}, u::Real) where T

Evaluate the derivative of the Quintic spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv_1D(kernel::WendlandC2{T}, u::Real) where T

Evaluate the derivative of the WendlandC2 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC4_1D{T}, u::Real) where T

Evaluate the derivative of the WendlandC4 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC6_1D{T}, u::Real) where T

Evaluate the derivative of the WendlandC6 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC8_1D{T}, u::Real, h_inv::Real) where T

Evaluate the derivative of the WendlandC8 spline at position $u = \frac{x}{h}$.

source
SPHKernels.kernel_derivMethod
kernel_deriv_1D(kernel::Tophat{T}, u::Real) where T

Evaluate the derivative of the Tophat spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC2{T}, u::Real) where T

Evaluate the derivative of the WendlandC2 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC4{T}, u::Real) where T

Evaluate the derivative of the WendlandC4 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv(kernel::WendlandC6, u::Real)

Evaluate the derivative of the WendlandC6 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_derivMethod
kernel_deriv_2D(kernel::WendlandC8{T}, u::Real) where T

Evaluate the derivative of the WendlandC8 spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_divMethod
kernel_div( k::AbstractSPHKernel, h_inv::T1, 
            xᵢ::T2, xⱼ::T2, Aⱼ::T2) where {T1,T2}

Compute the kernel divergence ∇⋅𝒲 between particle i and neighbour j for some SPH quantity A.

source
SPHKernels.kernel_gradientMethod
kernel_gradient( k::AbstractSPHKernel, r::T1, h_inv::T1, Δx::T2) where {T1,T2}

Computes the gradient of the kernel k at the distance r along the distance vector Δx of the neighbour j.

$∇W(x_{ij}, h_i) = \frac{dW}{dx}\vert_{x_j} \frac{Δx_{ij}}{||x_{ij}||} \frac{1}{h_i}$

source
SPHKernels.kernel_gradientMethod
kernel_gradient( k::AbstractSPHKernel, h_inv::Real, xᵢ::T, xⱼ::T ) where T

Computes the gradient of the kernel k at the position of the neighbour xⱼ.

$∇W(x_{ij}, h_i) = \frac{dW}{dx}\vert_{x_j} \frac{Δx_{ij}}{||x_{ij}||} \frac{1}{h_i}$

source
SPHKernels.kernel_normMethod
kernel_norm(kernel::AbstractSPHKernel, h_inv::Real) where {T}

Calculate the normalisation factor for the kernel.

source
SPHKernels.kernel_normMethod
kernel_norm(kernel::WendlandKernel, h_inv::Real) where {T}

Calculate the normalisation factor for the WendlandC2 kernel.

source
SPHKernels.kernel_normMethod
kernel_norm(kernel::Tophat, h_inv::Real) where {T}

Calculate the normalisation factor for the Tophat kernel.

source
SPHKernels.kernel_normMethod
kernel_norm(kernel::WendlandC2_1D{T}, h_inv::Real) where {T}

Calculate the normalisation factor for the WendlandC2 kernel.

source
SPHKernels.kernel_quantityMethod
kernel_quantity(k::AbstractSPHKernel, r::T1, h_inv::T1, 
                Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the SPH quantity A for particle i. Based on Euclidean distance r between the particles. Useful if many quantities need to be computed for the same particle pair.

$\vec{A}_i(x) ≈ \sum_j m_j \frac{\vec{A}_j}{\rho_j} W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.kernel_quantityMethod
kernel_quantity(k::AbstractSPHKernel, h_inv::T1, 
                xᵢ::T2, xⱼ::T2, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the SPH quantity A for particle i. Based on positions xᵢ and xⱼ.

$\vec{A}_i(x) ≈ \sum_j m_j \frac{\vec{A}_j}{\rho_j} W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.kernel_valueMethod
kernel_value( k::AbstractSPHKernel, h_inv::Real, 
              xᵢ::Real, xⱼ::Real )

Computes the value of the kernel k at the position of the neighbour xⱼ.

$W(x_i - x_j, h_i)$

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::AbstractSPHKernel, u::Real, h_inv::Real) where T

Evaluate the kernel at position $u = \frac{x}{h}$.

source
SPHKernels.kernel_valueMethod
kernel_value( k::AbstractSPHKernel, h_inv::T1, 
                   xᵢ::T2, xⱼ::T2 ) where {T1,T2}

Computes the value of the kernel k at the position of the neighbour xⱼ.

$W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.kernel_valueMethod
kernel_value_1D(kernel::Cubic{T}, u::Real) where T

Evaluate cubic spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::DoubleCosine, u::Real)

Evaluate DoubleCosine spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::Quintic{T}, u::Real) where T

Evaluate quintic spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC2_1D{T}, u::Real) where T

Evaluate WendlandC2 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC4{T}, u::Real) where T

Evaluate WendlandC4 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC6_1D{T}, u::Real, h_inv::Real) where T

Evaluate WendlandC6 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC8_1D{T}, u::Real) where T

Evaluate WendlandC8 spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::Tophat{T}, u::Real) where T

Evaluate Tophat spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC2{T}, u::Real, h_inv::Real) where T

Evaluate WendlandC2 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC4{T}, u::Real) where T

Evaluate WendlandC4 spline at position $u = \frac{x}{h}$ without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC6{T}, u::Real) where T

Evaluate WendlandC6 spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.kernel_valueMethod
kernel_value(kernel::WendlandC8{T}, u::Real) where T

Evaluate WendlandC8 spline at position $u = \frac{x}{h}$, without normalisation.

source
SPHKernels.quantity_curlMethod
quantity_curl(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the curl of the SPH quantity A for particle i.

$∇×\vec{A}_i(x) ≈ - \sum_j \frac{m_j}{\rho_j} \vec{A}_j \times ∇W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.quantity_divergenceMethod
quantity_divergence(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the divergence of the SPH quantity A for particle i.

$∇\cdot\vec{A}_i(x) ≈ \sum_j \frac{m_j}{\rho_j} \vec{A}_j \cdot ∇W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.quantity_gradientMethod
quantity_gradient(k::AbstractSPHKernel,
                  r::T1, h_inv::T1,
                  Δx::T2, Aⱼ::T2,
                  mⱼ::T1, ρⱼ::T1) where {T1<:Real,T2}

Compute the contribution of particle j to the gradient of the SPH quantity A for particle i. Based on Euclidean distance r and distance vector Δx between the particles. Useful if many quantities need to be computed for the same particle pair.

$∇\vec{A}_i(x) ≈ \sum_j \frac{m_j}{\rho_j} \vec{A}_j \: ∇W(||\vec{x}_i - \vec{x}_j||, h_i)$

source
SPHKernels.quantity_gradientMethod
quantity_gradient(k::AbstractSPHKernel, h_inv::T1, 
                  xᵢ::T2, xⱼ::T2, Aⱼ::T2,
                  mⱼ::T1, ρⱼ::T1 ) where {T1<:Real, T2}

Compute the contribution of particle j to the gradient of the SPH quantity A for particle i. Based on positions xᵢ and xⱼ.

$∇\vec{A}_i(x) ≈ \sum_j \frac{m_j}{\rho_j} \vec{A}_j \: ∇W(||\vec{x}_i - \vec{x}_j||, h_i)$

source
SPHKernels.δρMethod
δρ₁(kernel::AbstractSPHKernel, density::Real, m::Real, h_inv::Real)

Corrects the density estimate for the kernel bias. See Dehnen&Aly 2012, eq. 18+19.

source
SPHKernels.∇dot𝒜Method
∇dot𝒜(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the divergence of the SPH quantity A for particle i. Compact notation of quantity_divergence.

$∇\cdot\vec{A}_i(x) ≈ \sum_j \frac{m_j}{\rho_j} \vec{A}_j \cdot ∇W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.∇dot𝒲Method
∇dot𝒲( k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2) where {T1,T2}

Compute the kernel divergence ∇⋅𝒲 between particle i and neighbour j for some SPH quantity A. Compact notation of kernel_div.

source
SPHKernels.∇x𝒜Method
∇x𝒜(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the curl of the SPH quantity A for particle i.

$∇×\vec{A}_i(x) ≈ - \sum_j \frac{m_j}{\rho_j} \vec{A}_j \times ∇W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.∇x𝒲Method
∇x𝒲(k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2, Aⱼ::T2) where {T1,T2}

Compute the kernel curl ∇x𝒲 between particle i and neighbour j for some SPH quantity A.

source
SPHKernels.∇𝒜Method
∇𝒜( k::AbstractSPHKernel, h_inv, xᵢ, xⱼ, Aⱼ, mⱼ, ρⱼ)

Compute the contribution of particle j to the gradient of the SPH quantity A for particle i. Compact notation of quantity_gradient.

$∇\vec{A}_i(x) ≈ \sum_j \frac{m_j}{\rho_j} \vec{A}_j \: ∇W(||\vec{x}_i - \vec{x}_j||, h_i)$

source
SPHKernels.∇𝒲Method
∇𝒲( k::AbstractSPHKernel, h_inv::Real, xᵢ::Union{Real, Vector{<:Real}}, xⱼ::Union{Real, Vector{<:Real}} )

Computes the gradient of the kernel k at the position of the neighbour j. Based on Euclidean distance r and distance vector Δx between the particles. Useful if many quantities need to be computed for the same particle pair. Compact notation of kernel_gradient.

$∇W(x_{ij}, h_i) = \frac{dW}{dx}\vert_{x_j} \frac{Δx_{ij}}{||x_{ij}||} \frac{1}{h_i}$

source
SPHKernels.∇𝒲Method
∇𝒲( k::AbstractSPHKernel, h_inv::T1, xᵢ::T2, xⱼ::T2 ) where {T1<:Real,T2}

Computes the gradient of the kernel k at the position of the neighbour xⱼ. Compact notation of kernel_gradient.

$∇W(x_{ij}, h_i) = \frac{dW}{dx}\vert_{x_j} \frac{Δx_{ij}}{||x_{ij}||} \frac{1}{h_i}$

source
SPHKernels.𝒜Method
𝒜(k::AbstractSPHKernel, r::T1,  h_inv::T1, Aⱼ::T2, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the SPH quantity A for particle i. Based on Euclidean distance r between the particles. Useful if many quantities need to be computed for the same particle pair.

$\vec{A}_i(x) ≈ \sum_j m_j \frac{\vec{A}_j}{\rho_j} W(r, h_i)$

source
SPHKernels.𝒜Method
𝒜(k::AbstractSPHKernel, h_inv::T1, 
  xᵢ::Union{T1, T2}, xⱼ::Union{T1, T2},
  Aⱼ::Union{T1, T2}, mⱼ::T1, ρⱼ::T1 ) where {T1,T2}

Compute the contribution of particle j to the SPH quantity A for particle i. Based on positions xᵢ and xⱼ.

$\vec{A}_i(x) ≈ \sum_j m_j \frac{\vec{A}_j}{\rho_j} W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.𝒩Method
𝒩(kernel::AbstractSPHKernel, h_inv::Real)

Calculate the normalisation factor for the kernel.

source
SPHKernels.𝒲Method
𝒲( k::AbstractSPHKernel, h_inv, xᵢ, xⱼ)

Computes the value of the kernel k at the position of the neighbour xⱼ.

$W(\vec{x}_i - \vec{x}_j, h_i)$

source
SPHKernels.𝒲Method
𝒲( kernel::AbstractSPHKernel, u::Real, h_inv::Real)

Evaluate kernel at position $u = \frac{x}{h}$.

source
SPHKernels.𝒲Method
𝒲( kernel::AbstractSPHKernel, u::Real)

Evaluate kernel at position $u = \frac{x}{h}$, without normalisation.

source

Private Functions

SPHKernels.get_rMethod
get_r(xᵢ::Vector{<:Real}, xⱼ::Vector{<:Real})

Eukledian distance between xᵢ and xⱼ.

source

Private Types