peclet-dem 1.1.0
Performance-portable XPBD Discrete Element Method (Kokkos + ArborX)
Loading...
Searching...
No Matches
peclet::dem::PGSManifoldSweep Struct Reference

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 {}

Detailed Description

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.

Member Function Documentation

◆ applyLinear()

void peclet::dem::PGSManifoldSweep::applyLinear ( int real,
F3 dLin,
float invMass ) const
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().

◆ applyAngular()

void peclet::dem::PGSManifoldSweep::applyAngular ( int real,
F3 dAngWorld,
F3 invI,
F4 q ) const
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().

◆ recordCorrection()

void peclet::dem::PGSManifoldSweep::recordCorrection ( int idx,
float lenN,
float corr ) const
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().

◆ normalVelocity()

float peclet::dem::PGSManifoldSweep::normalVelocity ( const PairVelocity & v,
F3 Nsum,
F3 TauA,
F3 TauB,
F3 vGrowth )
inlinestatic

◆ gatherRow()

◆ weighRow()

◆ releaseIncrement()

◆ drawOrphans()

float peclet::dem::PGSManifoldSweep::drawOrphans ( int realA,
int realB,
float need,
float orphA,
float orphB ) const
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().

◆ solveOne()

void peclet::dem::PGSManifoldSweep::solveOne ( int idx) const
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().

Member Data Documentation

◆ manifolds

Kokkos::View<const ManifoldC*, CpMem> peclet::dem::PGSManifoldSweep::manifolds

Definition at line 1034 of file solver_velocity.hpp.

Referenced by gatherRow().

◆ invMass

Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::invMass

Definition at line 1035 of file solver_velocity.hpp.

Referenced by applyLinear(), and gatherRow().

◆ invInertia

Kokkos::View<const float* [3], CpMem> peclet::dem::PGSManifoldSweep::invInertia

Definition at line 1036 of file solver_velocity.hpp.

Referenced by gatherRow().

◆ quat

Kokkos::View<const float* [4], CpMem> peclet::dem::PGSManifoldSweep::quat

Definition at line 1037 of file solver_velocity.hpp.

Referenced by gatherRow().

◆ velPred

Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::velPred

Definition at line 1038 of file solver_velocity.hpp.

Referenced by applyLinear(), gatherRow(), and solveOne().

◆ angVelPred

Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::angVelPred

Definition at line 1039 of file solver_velocity.hpp.

Referenced by applyAngular(), gatherRow(), and solveOne().

◆ realIdx

Kokkos::View<const int*, CpMem> peclet::dem::PGSManifoldSweep::realIdx

Definition at line 1040 of file solver_velocity.hpp.

Referenced by gatherRow().

◆ growthRate

float peclet::dem::PGSManifoldSweep::growthRate

Definition at line 1041 of file solver_velocity.hpp.

Referenced by weighRow().

◆ restitutionNormal

float peclet::dem::PGSManifoldSweep::restitutionNormal

Definition at line 1042 of file solver_velocity.hpp.

Referenced by gatherRow().

◆ restVelThreshold

float peclet::dem::PGSManifoldSweep::restVelThreshold

Definition at line 1043 of file solver_velocity.hpp.

Referenced by recordCorrection(), and solveOne().

◆ maxApproach

Kokkos::View<float, CpMem> peclet::dem::PGSManifoldSweep::maxApproach

Definition at line 1044 of file solver_velocity.hpp.

Referenced by recordCorrection().

◆ maxApproachQS

Kokkos::View<float, CpMem> peclet::dem::PGSManifoldSweep::maxApproachQS

Definition at line 1048 of file solver_velocity.hpp.

Referenced by recordCorrection(), and peclet::dem::solveVelocityPGS().

◆ lambdaAcc

Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::lambdaAcc

Definition at line 1049 of file solver_velocity.hpp.

Referenced by solveOne().

◆ vn0

Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::vn0

Definition at line 1050 of file solver_velocity.hpp.

Referenced by recordCorrection(), and solveOne().

◆ sideFlag

Kokkos::View<const unsigned char*, CpMem> peclet::dem::PGSManifoldSweep::sideFlag

Definition at line 1051 of file solver_velocity.hpp.

Referenced by weighRow().

◆ lambdaT

Kokkos::View<float* [3], CpMem> peclet::dem::PGSManifoldSweep::lambdaT

Definition at line 1052 of file solver_velocity.hpp.

Referenced by solveOne().

◆ frictionDynamic

float peclet::dem::PGSManifoldSweep::frictionDynamic

Definition at line 1053 of file solver_velocity.hpp.

Referenced by solveOne().

◆ vt0

Kokkos::View<const float* [3], CpMem> peclet::dem::PGSManifoldSweep::vt0

Definition at line 1054 of file solver_velocity.hpp.

Referenced by solveOne().

◆ restitutionTangent

float peclet::dem::PGSManifoldSweep::restitutionTangent

Definition at line 1055 of file solver_velocity.hpp.

Referenced by solveOne().

◆ posImpulse

Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::posImpulse

Definition at line 1056 of file solver_velocity.hpp.

Referenced by solveOne().

◆ restBank

Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restBank

Definition at line 1068 of file solver_velocity.hpp.

Referenced by releaseIncrement(), and solveOne().

◆ restRel

Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restRel

Definition at line 1069 of file solver_velocity.hpp.

Referenced by releaseIncrement(), and solveOne().

◆ restVPeak

Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::restVPeak

Definition at line 1074 of file solver_velocity.hpp.

Referenced by solveOne().

◆ restOrphan

Kokkos::View<float*, CpMem> peclet::dem::PGSManifoldSweep::restOrphan

Definition at line 1079 of file solver_velocity.hpp.

Referenced by drawOrphans(), and solveOne().

◆ restOrphanVPeak

Kokkos::View<const float*, CpMem> peclet::dem::PGSManifoldSweep::restOrphanVPeak

Definition at line 1080 of file solver_velocity.hpp.

Referenced by solveOne().

◆ ov

SlotOverride peclet::dem::PGSManifoldSweep::ov {}

Definition at line 1083 of file solver_velocity.hpp.

Referenced by gatherRow(), and solveOne().


The documentation for this struct was generated from the following file: