peclet-dem
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
Loading...
Searching...
No Matches
solver_friction.hpp File Reference

dem — portable (Kokkos) Coulomb friction cluster (the single dissipative friction path). More...

#include <Kokkos_Core.hpp>
#include "dem_portable.hpp"
#include "solver_position.hpp"

Go to the source code of this file.

Namespaces

namespace  peclet
 
namespace  peclet::dem
 

Typedefs

using peclet::dem::FrManifoldCounts = Kokkos::View< float *[2], CpMem >
 

Functions

void peclet::dem::accumulateNormalImpulseKokkos (Kokkos::View< ContactC *, CpMem > contacts, int numContacts, Kokkos::View< const float *, CpMem > invMass, Kokkos::View< const float *[3], CpMem > invInertia, Kokkos::View< const float *[3], CpMem > velPred, Kokkos::View< const float *[3], CpMem > angVelPred, Kokkos::View< const int *, CpMem > realIdx, float growthRate)
 Force-chain normal load, accumulated over the velocity iterations: contacts(idx).friction_lambda_n += approach / w_n.
 
void peclet::dem::computePlaneLoadKokkos (Kokkos::View< ContactC *, CpMem > contacts, int numContacts, Kokkos::View< const float *, CpMem > invMass, Kokkos::View< const float *[3], CpMem > invInertia, Kokkos::View< const float *[3], CpMem > velPred, Kokkos::View< const float *[3], CpMem > angVelPred, FrManifoldCounts planeFriction)
 Plane (idB<0) one-shot loads.
 
void peclet::dem::countFrictionContactsKokkos (Kokkos::View< const ContactC *, CpMem > contacts, int numContacts, Kokkos::View< const int *, CpMem > realIdx, FrManifoldCounts planeFriction)
 Per-body active-contact count into planeFriction(:,1).
 
void peclet::dem::solveContactFrictionKokkos (Kokkos::View< const ContactC *, CpMem > contacts, int numContacts, Kokkos::View< const float *, CpMem > invMass, Kokkos::View< const float *[3], CpMem > invInertia, Kokkos::View< const float *[3], CpMem > velPred, Kokkos::View< const float *[3], CpMem > angVelPred, Kokkos::View< const int *, CpMem > realIdx, FrManifoldCounts planeFriction, float frictionDynamic, Kokkos::View< float *[3], CpMem > deltaVel, Kokkos::View< float *[3], CpMem > deltaAngVel)
 One count-averaged Coulomb friction sweep.
 

Detailed Description

dem — portable (Kokkos) Coulomb friction cluster (the single dissipative friction path).

Kokkos port of the four friction kernels in solver_position.cu. Friction lives in the velocity solve (all dissipation there; the position solve does pure overlap removal): computePlaneLoad (once, before the velocity loop) — plane (idB<0) one-shot normal load. accumulateNormalImpulse (each velocity iteration) — body-body force-chain normal load. countFrictionContacts (once, after the loop) — per-body active-contact count (Jacobi split). solveContactFriction (friction sweep) — tangential impulse, Coulomb-clamped by the normal load, count-averaged. Faithful copy of the CUDA math over the SoA Views; the contact's friction_lambda_n is read/written in place (per-contact, no cross-thread race). See packing-velocity-position-split for the design.

Definition in file solver_friction.hpp.