SPHStdKernel3.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: SPHStdKernel3.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Standard 3-D SPH kernel function object.
6 > Created Time: 2017/05/30
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 
10 // Adopted from the sample code of:
11 // Bart Adams and Martin Wicke,
12 // "Meshless Approximation Methods and Applications in Physics Based Modeling
13 // and Animation", Eurographics 2009 Tutorial
14 
15 #ifndef CUBBYFLOW_SPH_STD_KERNEL3_H
16 #define CUBBYFLOW_SPH_STD_KERNEL3_H
17 
18 #include <Core/Vector/Vector3.h>
19 
20 namespace CubbyFlow
21 {
31  {
33  double h;
34 
36  double h2;
37 
39  double h3;
40 
42  double h5;
43 
45  SPHStdKernel3();
46 
48  explicit SPHStdKernel3(double kernelRadius);
49 
51  SPHStdKernel3(const SPHStdKernel3& other);
52 
54  double operator()(double distance) const;
55 
57  double FirstDerivative(double distance) const;
58 
60  Vector3D Gradient(const Vector3D& point) const;
61 
63  Vector3D Gradient(double distance, const Vector3D& direction) const;
64 
66  double SecondDerivative(double distance) const;
67  };
68 
78  {
80  double h;
81 
83  double h2;
84 
86  double h3;
87 
89  double h4;
90 
92  double h5;
93 
96 
98  explicit SPHSpikyKernel3(double kernelRadius);
99 
101  SPHSpikyKernel3(const SPHSpikyKernel3& other);
102 
104  double operator()(double distance) const;
105 
107  double FirstDerivative(double distance) const;
108 
110  Vector3D Gradient(const Vector3D& point) const;
111 
113  Vector3D Gradient(double distance, const Vector3D& direction) const;
114 
116  double SecondDerivative(double distance) const;
117  };
118 }
119 
120 #endif
3-D vector class.
Definition: Vector3.h:26
double operator()(double distance) const
Returns kernel function value at given distance.
double h2
Square of the kernel radius.
Definition: SPHStdKernel3.h:36
double h
Kernel radius.
Definition: SPHStdKernel3.h:80
Standard 3-D SPH kernel function object.
Definition: SPHStdKernel3.h:30
double h5
Fifth-power of the kernel radius.
Definition: SPHStdKernel3.h:42
double h3
Cubic of the kernel radius.
Definition: SPHStdKernel3.h:39
Spiky 3-D SPH kernel function object.
Definition: SPHStdKernel3.h:77
double h4
Fourth-power of the kernel radius.
Definition: SPHStdKernel3.h:89
double h
Kernel radius.
Definition: SPHStdKernel3.h:33
double FirstDerivative(double distance) const
Returns the first derivative at given distance.
double h5
Fifth-power of the kernel radius.
Definition: SPHStdKernel3.h:92
Definition: pybind11Utils.h:24
double h2
Square of the kernel radius.
Definition: SPHStdKernel3.h:83
Vector3D Gradient(const Vector3D &point) const
Returns the gradient at a point.
Vector3D Gradient(const Vector3D &point) const
Returns the gradient at a point.
double FirstDerivative(double distance) const
Returns the first derivative at given distance.
double SecondDerivative(double distance) const
Returns the second derivative at given distance.
SPHStdKernel3()
Constructs a kernel object with zero radius.
double SecondDerivative(double distance) const
Returns the second derivative at given distance.
double h3
Cubic of the kernel radius.
Definition: SPHStdKernel3.h:86
double operator()(double distance) const
Returns kernel function value at given distance.
SPHSpikyKernel3()
Constructs a kernel object with zero radius.