PeriDyno 1.0.0
Loading...
Searching...
No Matches
GranularMedia.h
Go to the documentation of this file.
1
16#pragma once
17#include "Node.h"
18
20
21namespace dyno
22{
28
29 template<typename TDataType>
30 class GranularMedia : public Node
31 {
33 public:
34 typedef typename TDataType::Real Real;
35 typedef typename ::dyno::Vector<Real, 3> Coord3D;
36 typedef typename ::dyno::Vector<Real, 4> Coord4D;
37
40
41 public:
42 DEF_VAR(Coord3D, Origin, Coord3D(0), "");
43
44 DEF_VAR(uint, Width, 64, "");
45 DEF_VAR(uint, Height, 64, "");
46
47 DEF_VAR(Real, Depth, 1.0f, "Depth");
48
49 DEF_VAR(Real, DepthOfDiluteLayer, 0.7f, "Depth of the dilute layer");
50 DEF_VAR(Real, CoefficientOfDragForce, 0.7f, "The drag force coefficient");
51 DEF_VAR(Real, CoefficientOfFriction, 0.95f, "The frictional coefficient exerted on the dilute layer");
52
53 DEF_VAR(Real, Spacing, 1, "Grid spacing");
54
55 DEF_VAR(Real, Gravity, -9.8, "");
56
57 public:
58 DEF_ARRAY2D_STATE(Real, LandScape, DeviceType::GPU, "");
59
60 DEF_ARRAY2D_STATE(Coord4D, Grid, DeviceType::GPU, "");
61
62 DEF_ARRAY2D_STATE(Coord4D, GridNext, DeviceType::GPU, "");
63
65
66 protected:
67 void resetStates() override;
68 void updateStates() override;
69 };
70
72}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
This class implements the shallow sand equation to simulate dry granular flows. For more details,...
DEF_VAR(Real, Gravity, -9.8, "")
DEF_VAR(uint, Width, 64, "")
TDataType::Real Real
DEF_VAR(Real, CoefficientOfDragForce, 0.7f, "The drag force coefficient")
::dyno::Vector< Real, 4 > Coord4D
DEF_VAR(Real, Depth, 1.0f, "Depth")
::dyno::Vector< Real, 3 > Coord3D
DEF_ARRAY2D_STATE(Real, LandScape, DeviceType::GPU, "")
DEF_INSTANCE_STATE(HeightField< TDataType >, HeightField, "Topology")
void resetStates() override
DEF_VAR(Real, DepthOfDiluteLayer, 0.7f, "Depth of the dilute layer")
DEF_VAR(Real, CoefficientOfFriction, 0.95f, "The frictional coefficient exerted on the dilute layer")
DEF_ARRAY2D_STATE(Coord4D, GridNext, DeviceType::GPU, "")
DEF_VAR(Real, Spacing, 1, "Grid spacing")
DEF_ARRAY2D_STATE(Coord4D, Grid, DeviceType::GPU, "")
DEF_VAR(uint, Height, 64, "")
void updateStates() override
DEF_VAR(Coord3D, Origin, Coord3D(0), "")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
unsigned int uint
Definition VkProgram.h:14