SPHinXsys  alpha version
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
SPH::Kernel Class Referenceabstract

Abstract base class of a general SPH kernel function which is a smoothed Dirac delta function, a kernel function is radial symmetric, and has a scaling factor. Based on difference data type in 2d or 3d buildings, the kernel is defined for 2 and 3 dimensions. The kernel gives value one at the origin. The naming of kernel function follows the stand SPH literature. Currently, only constant smoothing length is applied. Basically, one can assign different kernel for different particle interactions. More...

#include <base_kernel.h>

Inherited by SPH::KernelCubicBSpline, SPH::KernelHyperbolic, SPH::KernelLaguerreGauss, SPH::KernelQuadratic, SPH::KernelTabulated< KernelType >, and SPH::KernelWendlandC2.

Public Member Functions

 Kernel (Real h, const std::string &kernel_name="Kernel")
 
std::string Name () const
 
Real SmoothingLength () const
 
virtual Real KernelSize () const
 
Real CutOffRadius () const
 
Real FactorW1D () const
 
Real FactorW2D () const
 
Real FactorW3D () const
 
virtual Real W (const Real &r_ij, const Real &displacement) const
 
virtual Real W (const Real &r_ij, const Vec2d &displacement) const
 
virtual Real W (const Real &r_ij, const Vec3d &displacement) const
 
virtual Real W_1D (const Real q) const =0
 
virtual Real W_2D (const Real q) const =0
 
virtual Real W_3D (const Real q) const =0
 
virtual Real W0 (const Real &point_i) const
 
virtual Real W0 (const Vec2d &point_i) const
 
virtual Real W0 (const Vec3d &point_i) const
 
virtual Real dW (const Real &r_ij, const Real &displacement) const
 
virtual Real dW (const Real &r_ij, const Vec2d &displacement) const
 
virtual Real dW (const Real &r_ij, const Vec3d &displacement) const
 
virtual Real dW_1D (const Real q) const =0
 
virtual Real dW_2D (const Real q) const =0
 
virtual Real dW_3D (const Real q) const =0
 
virtual Real d2W (const Real &r_ij, const Real &displacement) const
 
virtual Real d2W (const Real &r_ij, const Vec2d &displacement) const
 
virtual Real d2W (const Real &r_ij, const Vec3d &displacement) const
 
virtual Real d2W_1D (const Real q) const =0
 
virtual Real d2W_2D (const Real q) const =0
 
virtual Real d2W_3D (const Real q) const =0
 
Real CutOffRadius (Real h_ratio) const
 
Real W (const Real &h_ratio, const Real &r_ij, const Real &displacement) const
 
Real W (const Real &h_ratio, const Real &r_ij, const Vec2d &displacement) const
 
Real W (const Real &h_ratio, const Real &r_ij, const Vec3d &displacement) const
 
Real W0 (const Real &h_ratio, const Real &point_i) const
 
Real W0 (const Real &h_ratio, const Vec2d &point_i) const
 
Real W0 (const Real &h_ratio, const Vec3d &point_i) const
 
Real dW (const Real &h_ratio, const Real &r_ij, const Real &displacement) const
 
Real dW (const Real &h_ratio, const Real &r_ij, const Vec2d &displacement) const
 
Real dW (const Real &h_ratio, const Real &r_ij, const Vec3d &displacement) const
 
Real d2W (const Real &h_ratio, const Real &r_ij, const Real &displacement) const
 
Real d2W (const Real &h_ratio, const Real &r_ij, const Vec2d &displacement) const
 
Real d2W (const Real &h_ratio, const Real &r_ij, const Vec3d &displacement) const
 
void reduceOnce ()
 
void reduceTwice ()
 

Protected Types

typedef std::function< Real(const Real &)> FactorFunctor
 

Protected Member Functions

void setDerivativeParameters ()
 
Real factorW1D (const Real &h_ratio) const
 
Real factorW2D (const Real &h_ratio) const
 
Real factorW3D (const Real &h_ratio) const
 
Real factordW1D (const Real &h_ratio) const
 
Real factordW2D (const Real &h_ratio) const
 
Real factordW3D (const Real &h_ratio) const
 
Real factord2W1D (const Real &h_ratio) const
 
Real factord2W2D (const Real &h_ratio) const
 
Real factord2W3D (const Real &h_ratio) const
 

Protected Attributes

const std::string kernel_name_
 
Real h_
 
Real inv_h_
 
Real cutoff_radius_ref_
 
Real factor_W_1D_
 
Real factor_W_2D_
 
Real factor_W_3D_
 
Real factor_dW_1D_
 
Real factor_dW_2D_
 
Real factor_dW_3D_
 
Real factor_d2W_1D_
 
Real factor_d2W_2D_
 
Real factor_d2W_3D_
 
FactorFunctor h_factor_W_1D_
 
FactorFunctor h_factor_W_2D_
 
