10#ifndef DEM_PARTICLES_HPP
11#define DEM_PARTICLES_HPP
13#include <Kokkos_Core.hpp>
47 Kokkos::View<int* [2], CpMem>
pairs;
56 Kokkos::View<ShapeDesc*, CpMem>
shapes;
57 Kokkos::View<float* [3], CpMem>
shell;
61 Kokkos::View<WallSdf*, CpMem>
walls;
80 void allocate(
int cap,
int maxPairs_,
int maxContacts_,
int nShapes,
int nShell,
int nPlanes) {
104 planeFriction = Kokkos::View<float* [2], CpMem>(
"planeFriction", cap);
105 rad =
Vf(
"rad", cap);
110 pairCount = Kokkos::View<int, CpMem>(
"pairCount");
111 contactCount = Kokkos::View<int, CpMem>(
"contactCount");
113 topGhost = Kokkos::View<int, CpMem>(
"topGhost");
114 maxOverlap = Kokkos::View<float, CpMem>(
"maxOverlap");
115 shapes = Kokkos::View<ShapeDesc*, CpMem>(
"shapes", nShapes > 0 ? nShapes : 1);
116 shell = Kokkos::View<float* [3], CpMem>(
"shell", nShell > 0 ? nShell : 1);
117 planes = Kokkos::View<PlaneP*, CpMem>(
"planes", nPlanes > 0 ? nPlanes : 1);
118 sdfGrid = Kokkos::View<float*, CpMem>(
"sdfGrid", 1);
119 walls = Kokkos::View<WallSdf*, CpMem>(
"walls", 1);
120 wallGrid = Kokkos::View<float*, CpMem>(
"wallGrid", 1);
134 Kokkos::resize(
pos, newCap);
135 Kokkos::resize(
invMass, newCap);
136 Kokkos::resize(
quat, newCap);
137 Kokkos::resize(
vel, newCap);
138 Kokkos::resize(
angVel, newCap);
140 Kokkos::resize(
scale, newCap);
142 Kokkos::resize(
shapeId, newCap);
143 Kokkos::resize(
posPred, newCap);
145 Kokkos::resize(
velPred, newCap);
154 Kokkos::resize(
rad, newCap);
160 Kokkos::View<const float* [3], CpMem>
cpos()
const {
return pos; }
161 Kokkos::View<const float*, CpMem>
crad()
const {
return rad; }
dem — portable (Kokkos) time integration kernels (integration.cu).
Kokkos::View< float *, CpMem > Vf
Kokkos::View< int *, CpMem > Vi
Kokkos::View< float *[3], CpMem > V3
Kokkos::View< float *[4], CpMem > V4
dem — portable (Kokkos) narrow-phase: SDF point-shell collision + boundary planes.
Kokkos::View< WallSdf *, CpMem > walls
Kokkos::View< const float *[3], CpMem > cpos() const
Kokkos::View< int, CpMem > manifoldCount
void ensureCapacity(int newCap)
Kokkos::View< ManifoldC *, CpMem > manifolds
Kokkos::View< int *[2], CpMem > pairs
Kokkos::View< int, CpMem > contactCount
Kokkos::View< ShapeDesc *, CpMem > shapes
Kokkos::View< int, CpMem > topGhost
Kokkos::View< float *, CpMem > sdfGrid
Kokkos::View< float, CpMem > maxOverlap
Kokkos::View< float *, CpMem > wallGrid
Kokkos::View< const float *, CpMem > crad() const
void allocate(int cap, int maxPairs_, int maxContacts_, int nShapes, int nShell, int nPlanes)
Kokkos::View< float *[2], CpMem > planeFriction
Kokkos::View< float *[3], CpMem > shell
Kokkos::View< ContactC *, CpMem > contacts
Kokkos::View< int, CpMem > pairCount
Kokkos::View< PlaneP *, CpMem > planes