CUDAWCSPHSolver3.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_WC_SPH_SOLVER3_HPP
12 #define CUBBYFLOW_CUDA_WC_SPH_SOLVER3_HPP
13 
14 #ifdef CUBBYFLOW_USE_CUDA
15 
17 
18 namespace CubbyFlow
19 {
36 class CUDAWCSPHSolver3 : public CUDASPHSolverBase3
37 {
38  public:
39  class Builder;
40 
42  CUDAWCSPHSolver3();
43 
46  CUDAWCSPHSolver3(float targetDensity, float targetSpacing,
47  float relativeKernelRadius);
48 
50  CUDAWCSPHSolver3(const CUDAWCSPHSolver3&) = delete;
51 
53  CUDAWCSPHSolver3(CUDAWCSPHSolver3&&) noexcept = delete;
54 
56  ~CUDAWCSPHSolver3() override = default;
57 
59  CUDAWCSPHSolver3& operator=(const CUDAWCSPHSolver3&) = delete;
60 
62  CUDAWCSPHSolver3& operator=(CUDAWCSPHSolver3&&) noexcept = delete;
63 
65  [[nodiscard]] float EOSExponent() const;
66 
74  void SetEOSExponent(float newEosExponent);
75 
77  static Builder GetBuilder();
78 
79  protected:
81  void OnAdvanceTimeStep(double timeStepInSeconds) override;
82 
83  private:
84  float m_eosExponent = 7.0f;
85 };
86 
88 using CUDAWCSPHSolver3Ptr = std::shared_ptr<CUDAWCSPHSolver3>;
89 
93 class CUDAWCSPHSolver3::Builder final
94  : public CUDASPHSolverBuilderBase3<CUDAWCSPHSolver3::Builder>
95 {
96  public:
98  [[nodiscard]] CUDAWCSPHSolver3 Build() const;
99 
101  [[nodiscard]] CUDAWCSPHSolver3Ptr MakeShared() const;
102 };
103 } // namespace CubbyFlow
104 
105 #endif
106 
107 #endif
Definition: pybind11Utils.hpp:20