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

Soft-sphere Hertz–Mindlin DEM (reference force model) for SPHERES. More...

#include <Kokkos_Core.hpp>
#include <Kokkos_Sort.hpp>
#include "contact_preprocessing.hpp"
#include "narrowphase.hpp"
#include "particles.hpp"

Go to the source code of this file.

Classes

struct  peclet::dem::HertzMaterials
 The Hertz–Mindlin contact materials: each body's material id, the optional pair table of (e, mu) (empty = the global eGlobal / muGlobal for every pair, see hertzPairEMu), and the per-material Young's modulus and Poisson ratio. More...
struct  peclet::dem::HertzBodies
 The body state a Hertz force launcher reads. More...
struct  peclet::dem::HertzShapes
 What a non-spherical Hertz contact reads: orientation, scale, shape id, the shape registry and its shell points, the global scale and the shell spring's contact-radius fraction. More...
struct  peclet::dem::HertzWallState
 The SDF walls and their per-(particle, wall) contact history at slot i * maxWalls + wall: the Mindlin tangential spring xiWall and the shell's normal stiffness snWall (empty = untracked). More...

Namespaces

namespace  peclet
namespace  peclet::dem

Functions

void peclet::dem::hertzPairEMu (int matA, int matB, PairTableView pairTable, float eGlobal, float muGlobal, float &e, float &mu)
 Pairwise (e, mu) lookup shared with the narrowphase convention: pair table if present, global fallback otherwise.
float peclet::dem::hertzBetaD (float e)
 Restitution -> damping ratio beta_d = ln e / sqrt(ln^2 e + pi^2) (e in (0, 1]; e <= 0 -> -1, the critically-damped limit used by LIGGGHTS for e -> 0).
F3 peclet::dem::hertzForce (float delta, F3 nhat, F3 vrel, float rStar, float mStar, float eStar, float gStar, float e, float mu, float dt, F3 &xi)
 One Hertz–Mindlin force evaluation for a sphere-sphere or sphere-wall contact.
float peclet::dem::hertzSphereRadius (int i, Kokkos::View< const float *, CpMem > rad, Kokkos::View< const float *, CpMem > scale, ScalarI shapeId, Kokkos::View< const ShapeDesc *, CpMem > shapes, float globalScale)
 A body's Hertz sphere radius: a SPHERE shape's own radius, scale * globalScale * params.x (the radius the XPBD narrow phase probes with); otherwise the world reach radius rad(i).
void peclet::dem::hertzPairForces (Kokkos::View< const int *[2], CpMem > pairs, int numPairs, const HertzBodies &bodies, const HertzMaterials &mat, float dt, Kokkos::View< float *[3], CpMem > xi, Kokkos::View< float *[3], CpMem > force, Kokkos::View< float *[3], CpMem > torque, const HertzShapes &shp={})
 Cached-pair forces: overlap from current positions; history resets when a cached pair is currently separated.
void peclet::dem::hertzWallEMu (int ma, const WallSdf &w, PairTableView pairTable, float eGlobal, float muGlobal, float &e, float &mu)
 A particle-wall pair's (e, mu): the wall's material id through the pair table when both are set, else the wall's own binary material.
F3 peclet::dem::wallSdfGradient (F3 q, const WallSdf &w, GridView wallGrid)
 The wall SDF's gradient at q by central differences at half a grid cell (unnormalized).
void peclet::dem::hertzWallForces (Kokkos::View< const int *, CpMem > candSlots, int numCand, const HertzWallState &wall, const HertzBodies &bodies, const HertzMaterials &mat, float dt, Kokkos::View< float *[3], CpMem > force, Kokkos::View< float *[3], CpMem > torque, const HertzShapes &shp={})
 SDF-wall forces (per particle x wall).
int peclet::dem::hertzBuildWallCandidates (int numReal, int numWalls, Kokkos::View< const WallSdf *, CpMem > walls, GridView wallGrid, Kokkos::View< const float *[3], CpMem > pos, Kokkos::View< const float *, CpMem > rad, float skin, Kokkos::View< int *, CpMem > outSlots, Kokkos::View< int, CpMem > outCount)
 Build the wall candidate list: particles within (radius + skin) of any wall's zero level.
void peclet::dem::hertzIntegrate (int numReal, Kokkos::View< float *[3], CpMem > force, Kokkos::View< float *[3], CpMem > torque, const BodyState &bodies, F3 gravity, float dt, bool integrateOrientation=false)
 Symplectic-Euler kick-drift (MUSEN-style) + displacement tracking for the Verlet rebuild.
float peclet::dem::hertzMaxDisp2 (int numReal, Kokkos::View< const float *[3], CpMem > pos, Kokkos::View< const float *[3], CpMem > refPos)
 Max squared displacement since the last pair build (called only at rebuild checks – keeping this out of the integrate kernel avoids a per-step single-address atomic).
void peclet::dem::hertzShapePairForces (Kokkos::View< const int *[2], CpMem > pairs, int numPairs, const HertzBodies &bodies, const HertzShapes &shp, GridView sdfGrid, const HertzMaterials &mat, float dt, Kokkos::View< float *[3], CpMem > xi, Kokkos::View< float *, CpMem > snPrev, Kokkos::View< float *[3], CpMem > force, Kokkos::View< float *[3], CpMem > torque)
 Non-spherical pairs: per-point Hertz springs over A's point shell against B's SDF (the same one-sided sampling convention as the narrowphase), ONE Mindlin patch history per pair.

Detailed Description

Soft-sphere Hertz–Mindlin DEM (reference force model) for SPHERES.

The benchmark contact model of Dosta et al. (2024): viscoelastic Hertz normal force with restitution-matched damping + "no-slip" Mindlin tangential spring with history, Coulomb-clamped (LIGGGHTS gran model hertz tangential history formulas). This is an explicit force model — time step limited by the Rayleigh time — living beside the impulse (XPBD/NSCD) solver as a physics reference and cross-check. Spheres only, non-periodic domains, SDF walls (no planes).

Structure: a cached Verlet pair list (broadphase margin = skin, rebuilt when any particle has moved skin/2) carries the per-pair tangential history xi through its slots; on rebuild the history is carried over by pair key. Wall contacts are evaluated per particle per wall each step with per-(particle, wall) history. The inner time loop runs device-side per call.

Definition in file solver_hertz.hpp.