PeriDyno 1.2.1
Loading...
Searching...
No Matches
VariationalApproximateProjection.h
Go to the documentation of this file.
1
16#pragma once
17
18#include "Collision/Attribute.h"
19
20//ParticleSystem
23
24namespace dyno
25{
26 template<typename TDataType> class SummationDensity;
27 template<typename TDataType> class Reduction;
28 template<typename TDataType> class Arithmetic;
29
37 template<typename TDataType>
39 {
41 public:
42 typedef typename TDataType::Real Real;
43 typedef typename TDataType::Coord Coord;
44
47
48 DEF_VAR(Real, RestDensity, Real(1000), "");
49
50 DEF_VAR_IN(Real, TimeStep, "Time step size");
51
52 DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "");
53
54 DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "");
55
56 DEF_ARRAY_IN(Coord, Normal, DeviceType::GPU, "");
57
58 DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "");
59
60 DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "");
61
62 void compute() override;
63
64 void resizeArray(int num);
65
66 void varChanged();
67
68 protected:
69
70 private:
71
73 Real mAMax = 0.0f;
75
78 //Real mRestDensity = 1000.0f;
79
80 //Refer to "A Nonlocal Variational Particle Framework for Incompressible Free Surface Flows" for their exact meanings
85
88
89 //Indicate whether a particle is near the free surface boundary.
91
92 //Internal variables used to solve the linear system of equations with a conjugate gradient method.
96
99
101
102 std::shared_ptr<SummationDensity<TDataType>> mDensityCalculator;
103 };
104
106}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
Definition Attribute.h:26
The standard summation density.
DEF_ARRAY_IN(Attribute, Attribute, DeviceType::GPU, "")
DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "")
DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "")
std::shared_ptr< SummationDensity< TDataType > > mDensityCalculator
DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "")
DEF_ARRAY_IN(Coord, Normal, DeviceType::GPU, "")
DEF_VAR(Real, RestDensity, Real(1000), "")
DEF_VAR_IN(Real, TimeStep, "Time step size")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89