SPHStdKernel2.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: SPHStdKernel2.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Standard 2-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_KERNEL2_H
16 #define CUBBYFLOW_SPH_STD_KERNEL2_H
17 
18 #include <Core/Vector/Vector2.h>
19 
20 namespace CubbyFlow
21 {
31  {
33  double h;
34 
36  double h2;
37 
39  double h3;
40 
42  double h4;
43 
45  SPHStdKernel2();
46 
48  explicit SPHStdKernel2(double kernelRadius);
49 
51  SPHStdKernel2(const SPHStdKernel2& other);
52 
54  double operator()(double distance) const;
55 
57  double FirstDerivative(double distance) const;
58 
60  Vector2D Gradient(const Vector2D& point) const;
61 
63  Vector2D Gradient(double distance, const Vector2D& 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 SPHSpikyKernel2(double kernelRadius);
99 
101  SPHSpikyKernel2(const SPHSpikyKernel2& other);
102 
104  double operator()(double distance) const;
105 
107  double FirstDerivative(double distance) const;
108 
110  Vector2D Gradient(const Vector2D& point) const;
111 
113  Vector2D Gradient(double distance, const Vector2D& direction) const;
114 
116  double SecondDerivative(double distance) const;
117  };
118 }
119 
120 #endif
double h
Kernel radius.
Definition: SPHStdKernel2.h:80
double operator()(double distance) const
Returns kernel function value at given distance.
double h4
Fourth-power of the kernel radius.
Definition: SPHStdKernel2.h:89
double h3
Cubic of the kernel radius.
Definition: SPHStdKernel2.h:86
double h4
Fourth-power of the kernel radius.
Definition: SPHStdKernel2.h:42
Vector2D Gradient(const Vector2D &point) const
Returns the gradient at a point.
Vector2D Gradient(const Vector2D &point) const
Returns the gradient at a point.
Spiky 2-D SPH kernel function object.
Definition: SPHStdKernel2.h:77
double FirstDerivative(double distance) const
Returns the first derivative at given distance.
Standard 2-D SPH kernel function object.
Definition: SPHStdKernel2.h:30
double h5
Fifth-power of the kernel radius.
Definition: SPHStdKernel2.h:92
double h
Kernel radius.
Definition: SPHStdKernel2.h:33
Definition: pybind11Utils.h:24
double h2
Square of the kernel radius.
Definition: SPHStdKernel2.h:36
double h3
Cubic of the kernel radius.
Definition: SPHStdKernel2.h:39
double FirstDerivative(double distance) const
Returns the first derivative at given distance.
double SecondDerivative(double distance) const
Returns the second derivative at given distance.
double h2
Square of the kernel radius.
Definition: SPHStdKernel2.h:83
SPHSpikyKernel2()
Constructs a kernel object with zero radius.
double operator()(double distance) const
Returns kernel function value at given distance.
2-D vector class.
Definition: Vector2.h:26
SPHStdKernel2()
Constructs a kernel object with zero radius.
double SecondDerivative(double distance) const
Returns the second derivative at given distance.