PeriDyno 1.0.0
Loading...
Searching...
No Matches
DualParticleIsphModule.h
Go to the documentation of this file.
1
16
17
18
19#pragma once
21#include "Algorithm/Reduction.h"
24#include "Collision/Attribute.h"
27#include <sstream>
28#include <iostream>
29#include <fstream>
30#include <string>
31namespace dyno {
32
33 class Attribute;
34 template<typename TDataType> class SummationDensity;
35
36
37 /*
38 *@Brief: Dual particle SPH solver to model free surface flow.
39 *@Note : 1. This solver does not contain the virtual particle generator; 2. The graphic memory of the NVDIA GPU should be larger than 4GB.
40 *@Paper: Liu et al., ACM Trans Graph (TOG). 2024. (A Dual-Particle Approach for Incompressible SPH Fluids) doi.org/10.1145/3649888
41 */
42
43 template<typename TDataType>
45 {
47 public:
48 typedef typename TDataType::Real Real;
49 typedef typename TDataType::Coord Coord;
50 typedef typename TDataType::Matrix Matrix;
51
54
55 void constrain() override;
56
57
58 public:
59
60 DEF_VAR(Real, RestDensity, Real(1000), "Reference density");
61
62 DEF_VAR(Real, SamplingDistance, Real(0.005), "");
63
64 DEF_VAR(Real, SmoothingLength, Real(0.0125), "Smoothing length in most cases");
65
66 DEF_VAR(Real, PpeSmoothingLength, Real(0.0125), "Smoothing length in PPE solving")
67
68 DEF_VAR_IN(Real, TimeStep, "Time Step");
69
73 DEF_ARRAY_IN(Coord, RPosition, DeviceType::GPU, "Input real particle position");
74
78 DEF_ARRAY_IN(Coord, VPosition, DeviceType::GPU, "Input virtual particle position");
79
83 DEF_ARRAY_IN(Coord, Velocity, DeviceType::GPU, "Input particle velocity");
84
88 DEF_ARRAY_IN(Attribute, ParticleAttribute, DeviceType::GPU, "Real particle attribute");
89
90
94 DEF_ARRAY_IN(Coord, BoundaryNorm, DeviceType::GPU, "Real-solid particle normal");
95
96
100 DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Return real neighbor ids of real particles");
101
102 /*
103 *@brief Virtual Particle's Neghoboring Real Partilce
104 */
105 DEF_ARRAYLIST_IN(int, VRNeighborIds, DeviceType::GPU, "Return real neighbor ids of Virtual particles");
106
107 /*
108 *@brief Real Particle's Neghoboring Virtual Partilce
109 */
110 DEF_ARRAYLIST_IN(int, RVNeighborIds, DeviceType::GPU, "Return Virtual neighbor ids of real particles");
111
112 /*
113 *@brief Virtual Particle's Neghoboring Virtual Partilces
114 */
115 DEF_ARRAYLIST_IN(int, VVNeighborIds, DeviceType::GPU, "Return Virtual neighbor ids of virtual particles");
116
117 /*
118 *@brief Virtual Particle's Boolean Quantity (Debug)
119 */
120 DEF_ARRAY_OUT(bool, VirtualBool, DeviceType::GPU, "Virtual Particle's Boolean Quantity");
121
122 /*
123 *@brief Virtual Particle's Float Quantity (Debug)
124 */
125 DEF_ARRAY_OUT(Real, VirtualWeight, DeviceType::GPU, "Virtual Particle's Float Quantity");
126
127
128 DEF_VAR(Real, ResidualThreshold, 0.001f, "Convergence threshold for the pressure Poisson Equation");
129
130 private:
131
132 bool initializeImpl() override;
135
136 bool init_flag = false;
137
138
144
156
157 unsigned int virtualNumber_old = 0;
158
161
164 //Arithmetic<Real>* m_arithmetic_r;
165
166 unsigned int frag_number = 0;
168
169 std::shared_ptr<SummationDensity<TDataType>> m_summation;
170
171 std::shared_ptr<SummationDensity<TDataType>> m_vv_summation;
172
173 std::shared_ptr<SummationDensity<TDataType>> m_vr_summation;
174
175 };
176}
#define DEF_VAR(T, name, value, desc)
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
particle attribute 0x00000000: [31-30]material; [29]motion; [28]Dynamic; [27-8]undefined yet,...
Definition Attribute.h:26
std::shared_ptr< SummationDensity< TDataType > > m_vv_summation
std::shared_ptr< SummationDensity< TDataType > > m_vr_summation
std::shared_ptr< SummationDensity< TDataType > > m_summation
DEF_VAR_IN(Real, TimeStep, "Time Step")
DEF_ARRAY_IN(Coord, RPosition, DeviceType::GPU, "Input real particle position")
Real Particle position.
DEF_VAR(Real, SmoothingLength, Real(0.0125), "Smoothing length in most cases")
DEF_VAR(Real, SamplingDistance, Real(0.005), "")
DEF_VAR(Real, RestDensity, Real(1000), "Reference density")
DEF_ARRAY_OUT(bool, VirtualBool, DeviceType::GPU, "Virtual Particle's Boolean Quantity")
bool initializeImpl() override
DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Return real neighbor ids of real particles")
Real Particle's Neghoboring Real Partilce.
The standard summation density.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89