Loading...
Searching...
No Matches
MPMFluidSystemData.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_MPM_FLUID_SYSTEM_DATA_HPP
12#define CUBBYFLOW_MPM_FLUID_SYSTEM_DATA_HPP
13
15
16namespace CubbyFlow
17{
24template <size_t N>
26{
27 public:
28 static_assert(N == 2 || N == 3, "MPM supports only 2-D and 3-D.");
29
32
34 explicit MPMFluidSystemData(
40 size_t numberOfParticles = 0);
41
43 void Resize(size_t newNumberOfParticles) override;
44
46 void Deserialize(const std::vector<uint8_t>& buffer) override;
47
49 void Set(const ParticleSystemData<N>& other) override;
50
53
56
59
62
70
71 private:
72 void ResetFluidState();
73
74 Array1<double> m_volumeRatios;
75 Array1<MatrixType> m_velocityGradients;
76};
77
80
83
85using MPMFluidSystemData2Ptr = std::shared_ptr<MPMFluidSystemData2>;
86
88using MPMFluidSystemData3Ptr = std::shared_ptr<MPMFluidSystemData3>;
89} // namespace CubbyFlow
90
92
93#endif
N-D weakly compressible MPM fluid transfer state.
Definition MPMFluidSystemData.hpp:26
void Resize(size_t newNumberOfParticles) override
Resizes particle state, initializing new fluid attributes.
Definition MPMFluidSystemData-Impl.hpp:33
void Set(const ParticleSystemData< N > &other) override
Copies inherited particle state and resets fluid state.
Definition MPMFluidSystemData-Impl.hpp:49
void Deserialize(const std::vector< uint8_t > &buffer) override
Deserializes inherited particle state and resets fluid state.
Definition MPMFluidSystemData-Impl.hpp:42
ConstArrayView1< double > VolumeRatios() const
Returns current-to-reference particle volume ratios.
Definition MPMFluidSystemData-Impl.hpp:56
ConstArrayView1< MatrixType > VelocityGradients() const
Returns particle velocity gradients interpolated from the grid.
Definition MPMFluidSystemData-Impl.hpp:69
Shared N-D material point method particle-grid transfer state.
Definition MPMSystemData.hpp:72
void TransferFromGridToParticles()
Definition MPMSystemData-Impl.hpp:367
Definition Matrix.hpp:30
Definition pybind11Utils.hpp:22
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:648
std::shared_ptr< MPMFluidSystemData2 > MPMFluidSystemData2Ptr
Shared pointer type of MPMFluidSystemData2.
Definition MPMFluidSystemData.hpp:85
std::shared_ptr< MPMFluidSystemData3 > MPMFluidSystemData3Ptr
Shared pointer type of MPMFluidSystemData3.
Definition MPMFluidSystemData.hpp:88