PeriDyno 1.2.1
Loading...
Searching...
No Matches
CapillaryWave.h
Go to the documentation of this file.
1
16#pragma once
17#include "Node.h"
19
20namespace dyno
21{
25 template<typename TDataType>
26 class CapillaryWave : public Node
27 {
29 public:
30 typedef typename TDataType::Real Real;
31 typedef typename ::dyno::Vector<Real, 2> Coord2D;
32 typedef typename ::dyno::Vector<Real, 3> Coord3D;
33 typedef typename ::dyno::Vector<Real, 4> Coord4D;
34
36 ~CapillaryWave() override;
37
38 std::string getNodeType() override { return "Height Fields"; }
39
40 public:
41 DEF_VAR(Real, WaterLevel, 2, "");
42
43 DEF_VAR(uint, Resolution, 512, "");
44
45 DEF_VAR(Real, Length, 512.0f, "The simulated region size in meters");
46
47 DEF_VAR(Real, Viscosity, 0.001, "Fluid viscosity");
48
49 public:
50 DEF_ARRAY2D_STATE(Coord4D, Height, DeviceType::GPU, "");
51
53
54 public:
55 void setOriginX(int x) { mOriginX = x; }
56 void setOriginY(int y) { mOriginY = y; }
57
58 int getOriginX() { return mOriginX; }
59 int getOriginZ() { return mOriginY; }
60
62
64
65 //TODO: make improvements
66 void moveDynamicRegion(int nx, int ny);
67
68 protected:
69 void resetStates() override;
70
71 void updateStates() override;
72
73 protected:
77
78 private:
80
81 int mOriginX = 0;
82 int mOriginY = 0;
83 };
84
86}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
TDataType::Real Real
::dyno::Vector< Real, 3 > Coord3D
DArray2D< Coord4D > mDeviceGridOld
DEF_VAR(Real, Viscosity, 0.001, "Fluid viscosity")
void moveDynamicRegion(int nx, int ny)
DArray2D< Coord4D > mDeviceGridNext
void setOriginX(int x)
::dyno::Vector< Real, 4 > Coord4D
DEF_VAR(Real, WaterLevel, 2, "")
void setOriginY(int y)
DEF_VAR(uint, Resolution, 512, "")
::dyno::Vector< Real, 2 > Coord2D
void resetStates() override
void updateStates() override
DEF_VAR(Real, Length, 512.0f, "The simulated region size in meters")
DEF_ARRAY2D_STATE(Coord4D, Height, DeviceType::GPU, "")
~CapillaryWave() override
DArray2D< Coord4D > mDeviceGrid
std::string getNodeType() override
DEF_INSTANCE_STATE(HeightField< TDataType >, HeightField, "Height field")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array2D< T, DeviceType::GPU > DArray2D
Definition Array2D.inl:90
unsigned int uint
Definition VkProgram.h:14