PeriDyno 1.0.0
Loading...
Searching...
No Matches
VirtualSpatiallyAdaptiveStrategy.h
Go to the documentation of this file.
1
16
17#pragma once
19
22
23#include "Collision/NeighborPointQuery.h"
24
25namespace dyno {
26
27 template<typename TDataType> class SummationDensity;
28
29 /*
30 *@Brief: Spatially Adaptive Strategy (S.C.) in Dual-particle SPH method. (Virtual paritlce genorator).
31 *@Note : When the strategy is adopted, the dual-particle method has the best quality
32 *@Paper: Liu et al., ACM Trans Graph (TOG). 2024. (A Dual-Particle Approach for Incompressible SPH Fluids) doi.org/10.1145/3649888
33 */
34
35
36 typedef unsigned short OcIndex;
37 typedef unsigned long long int OcKey;
38 typedef unsigned short Level;
39
40
41
42
43 template<typename TDataType>
45 {
47 public:
48 typedef typename TDataType::Real Real;
49 typedef typename TDataType::Coord Coord;
50
53
54 void constrain() override;
55
56 void setHashGridSize(Real x) { gridSize = x; };
57
58 DECLARE_ENUM(CandidatePointCount,
59 neighbors_8 = 8,
60 neighbors_27 = 27,
61 neighbors_33 = 33,
62 neighbors_125 = 125
63 );
64
65 DEF_ENUM(CandidatePointCount, CandidatePointCount, CandidatePointCount::neighbors_33, "Candidate Point Count");
66
67
68 DEF_VAR(Real, RestDensity, Real(1000), "Reference density");
69
70
74
75 DEF_VAR(Real, SamplingDistance, Real(0.005), "");
76
80 DEF_ARRAY_IN(Coord, RPosition, DeviceType::GPU, "Input real particle position");
81
82
83 private:
85
87
88
90
91 Coord origin = Coord(0.0f, 0.0f, 0.0f);
92
93 /*
94 * @brief Morton codes of anchor points.
95 */
97
99
101
103
104 private:
105 //std::shared_ptr<SummationDensity<TDataType>> m_v_summation;
106
107 std::shared_ptr <SummationDensity<TDataType>> m_vv_density;
108
109
110 std::shared_ptr<NeighborPointQuery<TDataType>> m_rv_nbrQuery;
111 std::shared_ptr<NeighborPointQuery<TDataType>> m_vr_nbrQuery;
112 std::shared_ptr<NeighborPointQuery<TDataType>> m_vv_nbrQuery;
113
114
115 };
116}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
The standard summation density.
std::shared_ptr< SummationDensity< TDataType > > m_vv_density
DECLARE_ENUM(CandidatePointCount, neighbors_8=8, neighbors_27=27, neighbors_33=33, neighbors_125=125)
DEF_VAR(Real, RestDensity, Real(1000), "Reference density")
DEF_ARRAY_IN(Coord, RPosition, DeviceType::GPU, "Input real particle position")
Real Particle positions.
std::shared_ptr< NeighborPointQuery< TDataType > > m_vv_nbrQuery
std::shared_ptr< NeighborPointQuery< TDataType > > m_rv_nbrQuery
DEF_ENUM(CandidatePointCount, CandidatePointCount, CandidatePointCount::neighbors_33, "Candidate Point Count")
DEF_VAR(Real, SamplingDistance, Real(0.005), "")
Virtual Particles Sampling Distance.
std::shared_ptr< NeighborPointQuery< TDataType > > m_vr_nbrQuery
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
unsigned long long int OcKey