PeriDyno 1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ElastoplasticityModule.h
Go to the documentation of this file.
1
12#pragma once
14
16
17namespace dyno {
18
19 template<typename TDataType>
21 {
23 public:
24 typedef typename TDataType::Real Real;
25 typedef typename TDataType::Coord Coord;
26 typedef typename TDataType::Matrix Matrix;
27 typedef typename ::dyno::TBond<TDataType> Bond;
28
31
32 public:
33 DEF_VAR(Real, Cohesion, 0.0, "Cohesion between particles");
34
35 DEF_VAR(Real, FrictionAngle, Real(1.0f / 3.0f), "Cohesion between particles");
36
37 DEF_VAR(bool, Incompressible, true, "Incompressible or not");
38
39 DEF_VAR(bool, RenewNeighborhood, false, "Whether to renew particle neighbors every time step");
40
41 DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Neighboring particles' ids");
42
43 protected:
44 void constrain() override;
45
46 void solveElasticity() override;
47
48 virtual void applyPlasticity();
49
51
54
55 protected:
56 inline Real computeA()
57 {
58 Real phi = this->varFrictionAngle()->getValue() * M_PI;
59 return (Real)6.0 * this->varCohesion()->getValue() * cos(phi) / (3.0f + sin(phi)) / std::sqrt(3.0f);
60 }
61
62
63 inline Real computeB()
64 {
65 Real phi = this->varFrictionAngle()->getValue() * M_PI;
66 return (Real)2.0f * sin(phi) / (3.0f + sin(phi)) / std::sqrt(3.0f);
67 }
68
69 private:
75
76 std::shared_ptr<IterativeDensitySolver<TDataType>> mDensityPBD;
77 };
78}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define M_PI
Definition Typedef.inl:36
DEF_VAR(bool, RenewNeighborhood, false, "Whether to renew particle neighbors every time step")
DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Neighboring particles' ids")
virtual void applyPlasticity()
std::shared_ptr< IterativeDensitySolver< TDataType > > mDensityPBD
void solveElasticity() override
::dyno::TBond< TDataType > Bond
DEF_VAR(Real, FrictionAngle, Real(1.0f/3.0f), "Cohesion between particles")
DEF_VAR(Real, Cohesion, 0.0, "Cohesion between particles")
DEF_VAR(bool, Incompressible, true, "Incompressible or not")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
DYN_FUNC Complex< Real > sin(const Complex< Real > &)
Definition Complex.inl:564
DYN_FUNC Complex< Real > cos(const Complex< Real > &)
Definition Complex.inl:573