PeriDyno 1.0.0
Loading...
Searching...
No Matches
SummationDensity.h
Go to the documentation of this file.
1
16#pragma once
18
19namespace dyno {
25 template<typename TDataType>
26 class SummationDensity : public virtual ParticleApproximation<TDataType>
27 {
29 public:
30 typedef typename TDataType::Real Real;
31 typedef typename TDataType::Coord Coord;
32
34 ~SummationDensity() override {};
35
36 void compute() override;
37
38 public:
39 void compute(
40 DArray<Real>& rho,
41 DArray<Coord>& pos,
42 DArrayList<int>& neighbors,
43 Real smoothingLength,
44 Real mass);
45
46 void compute(
47 DArray<Real>& rho,
48 DArray<Coord>& pos,
49 DArray<Coord>& posQueried,
50 DArrayList<int>& neighbors,
51 Real smoothingLength,
52 Real mass);
53
54 public:
55 DEF_VAR(Real, RestDensity, 1000, "Rest Density");
56
58
61 DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "Particle position");
62
66 DEF_ARRAY_IN(Coord, Other, DeviceType::GPU, "Particle position");
67
72 DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Neighboring particles' ids");
73
75
78 DEF_ARRAY_OUT(Real, Density, DeviceType::GPU, "Return the particle density");
79
83
84 private:
86
89 };
90
92}
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
The standard summation density.
DEF_ARRAY_OUT(Real, Density, DeviceType::GPU, "Return the particle density")
Define outputs.
DEF_ARRAY_IN(Coord, Position, DeviceType::GPU, "Particle position")
Define inputs.
void compute(DArray< Real > &rho, DArray< Coord > &pos, DArray< Coord > &posQueried, DArrayList< int > &neighbors, Real smoothingLength, Real mass)
void compute(DArray< Real > &rho, DArray< Coord > &pos, DArrayList< int > &neighbors, Real smoothingLength, Real mass)
void compute() override
DEF_ARRAYLIST_IN(int, NeighborIds, DeviceType::GPU, "Neighboring particles' ids")
Neighboring particles.
DEF_VAR(Real, RestDensity, 1000, "Rest Density")
DEF_ARRAY_IN(Coord, Other, DeviceType::GPU, "Particle position")
Particle positions.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
ArrayList< ElementType, DeviceType::GPU > DArrayList
Definition ArrayList.inl:83