Loading...
Searching...
No Matches
SnowConstitutiveModel.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_SNOW_CONSTITUTIVE_MODEL_HPP
12#define CUBBYFLOW_SNOW_CONSTITUTIVE_MODEL_HPP
13
15
16namespace CubbyFlow
17{
24template <size_t N>
32
40template <size_t N>
42{
43 public:
44 static_assert(N == 2 || N == 3, "Snow model supports only 2-D and 3-D.");
45
48
61 explicit SnowConstitutiveModel(double youngsModulus = 1.4e5,
62 double poissonRatio = 0.2,
63 double criticalCompression = 2.5e-2,
64 double criticalStretch = 7.5e-3,
65 double hardeningCoefficient = 10.0);
66
80 const State& state) const;
81
92
108 const State& state, const MatrixType& differential) const;
109
120 [[nodiscard]] double ComputeWaveSpeed(const State& state,
121 double referenceDensity) const;
122
123 private:
124 [[nodiscard]] double ComputeHardening(const State& state) const;
125
126 [[nodiscard]] static bool IsFinite(const MatrixType& matrix);
127
128 static void ValidateDeformation(const MatrixType& matrix);
129
130 double m_mu0 = 0.0;
131 double m_lambda0 = 0.0;
132 double m_criticalCompression;
133 double m_criticalStretch;
134 double m_hardeningCoefficient;
135};
136
141} // namespace CubbyFlow
142
144
145#endif
static std::enable_if_t< IsMatrixStaticSquare< Rows, Cols >(), D > MakeIdentity()
Makes a static identity matrix.
Definition MatrixDenseBase-Impl.hpp:169
Snow-specific elastoplastic constitutive model.
Definition SnowConstitutiveModel.hpp:42
double ComputeWaveSpeed(const State &state, double referenceDensity) const
Estimates the fastest elastic wave speed for the state.
Definition SnowConstitutiveModel-Impl.hpp:203
MatrixType ComputeFirstPiolaStressDifferential(const State &state, const MatrixType &differential) const
Computes the first Piola stress differential.
Definition SnowConstitutiveModel-Impl.hpp:135
State Update(const MatrixType &deformationGradientIncrement, const State &state) const
Projects a deformation increment into elastic and plastic parts.
Definition SnowConstitutiveModel-Impl.hpp:63
MatrixType ComputeKirchhoffStress(const State &state) const
Computes the fixed-corotated Kirchhoff stress for the state.
Definition SnowConstitutiveModel-Impl.hpp:103
Definition pybind11Utils.hpp:22
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:648
Per-particle multiplicative deformation state for snow.
Definition SnowConstitutiveModel.hpp:26
MatrixType plastic
Definition SnowConstitutiveModel.hpp:30
MatrixType elastic
Definition SnowConstitutiveModel.hpp:29