PeriDyno 1.2.1
Loading...
Searching...
No Matches
DevicePoissonDiskSampler.h
Go to the documentation of this file.
1
16
17
18#pragma once
19#include "SdfSampler.h"
20#include "Collision/NeighborPointQuery.h"
23
24namespace dyno
25{
26 /*
27 *@brief Using the position-based constant-density constraint method, implement Poisson-disk sampling on GPU.
28 *
29 */
30
31 template<typename TDataType>
32 class DevicePoissonDiskSampler : public SdfSampler<TDataType>
33 {
35
36 public:
37 typedef typename TDataType::Real Real;
38 typedef typename TDataType::Coord Coord;
39
42
43 void resetStates() override;
44
45 DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "A set of points whose neighbors will be required for");
46
47 //DEF_ARRAY_STATE(Coord, VirtualVelocity, DeviceType::GPU, "");
48
49 DEF_VAR(Real, Delta, 0.001, "");
50
51 DEF_VAR_STATE(Real, NeighborLength, 0.01f, "Length of Neighborhood-searching");
52
53 DEF_ARRAYLIST_STATE(int, NeighborIds, DeviceType::GPU, "Return neighbor ids");
54
55 DEF_ARRAY_OUT(Real, Density, DeviceType::GPU, "Return the particle density");
56
57 DEF_VAR(bool, ConstraintDisable, false, "Disable the constant-density ");
58
59 DEF_VAR(int, MaxIteration, 20, "");
60
61 private:
62
63 //void updatePositions();
64
66
68
70
72
73 void resizeArrays(int num);
74
75
76 //DArray<Coord> m_Positions;
77
78 std::shared_ptr<NeighborPointQuery<TDataType>> m_neighbor;
79
80 std::shared_ptr<PoissionDiskPositionShifting<TDataType>> m_constraint;
81
82 std::shared_ptr<ImplicitViscosity<TDataType>> ptr_viscosity;
83
85
86
90
94
95 std::shared_ptr<DistanceField3D<TDataType>> m_inputSDF;
96
97
98 };
99
101}
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
DEF_VAR(Real, Delta, 0.001, "")
DEF_ARRAYLIST_STATE(int, NeighborIds, DeviceType::GPU, "Return neighbor ids")
DEF_VAR(bool, ConstraintDisable, false, "Disable the constant-density ")
DECLARE_TCLASS(DevicePoissonDiskSampler, TDataType)
std::shared_ptr< PoissionDiskPositionShifting< TDataType > > m_constraint
DEF_ARRAY_STATE(Coord, Position, DeviceType::GPU, "A set of points whose neighbors will be required for")
std::shared_ptr< NeighborPointQuery< TDataType > > m_neighbor
DEF_VAR_STATE(Real, NeighborLength, 0.01f, "Length of Neighborhood-searching")
std::shared_ptr< DistanceField3D< TDataType > > m_inputSDF
DEF_VAR(int, MaxIteration, 20, "")
std::shared_ptr< ImplicitViscosity< TDataType > > ptr_viscosity
DEF_ARRAY_OUT(Real, Density, DeviceType::GPU, "Return the particle density")
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89