|
peclet-dem 1.1.0
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
|
One full colored PGS sweep. More...
#include <solver_velocity.hpp>
Classes | |
| struct | PairVelocity |
| The endpoints' velocities (B on a wall: the wall's average velocity, zero spin). More... | |
| struct | Row |
| One manifold's constraint row as the three impulse channels share it: the manifold, its endpoints' solve slots, mass data and velocities at the start of this manifold's solve, the averaged normal and arm sums, and the substep's sign, effective mass, side gate and restitution. More... | |
| struct | ReleaseBudget |
| The Poisson release's budget: the pair's owed impulse, the release speed scale and the endpoints' orphan balances. More... | |
Public Member Functions | |
| void | applyLinear (int real, F3 dLin, float invMass) const |
| Linear velocity update of body slot real by the world-frame impulse dLin. | |
| void | applyAngular (int real, F3 dAngWorld, F3 invI, F4 q) const |
| Angular velocity update of body slot real by the world-frame angular impulse dAngWorld (rotated into the body frame, scaled by the diagonal inverse inertia, rotated back). | |
| void | recordCorrection (int idx, float lenN, float corr) const |
| Residual record of one applied correction: the adaptive stop's maxApproach and, on quasi-static contacts, maxApproachQS. | |
| void | gatherRow (int idx, Row &r) const |
| Row, part 1: the manifold, its endpoints' slots, mass data and velocities, the averaged normal and arm sums and lenN. | |
| void | weighRow (int idx, Row &r) const |
| Row, part 2: the approach velocity, the sign, the side gates and the effective mass. | |
| void | releaseIncrement (int idx, const Row &r, const ReleaseBudget &b, float vtil3) const |
| One release increment: the budget-capped push toward the event's separation-velocity target, drawing orphan balance into the pair bank when its own budget rails. | |
| float | drawOrphans (int realA, int realB, float need, float orphA, float orphB) const |
| Draw up to need from the endpoints' orphan balances (A first, then B); returns the amount drawn. | |
| void | solveOne (int idx) const |
Static Public Member Functions | |
| static float | normalVelocity (const PairVelocity &v, F3 Nsum, F3 TauA, F3 TauB, F3 vGrowth) |
| The pair's normal approach velocity along Nsum (arm sums TauA/TauB), growth included. | |
Public Attributes | |
| Kokkos::View< const ManifoldC *, CpMem > | manifolds |
| Kokkos::View< const float *, CpMem > | invMass |
| Kokkos::View< const float *[3], CpMem > | invInertia |
| Kokkos::View< const float *[4], CpMem > | quat |
| Kokkos::View< float *[3], CpMem > | velPred |
| Kokkos::View< float *[3], CpMem > | angVelPred |
| Kokkos::View< const int *, CpMem > | realIdx |
| float | growthRate |
| float | restitutionNormal |
| float | restVelThreshold |
| Kokkos::View< float, CpMem > | maxApproach |
| Kokkos::View< float, CpMem > | maxApproachQS |
| Kokkos::View< float *, CpMem > | lambdaAcc |
| Kokkos::View< const float *, CpMem > | vn0 |
| Kokkos::View< const unsigned char *, CpMem > | sideFlag |
| Kokkos::View< float *[3], CpMem > | lambdaT |
| float | frictionDynamic |
| Kokkos::View< const float *[3], CpMem > | vt0 |
| float | restitutionTangent |
| Kokkos::View< const float *, CpMem > | posImpulse |
| Kokkos::View< float *, CpMem > | restBank |
| Kokkos::View< float *, CpMem > | restRel |
| Kokkos::View< const float *, CpMem > | restVPeak |
| Kokkos::View< float *, CpMem > | restOrphan |
| Kokkos::View< const float *, CpMem > | restOrphanVPeak |
| SlotOverride | ov {} |
One full colored PGS sweep.
Per manifold: current approach vtil = s*vn, restitution target -e*vtil0 on every closed contact (Moreau; Poisson mode: Newton's -e*max(vtil0,0)) (e via the resting threshold on vn0), incremental impulse dp = (vtil-target)/w, accumulator projection p := max(0, p+dp), apply the applied difference in place. maxApproach records the largest applied velocity correction (physical units) for the adaptive stop.
The per-manifold solve body lives in PGSManifoldSweep so the colored sweep and the level-ordered ("multilevel") bucket sweep share it verbatim: solveOne(idx) must only run concurrently on manifolds that are body-disjoint within one launch (a colour class, or a (level, colour) bucket – a subset of a colour class).
Definition at line 1033 of file solver_velocity.hpp.
|
inline |
Linear velocity update of body slot real by the world-frame impulse dLin.
Definition at line 1117 of file solver_velocity.hpp.
References invMass, velPred, peclet::dem::F3::x, peclet::dem::F3::y, and peclet::dem::F3::z.
Referenced by releaseIncrement(), and solveOne().
|
inline |
Angular velocity update of body slot real by the world-frame angular impulse dAngWorld (rotated into the body frame, scaled by the diagonal inverse inertia, rotated back).
Definition at line 1125 of file solver_velocity.hpp.
References angVelPred, peclet::dem::invRotateVector(), peclet::dem::rotateVector(), peclet::dem::F3::x, peclet::dem::F3::y, and peclet::dem::F3::z.
Referenced by releaseIncrement(), and solveOne().
|
inline |
Residual record of one applied correction: the adaptive stop's maxApproach and, on quasi-static contacts, maxApproachQS.
Definition at line 1136 of file solver_velocity.hpp.
References maxApproach, maxApproachQS, restVelThreshold, and vn0.
Referenced by releaseIncrement(), and solveOne().
|
inlinestatic |
The pair's normal approach velocity along Nsum (arm sums TauA/TauB), growth included.
Definition at line 1143 of file solver_velocity.hpp.
References peclet::dem::dot3(), peclet::dem::PGSManifoldSweep::PairVelocity::vA, peclet::dem::PGSManifoldSweep::PairVelocity::vB, peclet::dem::PGSManifoldSweep::PairVelocity::wA, and peclet::dem::PGSManifoldSweep::PairVelocity::wB.
Referenced by weighRow().
|
inline |
Row, part 1: the manifold, its endpoints' slots, mass data and velocities, the averaged normal and arm sums and lenN.
Definition at line 1153 of file solver_velocity.hpp.
References angVelPred, peclet::dem::ManifoldC::bodyA, peclet::dem::ManifoldC::bodyB, peclet::dem::dot3(), invInertia, invMass, peclet::dem::detail::ld3(), manifolds, peclet::dem::ManifoldC::normal_sum, peclet::dem::ManifoldC::num_points, ov, quat, peclet::dem::ManifoldC::rA_sum, peclet::dem::ManifoldC::rB_sum, realIdx, peclet::dem::ManifoldC::restitution_sum, restitutionNormal, peclet::dem::scale3(), peclet::dem::ManifoldC::torque_armA_sum, peclet::dem::ManifoldC::torque_armB_sum, velPred, peclet::dem::ManifoldC::wallVel_sum, peclet::dem::F4::x, peclet::dem::F4::y, and peclet::dem::F4::z.
Referenced by solveOne().
|
inline |
Row, part 2: the approach velocity, the sign, the side gates and the effective mass.
Definition at line 1211 of file solver_velocity.hpp.
References peclet::dem::PGSManifoldSweep::Row::applyA, peclet::dem::PGSManifoldSweep::Row::applyB, peclet::dem::dot3(), peclet::dem::detail::genInvMass(), growthRate, peclet::dem::PGSManifoldSweep::Row::idB, peclet::dem::PGSManifoldSweep::Row::invIA, peclet::dem::PGSManifoldSweep::Row::invIB, peclet::dem::PGSManifoldSweep::Row::invMassA, peclet::dem::PGSManifoldSweep::Row::invMassB, normalVelocity(), peclet::dem::PGSManifoldSweep::Row::Nsum, peclet::dem::PGSManifoldSweep::Row::qA, peclet::dem::PGSManifoldSweep::Row::qB, peclet::dem::PGSManifoldSweep::Row::rAavg, peclet::dem::PGSManifoldSweep::Row::rBavg, peclet::dem::PGSManifoldSweep::Row::restitution, peclet::dem::scale3(), peclet::dem::PGSManifoldSweep::Row::sf, peclet::dem::PGSManifoldSweep::Row::sgn, sideFlag, peclet::dem::sub3(), peclet::dem::PGSManifoldSweep::Row::TauA, peclet::dem::PGSManifoldSweep::Row::TauB, peclet::dem::PGSManifoldSweep::Row::vel, peclet::dem::PGSManifoldSweep::Row::vGrowth, peclet::dem::PGSManifoldSweep::Row::vn, and peclet::dem::PGSManifoldSweep::Row::wTotal.
Referenced by solveOne().
|
inline |
One release increment: the budget-capped push toward the event's separation-velocity target, drawing orphan balance into the pair bank when its own budget rails.
Definition at line 1255 of file solver_velocity.hpp.
References applyAngular(), applyLinear(), drawOrphans(), peclet::dem::PGSManifoldSweep::Row::eMat, peclet::dem::PGSManifoldSweep::Row::idB, peclet::dem::PGSManifoldSweep::Row::invIA, peclet::dem::PGSManifoldSweep::Row::invIB, peclet::dem::PGSManifoldSweep::Row::invMassA, peclet::dem::PGSManifoldSweep::Row::invMassB, peclet::dem::PGSManifoldSweep::Row::lenN, peclet::dem::PGSManifoldSweep::Row::Nsum, peclet::dem::PGSManifoldSweep::ReleaseBudget::orphA, peclet::dem::PGSManifoldSweep::ReleaseBudget::orphB, peclet::dem::PGSManifoldSweep::ReleaseBudget::owed, peclet::dem::PGSManifoldSweep::Row::qA, peclet::dem::PGSManifoldSweep::Row::qB, peclet::dem::PGSManifoldSweep::Row::realA, peclet::dem::PGSManifoldSweep::Row::realB, recordCorrection(), restBank, restRel, peclet::dem::scale3(), peclet::dem::PGSManifoldSweep::Row::sgn, peclet::dem::PGSManifoldSweep::Row::TauA, peclet::dem::PGSManifoldSweep::Row::TauB, peclet::dem::PGSManifoldSweep::ReleaseBudget::vPeak, peclet::dem::PGSManifoldSweep::Row::wTotal, peclet::dem::F3::x, peclet::dem::F3::y, and peclet::dem::F3::z.
Referenced by solveOne().
|
inline |
Draw up to need from the endpoints' orphan balances (A first, then B); returns the amount drawn.
Definition at line 1319 of file solver_velocity.hpp.
References restOrphan.
Referenced by releaseIncrement().
|
inline |
Definition at line 1336 of file solver_velocity.hpp.
References peclet::dem::add3(), angVelPred, peclet::dem::PGSManifoldSweep::Row::applyA, applyAngular(), peclet::dem::PGSManifoldSweep::Row::applyB, applyLinear(), peclet::dem::cross3v(), peclet::dem::dot3(), peclet::dem::PGSManifoldSweep::Row::eMat, peclet::dem::ManifoldC::friction_sum, frictionDynamic, gatherRow(), peclet::dem::detail::genInvMass(), peclet::dem::PGSManifoldSweep::Row::idB, peclet::dem::PGSManifoldSweep::Row::invIA, peclet::dem::PGSManifoldSweep::Row::invIB, peclet::dem::PGSManifoldSweep::Row::invMassA, peclet::dem::PGSManifoldSweep::Row::invMassB, peclet::dem::PGSManifoldSweep::Row::invN, lambdaAcc, lambdaT, peclet::dem::detail::ld3(), peclet::dem::PGSManifoldSweep::Row::lenN, peclet::dem::PGSManifoldSweep::Row::m, peclet::dem::PGSManifoldSweep::Row::Nsum, ov, posImpulse, peclet::dem::PGSManifoldSweep::Row::qA, peclet::dem::PGSManifoldSweep::Row::qB, peclet::dem::PGSManifoldSweep::Row::rAavg, peclet::dem::PGSManifoldSweep::Row::rBavg, peclet::dem::PGSManifoldSweep::Row::realA, peclet::dem::PGSManifoldSweep::Row::realB, recordCorrection(), releaseIncrement(), restBank, peclet::dem::PGSManifoldSweep::Row::restitution, restitutionTangent, restOrphan, restOrphanVPeak, restRel, restVelThreshold, restVPeak, peclet::dem::scale3(), peclet::dem::PGSManifoldSweep::Row::sf, peclet::dem::PGSManifoldSweep::Row::sgn, peclet::dem::sub3(), peclet::dem::PGSManifoldSweep::Row::TauA, peclet::dem::PGSManifoldSweep::Row::TauB, velPred, peclet::dem::PGSManifoldSweep::Row::vGrowth, peclet::dem::PGSManifoldSweep::Row::vn, vn0, vt0, peclet::dem::ManifoldC::wallVel_sum, weighRow(), peclet::dem::PGSManifoldSweep::Row::wTotal, peclet::dem::F3::x, peclet::dem::F4::x, peclet::dem::F3::y, peclet::dem::F4::y, peclet::dem::F3::z, and peclet::dem::F4::z.
Referenced by peclet::dem::solveVelocityPGS(), and peclet::dem::solveVelocityPGSBuckets().
Definition at line 1034 of file solver_velocity.hpp.
Referenced by gatherRow().
| Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::invMass |
Definition at line 1035 of file solver_velocity.hpp.
Referenced by applyLinear(), and gatherRow().
| Kokkos::View<const float* [3], CpMem> peclet::dem::PGSManifoldSweep::invInertia |
Definition at line 1036 of file solver_velocity.hpp.
Referenced by gatherRow().
| Kokkos::View<const float* [4], CpMem> peclet::dem::PGSManifoldSweep::quat |
Definition at line 1037 of file solver_velocity.hpp.
Referenced by gatherRow().
| Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::velPred |
Definition at line 1038 of file solver_velocity.hpp.
Referenced by applyLinear(), gatherRow(), and solveOne().
| Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::angVelPred |
Definition at line 1039 of file solver_velocity.hpp.
Referenced by applyAngular(), gatherRow(), and solveOne().
| Kokkos::View<const int*, CpMem> peclet::dem::PGSManifoldSweep::realIdx |
Definition at line 1040 of file solver_velocity.hpp.
Referenced by gatherRow().
| float peclet::dem::PGSManifoldSweep::growthRate |
Definition at line 1041 of file solver_velocity.hpp.
Referenced by weighRow().
| float peclet::dem::PGSManifoldSweep::restitutionNormal |
Definition at line 1042 of file solver_velocity.hpp.
Referenced by gatherRow().
| float peclet::dem::PGSManifoldSweep::restVelThreshold |
Definition at line 1043 of file solver_velocity.hpp.
Referenced by recordCorrection(), and solveOne().
| Kokkos::View<float, CpMem> peclet::dem::PGSManifoldSweep::maxApproach |
Definition at line 1044 of file solver_velocity.hpp.
Referenced by recordCorrection().
| Kokkos::View<float, CpMem> peclet::dem::PGSManifoldSweep::maxApproachQS |
Definition at line 1048 of file solver_velocity.hpp.
Referenced by recordCorrection(), and peclet::dem::solveVelocityPGS().
| Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::lambdaAcc |
Definition at line 1049 of file solver_velocity.hpp.
Referenced by solveOne().
| Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::vn0 |
Definition at line 1050 of file solver_velocity.hpp.
Referenced by recordCorrection(), and solveOne().
| Kokkos::View<const unsigned char*, CpMem> peclet::dem::PGSManifoldSweep::sideFlag |
Definition at line 1051 of file solver_velocity.hpp.
Referenced by weighRow().
| Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::lambdaT |
Definition at line 1052 of file solver_velocity.hpp.
Referenced by solveOne().
| float peclet::dem::PGSManifoldSweep::frictionDynamic |
Definition at line 1053 of file solver_velocity.hpp.
Referenced by solveOne().
| Kokkos::View<const float* [3], CpMem> peclet::dem::PGSManifoldSweep::vt0 |
Definition at line 1054 of file solver_velocity.hpp.
Referenced by solveOne().
| float peclet::dem::PGSManifoldSweep::restitutionTangent |
Definition at line 1055 of file solver_velocity.hpp.
Referenced by solveOne().
| Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::posImpulse |
Definition at line 1056 of file solver_velocity.hpp.
Referenced by solveOne().
| Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restBank |
Definition at line 1068 of file solver_velocity.hpp.
Referenced by releaseIncrement(), and solveOne().
| Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restRel |
Definition at line 1069 of file solver_velocity.hpp.
Referenced by releaseIncrement(), and solveOne().
| Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::restVPeak |
Definition at line 1074 of file solver_velocity.hpp.
Referenced by solveOne().
| Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restOrphan |
Definition at line 1079 of file solver_velocity.hpp.
Referenced by drawOrphans(), and solveOne().
| Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::restOrphanVPeak |
Definition at line 1080 of file solver_velocity.hpp.
Referenced by solveOne().
| SlotOverride peclet::dem::PGSManifoldSweep::ov {} |
Definition at line 1083 of file solver_velocity.hpp.
Referenced by gatherRow(), and solveOne().