FactorFunctor h_factor_W_3D_
 
FactorFunctor h_factor_dW_1D_
 
FactorFunctor h_factor_dW_2D_
 
FactorFunctor h_factor_dW_3D_
 
FactorFunctor h_factor_d2W_1D_
 
FactorFunctor h_factor_d2W_2D_
 
FactorFunctor h_factor_d2W_3D_
 

Detailed Description

Abstract base class of a general SPH kernel function which is a smoothed Dirac delta function, a kernel function is radial symmetric, and has a scaling factor. Based on difference data type in 2d or 3d buildings, the kernel is defined for 2 and 3 dimensions. The kernel gives value one at the origin. The naming of kernel function follows the stand SPH literature. Currently, only constant smoothing length is applied. Basically, one can assign different kernel for different particle interactions.

Kernel Laguerre Gauss.

Kernel Cubic B_Spline.

Member Typedef Documentation

◆ FactorFunctor

typedef std::function<Real(const Real&)> SPH::Kernel::FactorFunctor
protected

Functor for variable smoothing length.

Constructor & Destructor Documentation

◆ Kernel()

SPH::Kernel::Kernel ( Real  h,
const std::string &  kernel_name = "Kernel" 
)
explicit

empty initialization in constructor, initialization will be carried out later.

Member Function Documentation

◆ d2W() [1/2]

Real SPH::Kernel::d2W ( const Real &  r_ij,
const Real &  displacement 
) const
virtual

Calculates the kernel second order derivation for the given distance of two particles

◆ d2W() [2/2]

Real SPH::Kernel::d2W ( const Real &  h_ratio,
const Real &  r_ij,
const Real &  displacement 
) const

Calculates the kernel second order derivation for the given distance of two particles

◆ d2W_1D()

virtual Real SPH::Kernel::d2W_1D ( const Real  q) const
pure virtual

this value could be use to calculate the value of d2W they are realized in specific kernel implementations

Implemented in SPH::KernelCubicBSpline, SPH::KernelHyperbolic, SPH::KernelLaguerreGauss, SPH::KernelQuadratic, SPH::KernelWendlandC2, and SPH::KernelTabulated< KernelType >.

◆ dW() [1/2]

Real SPH::Kernel::dW ( const Real &  r_ij,
const Real &  displacement 
) const
virtual

Calculates the kernel derivation for the given distance of two particles

◆ dW() [2/2]

Real SPH::Kernel::dW ( const Real &  h_ratio,
const Real &  r_ij,
const Real &  displacement 
) const

Calculates the kernel derivation for the given distance of two particles

◆ dW_1D()

virtual Real SPH::Kernel::dW_1D ( const Real  q) const
pure virtual

this value could be use to calculate the value of dW they are realized in specific kernel implementations

Implemented in SPH::KernelCubicBSpline, SPH::KernelHyperbolic, SPH::KernelLaguerreGauss, SPH::KernelQuadratic, SPH::KernelWendlandC2, and SPH::KernelTabulated< KernelType >.

◆ KernelSize()

virtual Real SPH::Kernel::KernelSize ( ) const
inlinevirtual

non-dimensional size of the kernel, generally 2.0

Reimplemented in SPH::KernelTabulated< KernelType >.

◆ reduceTwice()

void SPH::Kernel::reduceTwice ( )

reduce for thin structures or films

◆ W()

Real SPH::Kernel::W ( const Real &  r_ij,
const Real &  displacement 
) const
virtual

Calculates the kernel value for the given displacement of two particles r_ij pointing from particle j to particle i

◆ W0() [1/2]

virtual Real SPH::Kernel::W0 ( const Real &  point_i) const
inlinevirtual

Calculates the kernel value at the origin

◆ W0() [2/2]

Real SPH::Kernel::W0 ( const Real &  h_ratio,
const Real &  point_i 
) const

Calculates the kernel value at the origin

◆ W_1D()

virtual Real SPH::Kernel::W_1D ( const Real  q) const
pure virtual

this value could be use to calculate the value of W they are realized in specific kernel implementations

Implemented in SPH::KernelCubicBSpline, SPH::KernelHyperbolic, SPH::KernelLaguerreGauss, SPH::KernelQuadratic, SPH::KernelWendlandC2, and SPH::KernelTabulated< KernelType >.

Member Data Documentation

◆ factor_d2W_1D_

Real SPH::Kernel::factor_d2W_1D_
protected

Auxiliary factors for the second order derivative of kernel function

◆ factor_dW_1D_

Real SPH::Kernel::factor_dW_1D_
protected

Auxiliary factors for the derivative of kernel function

◆ factor_W_1D_

Real SPH::Kernel::factor_W_1D_
protected

reference cut off radius Normalization factors for the kernel function

◆ inv_h_

Real SPH::Kernel::inv_h_
protected

reference smoothing length and its inverse


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