Jet  v1.3.3
sph_kernels3.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 //
7 // Adopted from the sample code of:
8 // Bart Adams and Martin Wicke,
9 // "Meshless Approximation Methods and Applications in Physics Based Modeling
10 // and Animation", Eurographics 2009 Tutorial
11 
12 #ifndef INCLUDE_JET_SPH_KERNELS3_H_
13 #define INCLUDE_JET_SPH_KERNELS3_H_
14 
15 #include <jet/constants.h>
16 #include <jet/vector3.h>
17 
18 namespace jet {
19 
28 struct SphStdKernel3 {
30  double h;
31 
33  double h2;
34 
36  double h3;
37 
39  double h5;
40 
43 
45  explicit SphStdKernel3(double kernelRadius);
46 
49 
51  double operator()(double distance) const;
52 
54  double firstDerivative(double distance) const;
55 
57  Vector3D gradient(const Vector3D& point) const;
58 
60  Vector3D gradient(double distance, const Vector3D& direction) const;
61 
63  double secondDerivative(double distance) const;
64 };
65 
76  double h;
77 
79  double h2;
80 
82  double h3;
83 
85  double h4;
86 
88  double h5;
89 
92 
94  explicit SphSpikyKernel3(double kernelRadius);
95 
98 
100  double operator()(double distance) const;
101 
103  double firstDerivative(double distance) const;
104 
106  Vector3D gradient(const Vector3D& point) const;
107 
109  Vector3D gradient(double distance, const Vector3D& direction) const;
110 
112  double secondDerivative(double distance) const;
113 };
114 
115 } // namespace jet
116 
117 #include "detail/sph_kernels3-inl.h"
118 
119 #endif // INCLUDE_JET_SPH_KERNELS3_H_
jet::SphSpikyKernel3::h4
double h4
Fourth-power of the kernel radius.
Definition: sph_kernels3.h:85
jet::SphSpikyKernel3::SphSpikyKernel3
SphSpikyKernel3()
Constructs a kernel object with zero radius.
jet::SphStdKernel3::h3
double h3
Cubic of the kernel radius.
Definition: sph_kernels3.h:36
jet::SphSpikyKernel3::secondDerivative
double secondDerivative(double distance) const
Returns the second derivative at given distance.
jet::SphStdKernel3::SphStdKernel3
SphStdKernel3(const SphStdKernel3 &other)
Copy constructor.
jet::SphStdKernel3::SphStdKernel3
SphStdKernel3()
Constructs a kernel object with zero radius.
jet::SphStdKernel3
Standard 3-D SPH kernel function object.
Definition: sph_kernels3.h:28
jet::SphStdKernel3::h5
double h5
Fifth-power of the kernel radius.
Definition: sph_kernels3.h:39
jet::SphSpikyKernel3::h2
double h2
Square of the kernel radius.
Definition: sph_kernels3.h:79
jet::SphStdKernel3::h
double h
Kernel radius.
Definition: sph_kernels3.h:30
jet
Definition: advection_solver2.h:18
jet::SphStdKernel3::operator()
double operator()(double distance) const
Returns kernel function value at given distance.
jet::SphSpikyKernel3::operator()
double operator()(double distance) const
Returns kernel function value at given distance.
jet::SphSpikyKernel3::h5
double h5
Fifth-power of the kernel radius.
Definition: sph_kernels3.h:88
jet::SphSpikyKernel3
Spiky 3-D SPH kernel function object.
Definition: sph_kernels3.h:74
jet::SphSpikyKernel3::h3
double h3
Cubic of the kernel radius.
Definition: sph_kernels3.h:82
jet::SphStdKernel3::SphStdKernel3
SphStdKernel3(double kernelRadius)
Constructs a kernel object with given radius.
jet::SphStdKernel3::secondDerivative
double secondDerivative(double distance) const
Returns the second derivative at given distance.
vector3.h
jet::SphSpikyKernel3::firstDerivative
double firstDerivative(double distance) const
Returns the first derivative at given distance.
jet::SphSpikyKernel3::gradient
Vector3D gradient(double distance, const Vector3D &direction) const
Returns the gradient at a point defined by distance and direction.
constants.h
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::SphSpikyKernel3::gradient
Vector3D gradient(const Vector3D &point) const
Returns the gradient at a point.
jet::SphSpikyKernel3::h
double h
Kernel radius.
Definition: sph_kernels3.h:76
jet::SphStdKernel3::gradient
Vector3D gradient(const Vector3D &point) const
Returns the gradient at a point.
jet::SphStdKernel3::h2
double h2
Square of the kernel radius.
Definition: sph_kernels3.h:33
jet::SphSpikyKernel3::SphSpikyKernel3
SphSpikyKernel3(const SphSpikyKernel3 &other)
Copy constructor.
jet::SphStdKernel3::firstDerivative
double firstDerivative(double distance) const
Returns the first derivative at given distance.
jet::SphStdKernel3::gradient
Vector3D gradient(double distance, const Vector3D &direction) const
Returns the gradient at a point defined by distance and direction.
jet::SphSpikyKernel3::SphSpikyKernel3
SphSpikyKernel3(double kernelRadius)
Constructs a kernel object with given radius.