CUDASPHKernels2.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_CUDA_SPH_KERNELS2_HPP
12 #define CUBBYFLOW_CUDA_SPH_KERNELS2_HPP
13 
14 #ifdef CUBBYFLOW_USE_CUDA
15 
16 #include <Core/Utils/Constants.hpp>
17 
18 namespace CubbyFlow
19 {
28 struct CUDASPHStdKernel2
29 {
31  CUBBYFLOW_CUDA_HOST_DEVICE CUDASPHStdKernel2();
32 
34  CUBBYFLOW_CUDA_HOST_DEVICE explicit CUDASPHStdKernel2(float kernelRadius);
35 
37  CUBBYFLOW_CUDA_HOST_DEVICE float operator()(float distance) const;
38 
40  CUBBYFLOW_CUDA_HOST_DEVICE float FirstDerivative(float distance) const;
41 
43  CUBBYFLOW_CUDA_HOST_DEVICE float SecondDerivative(float distance) const;
44 
46  CUBBYFLOW_CUDA_HOST_DEVICE float2 Gradient(const float2& point) const;
47 
49  CUBBYFLOW_CUDA_HOST_DEVICE float2 Gradient(float distance,
50  const float2& direction) const;
51 
53  float h;
54 
56  float h2;
57 
59  float h3;
60 
62  float h4;
63 };
64 
73 struct CUDASPHSpikyKernel2
74 {
76  CUBBYFLOW_CUDA_HOST_DEVICE CUDASPHSpikyKernel2();
77 
79  CUBBYFLOW_CUDA_HOST_DEVICE explicit CUDASPHSpikyKernel2(float kernelRadius);
80 
82  CUBBYFLOW_CUDA_HOST_DEVICE float operator()(float distance) const;
83 
85  CUBBYFLOW_CUDA_HOST_DEVICE float FirstDerivative(float distance) const;
86 
88  CUBBYFLOW_CUDA_HOST_DEVICE float SecondDerivative(float distance) const;
89 
91  CUBBYFLOW_CUDA_HOST_DEVICE float2 Gradient(const float2& point) const;
92 
94  CUBBYFLOW_CUDA_HOST_DEVICE float2 Gradient(float distance,
95  const float2& direction) const;
96 
98  float h;
99 
101  float h2;
102 
104  float h3;
105 
107  float h4;
108 
110  float h5;
111 };
112 } // namespace CubbyFlow
113 
115 
116 #endif
117 
118 #endif
Definition: pybind11Utils.hpp:20