10#ifndef DEM_PARTICLES_HPP
11#define DEM_PARTICLES_HPP
14#include <Kokkos_Core.hpp>
109 Kokkos::View<int* [2], CpMem>
pairs;
144 Kokkos::View<float*, CpMem>
vn0;
145 Kokkos::View<float* [3], CpMem>
vt0;
301 Kokkos::View<unsigned char*, CpMem>
asleep;
374 Kokkos::View<float* [3], CpMem>
shell;
379 Kokkos::View<WallSdf*, CpMem>
walls;
439 Kokkos::View<unsigned long long*, CpMem>
velMask;
440 Kokkos::View<unsigned char*, CpMem>
xGate;
449 Kokkos::View<float* [3], CpMem>
479 void allocate(
int cap,
int maxPairs_,
int maxContacts_,
int nShapes,
int nShell,
int nPlanes) {
484 pos =
V3(
"pos", cap);
487 vel =
V3(
"vel", cap);
503 gid =
Vi(
"gid", cap);
504 planeFriction = Kokkos::View<float* [2], CpMem>(
"planeFriction", cap);
505 rad =
Vf(
"rad", cap);
527 bucketCursor = Kokkos::View<int*, CpMem>(
"bucketCursor", 64);
528 mlBucketPerm = Kokkos::View<int*, CpMem>(
"mlBucketPerm", 0);
530 velOffsDev = Kokkos::View<int*, CpMem>(
"velOffsDev", 65);
531 posOffsDev = Kokkos::View<int*, CpMem>(
"posOffsDev", 65);
532 mlOffsDev = Kokkos::View<int*, CpMem>(
"mlOffsDev", 65 * 10);
533 fusedBar = Kokkos::View<unsigned*, CpMem>(
"fusedBar", 32769);
534 bodyWinner = Kokkos::View<long long*, CpMem>(
"bodyWinner", cap);
535 bodyColorMask = Kokkos::View<std::uint64_t*, CpMem>(
"bodyColorMask", cap);
536 asleep = Kokkos::View<unsigned char*, CpMem>(
"asleep", cap);
537 sleepCounter = Kokkos::View<unsigned char*, CpMem>(
"sleepCounter", cap);
538 sleepMovingWall = Kokkos::View<unsigned char*, CpMem>(
"sleepMovingWall", cap);
539 sleepCurCount = Kokkos::View<int*, CpMem>(
"sleepCurCount", cap);
540 sleepPrevCount = Kokkos::View<int*, CpMem>(
"sleepPrevCount", cap);
541 invMassEff = Kokkos::View<float*, CpMem>(
"invMassEff", cap);
544 impRefPos = Kokkos::View<float* [3], CpMem>(
"impRefPos", cap);
545 impDispMax = Kokkos::View<float, CpMem>(
"impDispMax");
546 groundedLevel = Kokkos::View<unsigned char*, CpMem>(
"groundedLevel", cap);
547 materialId = Kokkos::View<unsigned char*, CpMem>(
"materialId", cap);
558 bodyOrphan = Kokkos::View<float*, CpMem>(
"bodyOrphan", cap);
562 heightLevel = Kokkos::View<int*, CpMem>(
"heightLevel", cap);
566 mlParent = Kokkos::View<int*, CpMem>(
"mlParent", 5 * cap);
567 mlInvMassG = Kokkos::View<float*, CpMem>(
"mlInvMassG", 4 * cap);
568 mlVelG = Kokkos::View<float* [3], CpMem>(
"mlVelG", 4 * cap);
569 mlVelG0 = Kokkos::View<float* [3], CpMem>(
"mlVelG0", 4 * cap);
570 mlMassG = Kokkos::View<float*, CpMem>(
"mlMassG", 4 * cap);
571 mlGrp = Kokkos::View<int*, CpMem>(
"mlGrp", cap);
572 mlMate = Kokkos::View<int*, CpMem>(
"mlMate", cap);
574 hertzWallCand = Kokkos::View<int*, CpMem>(
"hertzWallCand", cap * 2);
577 hertzRefPos = Kokkos::View<float* [3], CpMem>(
"hertzRefPos", cap);
578 hertzDispMax = Kokkos::View<float, CpMem>(
"hertzDispMax");
579 hertzE = Kokkos::View<float*, CpMem>(
"hertzE", 8);
580 hertzNu = Kokkos::View<float*, CpMem>(
"hertzNu", 8);
582 auto he = Kokkos::create_mirror_view(
hertzE);
583 auto hn = Kokkos::create_mirror_view(
hertzNu);
584 for (
int i = 0; i < 8; ++i) {
588 Kokkos::deep_copy(
hertzE, he);
589 Kokkos::deep_copy(
hertzNu, hn);
596 pairCount = Kokkos::View<int, CpMem>(
"pairCount");
597 contactCount = Kokkos::View<int, CpMem>(
"contactCount");
599 topGhost = Kokkos::View<int, CpMem>(
"topGhost");
600 maxOverlap = Kokkos::View<float, CpMem>(
"maxOverlap");
601 posResidual = Kokkos::View<float, CpMem>(
"posResidual");
602 maxApproach = Kokkos::View<float, CpMem>(
"maxApproach");
604 maxConsensus = Kokkos::View<float, CpMem>(
"maxConsensus");
605 shapes = Kokkos::View<ShapeDesc*, CpMem>(
"shapes", nShapes > 0 ? nShapes : 1);
606 shell = Kokkos::View<float* [3], CpMem>(
"shell", nShell > 0 ? nShell : 1);
607 planes = Kokkos::View<PlaneP*, CpMem>(
"planes", nPlanes > 0 ? nPlanes : 1);
608 sdfGrid = Kokkos::View<float*, CpMem>(
"sdfGrid", 1);
609 walls = Kokkos::View<WallSdf*, CpMem>(
"walls", 1);
610 wallGrid = Kokkos::View<float*, CpMem>(
"wallGrid", 1);
611 wallNodes = Kokkos::View<peclet::core::geom::ShapeNode<float>*,
CpMem>(
"wallNodes", 1);
612 shapeNodes = Kokkos::View<peclet::core::geom::ShapeNode<float>*,
CpMem>(
"shapeNodes", 1);
626 Kokkos::resize(
pos, newCap);
627 Kokkos::resize(
invMass, newCap);
628 Kokkos::resize(
quat, newCap);
629 Kokkos::resize(
vel, newCap);
630 Kokkos::resize(
angVel, newCap);
632 Kokkos::resize(
scale, newCap);
634 Kokkos::resize(
shapeId, newCap);
635 Kokkos::resize(
posPred, newCap);
637 Kokkos::resize(
velPred, newCap);
645 Kokkos::resize(
gid, newCap);
651 Kokkos::resize(
rad, newCap);
662 Kokkos::resize(
asleep, newCap);
678 Kokkos::resize(
mlGrp, newCap);
679 Kokkos::resize(
mlMate, newCap);
689 Kokkos::View<const float* [3], CpMem>
cpos()
const {
return pos; }
690 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
CpExec::memory_space CpMem
Kokkos::View< float *[4], CpMem > V4
dem — portable (Kokkos) narrow-phase: SDF point-shell collision + boundary planes.
std::vector< int > parentOff
std::vector< int > numGroups
Kokkos::View< WallSdf *, CpMem > walls
Kokkos::View< float, CpMem > posResidual
Kokkos::View< const float *[3], CpMem > cpos() const
Kokkos::View< float *, CpMem > hertzE
Kokkos::View< int *, CpMem > commitPerm
Kokkos::View< float *[3], CpMem > hertzXi
Kokkos::View< unsigned *, CpMem > fusedBar
Kokkos::View< unsigned char *, CpMem > asleep
Kokkos::View< int *, CpMem > bucketCursor
Kokkos::View< unsigned char *, CpMem > materialId
Kokkos::View< unsigned char *, CpMem > sideFlags
Kokkos::View< unsigned long long *, CpMem > prevContactKeys
Kokkos::View< int *, CpMem > mlGrp
Kokkos::View< unsigned char *, CpMem > xGate
Kokkos::View< unsigned char *, CpMem > manifoldPersistent
Kokkos::View< int *, CpMem > aPos
Kokkos::View< int, CpMem > hertzWallCandCount
Kokkos::View< float *[3], CpMem > impRefPos
Kokkos::View< int, CpMem > manifoldCount
Kokkos::View< int *, CpMem > posOffsDev
Kokkos::View< float *, CpMem > bodyOrphanVPeak
Kokkos::View< int *, CpMem > velPerm
Kokkos::View< unsigned char *, CpMem > contactSleep
Kokkos::View< float *, CpMem > prevLambda
void ensureCapacity(int newCap)
Kokkos::View< int *, CpMem > unitStart
Kokkos::View< ManifoldC *, CpMem > manifolds
Kokkos::View< float *[3], CpMem > mlOriginG
Kokkos::View< float *, CpMem > vn0
Kokkos::View< float *, CpMem > mlMassG
Kokkos::View< int *, CpMem > levelKey
Kokkos::View< int *, CpMem > sleepCurCount
Kokkos::View< int *[2], CpMem > pairs
Kokkos::View< float *[3], CpMem > invInertiaSolve
Kokkos::View< float *[3], CpMem > imageShift
Kokkos::View< int, CpMem > contactCount
DebugContactCapture debugCaptured
Kokkos::View< int *, CpMem > hertzWallCand
Kokkos::View< unsigned char *, CpMem > sleepMovingWall
Kokkos::View< float, CpMem > hertzDispMax
Kokkos::View< float *[3], CpMem > mlAngG0
Kokkos::View< float *[3], CpMem > vt0
Kokkos::View< int *, CpMem > vertexDegree
Kokkos::View< float *, CpMem > restRel
Kokkos::View< int *, CpMem > levelPerm
Kokkos::View< int *, CpMem > prevManifoldColor
Kokkos::View< float *[3], CpMem > mlAngG
static constexpr int kHertzMaxWalls
bool velCopiesLastSubstep
Kokkos::View< unsigned char *, CpMem > splitSlot
Kokkos::View< int *, CpMem > kVel
Kokkos::View< float *[3], CpMem > mlComOffG
Kokkos::View< float, CpMem > impDispMax
Kokkos::View< unsigned long long *, CpMem > contactKeys
Kokkos::View< float *, CpMem > pairMaterials
Kokkos::View< ShapeDesc *, CpMem > shapes
Kokkos::View< unsigned long long *, CpMem > hertzPrevKeys
Kokkos::View< int *, CpMem > prevContactColor
Kokkos::View< unsigned char *, CpMem > prevMatched
Kokkos::View< unsigned char *, CpMem > activityHit
Kokkos::View< float, CpMem > maxApproach
Kokkos::View< float *, CpMem > prevRestBank
Kokkos::View< float *, CpMem > restVPeak
Kokkos::View< peclet::core::geom::ShapeNode< float > *, CpMem > wallNodes
Kokkos::View< float *, CpMem > restBank
float hertzContactRadiusFrac
Kokkos::View< std::uint64_t *, CpMem > bodyColorMask
Kokkos::View< int *, CpMem > posCommitPerm
Kokkos::View< int *, CpMem > velOffsDev
Kokkos::View< int *, CpMem > mlOffsDev
Kokkos::View< unsigned long long *, CpMem > pairKeys
Kokkos::View< float *, CpMem > hertzNu
Kokkos::View< unsigned long long *, CpMem > hertzKeys
struct peclet::dem::Particles::MlLast mlLast
Kokkos::View< int, CpMem > topGhost
Kokkos::View< int *, CpMem > aVel
Kokkos::View< float, CpMem > maxConsensus
Kokkos::View< float *, CpMem > bodyOrphan
Kokkos::View< unsigned long long *, CpMem > prevPairKeys
Kokkos::View< float *, CpMem > hertzSnWall
Kokkos::View< int *, CpMem > posPerm
Kokkos::View< float *, CpMem > invMassEff
Kokkos::View< float *, CpMem > prevPosImpulse
Kokkos::View< int *, CpMem > contactColor
Kokkos::View< float *[3], CpMem > mlVelG
Kokkos::View< float *, CpMem > invMassSolve
Kokkos::View< peclet::core::geom::ShapeNode< float > *, CpMem > shapeNodes
Kokkos::View< float *[3], CpMem > mlVelG0
Kokkos::View< int *, CpMem > sleepPrevCount
Kokkos::View< int *, CpMem > mlBucketPerm
Kokkos::View< float *[3], CpMem > hertzRefPos
Kokkos::View< float *[3], CpMem > invInertiaCoarse
Kokkos::View< int *, CpMem > mlParent
Kokkos::View< float *, CpMem > sdfGrid
Kokkos::View< float *[3], CpMem > lambdaT
bool sleepWakeLostContact
Kokkos::View< float *, CpMem > hertzSnPair
Kokkos::View< float *[3], CpMem > prevLambdaT
Kokkos::View< int *, CpMem > unitColor
Kokkos::View< int *, CpMem > kPos
Kokkos::View< float, CpMem > maxOverlap
Kokkos::View< float *, CpMem > posLambdaContact
Kokkos::View< unsigned long long *, CpMem > velMask
Kokkos::View< float *, CpMem > posImpulse
Kokkos::View< int *, CpMem > contactSlot
Kokkos::View< unsigned char *, CpMem > sleepCounter
Kokkos::View< float *, CpMem > mlInvMassG
Kokkos::View< int *, CpMem > heightLevel
Kokkos::View< long long *, CpMem > bodyWinner
Kokkos::View< float *, CpMem > lambdaAcc
Kokkos::View< double *[7], CpMem > mlAccD
Kokkos::View< long long *, CpMem > mlColorPacked
Kokkos::View< float *, CpMem > invMassCoarse
Kokkos::View< float *, CpMem > wallGrid
Kokkos::View< int *, CpMem > iterCountDev
Kokkos::View< float, CpMem > maxApproachQS
Kokkos::View< unsigned char *, CpMem > manifoldSleep
Kokkos::View< const float *, CpMem > crad() const
Kokkos::View< int, CpMem > orphanClampCount
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< float *, CpMem > prevRestVPeak
Kokkos::View< int *, CpMem > mlMate
Kokkos::View< ContactC *, CpMem > contacts
Kokkos::View< int, CpMem > pairCount
Kokkos::View< unsigned char *, CpMem > groundedLevel
Kokkos::View< float *[3], CpMem > hertzXiWall
Kokkos::View< int *, CpMem > unitContacts
Kokkos::View< PlaneP *, CpMem > planes
Kokkos::View< float *[3], CpMem > hertzPrevXi
Kokkos::View< int *, CpMem > manifoldColor
Kokkos::View< float *[6], CpMem > mlInvIG
One solve phase's body copies (docs/contact_solve_framework.md §4.4, §4.5, §WO-4 item 2): the hub cop...
Kokkos::View< float *[3], CpMem > seedX
Kokkos::View< int *, CpMem > hubS
Kokkos::View< float *[3], CpMem > seedW
Kokkos::View< int *, CpMem > slotB
Kokkos::View< float *[3], CpMem > groupShift
Kokkos::View< int *, CpMem > hubVertex
Kokkos::View< int *, CpMem > copyBase
Kokkos::View< int *, CpMem > slotA
Kokkos::View< int *, CpMem > groupK
Kokkos::View< int *, CpMem > groupStart
Kokkos::View< unsigned char *, CpMem > groupActive
Kokkos::View< int *, CpMem > groupSlot
diagnostics.split_stats() (docs/contact_solve_framework.md §WO-4 item 4, §13.5 WO-4b): the last subst...
long long driftMigrations
long long unfiredSplitContacts