Loading...
Searching...
No Matches
CUDASPHSystemData3.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_SYSTEM_DATA3_HPP
12#define CUBBYFLOW_CUDA_SPH_SYSTEM_DATA3_HPP
13
14#ifdef CUBBYFLOW_USE_CUDA
15
18
19namespace CubbyFlow
20{
22{
23 public:
26
29
31 ~CUDASPHSystemData3() override = default;
32
35
38
41
43 CUDASPHSystemData3& operator=(CUDASPHSystemData3&& other) noexcept;
44
46 ConstCUDAArrayView1<float> Densities() const;
47
49 CUDAArrayView1<float> Densities();
50
52 ConstCUDAArrayView1<float> Pressures() const;
53
55 CUDAArrayView1<float> Pressures();
56
66 void UpdateDensities();
67
69 float TargetDensity() const;
70
72 void SetTargetDensity(float targetDensity);
73
75 float TargetSpacing() const;
76
83 void SetTargetSpacing(float spacing);
84
91 float RelativeKernelRadius() const;
92
101 void SetRelativeKernelRadius(float relativeRadius);
102
104 float KernelRadius() const;
105
114 void SetKernelRadius(float kernelRadius);
115
117 float Mass() const;
118
120 void BuildNeighborSearcher();
121
124
126 void Set(const CUDASPHSystemData3& other);
127
128 private:
130 float m_targetDensity = WATER_DENSITY_FLOAT;
131
133 float m_targetSpacing = 0.1f;
134
137 float m_kernelRadiusOverTargetSpacing = 1.8f;
138
140 float m_kernelRadius = 0.1f;
141
142 float m_mass = 1e-3f;
143
144 size_t m_pressureIdx = 0;
145
146 size_t m_densityIdx = 0;
147
149 void ComputeMass();
150};
151
153using CUDASPHSystemData3Ptr = std::shared_ptr<CUDASPHSystemData3>;
154
155} // namespace CubbyFlow
156
157#endif
158
159#endif
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
constexpr float WATER_DENSITY_FLOAT
Water density.
Definition Constants.hpp:302