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

Host-facing facade with std::vector setters/getters (binding-agnostic). More...

#include <sim.hpp>

Inheritance diagram for peclet::dem::Simulation:
peclet::dem::ShapeRegistry

Public Member Functions

 Simulation (int capacity)
 
 ~Simulation ()
 
void releaseViews ()
 
int addAnalyticWall (const std::vector< int > &nodeInts, const std::vector< float > &nodeReals, int root, bool invert, float restitution, float friction)
 Add an ANALYTIC wall from a core shape tree in the flat encoding (Layer 1).
 
void setDomain (float lx, float ly, float lz, bool px, bool py, bool pz)
 
void setDomainMinMax (F3 mn, F3 mx)
 
void enablePeriodicity (bool x, bool y, bool z)
 
void setDomainCanonical (F3 extent, F3 origin, bool px, bool py, bool pz)
 
std::tuple< float, float, float > domainOrigin () const
 
std::tuple< float, float, float > domainExtent () const
 
std::tuple< bool, bool, bool > domainPeriodic () const
 
void setGravity (float gx, float gy, float gz)
 
std::tuple< float, float, float > gravity () const
 
void setThermostat (float temperature, float tau, float kB)
 
void setSolverIterations (int pos, int vel)
 
void setVelocityUseGS (bool useGS)
 
bool velocityUseGS () const
 
void setStabilizationMode (const std::string &mode)
 Select the stabilization pass of the staged velocity solve: "off" (pure symmetric PGS), "onesided" (default: held-lower-side grounded impulses – arrests any collapse but is a momentum sink), "multilevel" (GraphMG contact-graph aggregation: coarse inelastic solves at super-body masses – momentum-conserving transport acceleration), "escalate" (extra symmetric sweeps up to 256; diagnostic/fallback), "ordered" (level-ordered symmetric sweeps; measurement mode, known insufficient for deep columns).
 
std::string stabilizationMode () const
 
void setRestitutionModel (const std::string &model)
 Restitution model of the PGS velocity solve: "newton" (default; per-substep restitution with Moreau's target, -e x the pre-solve normal velocity on every closed contact above the resting threshold — docs/contact_physics_followups.md §4) or "poisson" (event-level: each pair banks its kinetic compression impulse and releases e x the bank as a budget-capped separation-velocity target during unloading — restores the multi-substep-impact rebound that per-substep restitution structurally cannot return; it keeps Newton's per-substep targets, -e x the approach on approaching contacts only, R-C4).
 
std::string restitutionModel () const
 
void setSleeping (bool enabled, float threshold_scale=2.0f, int consecutive=64, float wake_scale=40.0f, bool wake_on_lost_contact=false, float immovable_frac=0.01f)
 Island sleeping / freezing (single-GPU statics, default ON; enabled=False disables).
 
bool sleeping () const
 True while island sleeping is enabled.
 
void setVerletSkin (float skin_frac)
 Verlet-cached impulse broadphase (single-GPU, non-periodic; default OFF).
 
float verletSkin () const
 
void setCudaGraphs (bool enabled)
 CUDA-graph replay of the solver's iteration loops (single-rank CUDA; default ON).
 
bool cudaGraphs () const
 
void setFusedSweeps (const std::string &mode)
 Fused colour sweeps (CUDA): run a whole sweep — and where eligible the whole adaptive iteration loop — as ONE kernel iterating device-side behind software grid barriers.
 
std::string fusedSweeps () const
 
void setIncrementalColoring (bool enabled)
 Incremental (warm-started) graph colouring of the contact manifolds (default ON): reuse last substep's colours and repair only the conflicts instead of recolouring from scratch.
 
bool incrementalColoring () const
 
void setShellDetection (const std::string &mode)
 Narrow-phase shell detection of the XPBD engine (step / step_mpi / relax / compute_overlaps; the Hertz engine is unaffected): "one_way" (default: the lower-index body's shell points against the other's SDF) or "two_way" (shell pairs are probed from both sides, and a sphere-shell pair always takes the exact sphere probe).
 
std::string shellDetection () const
 
int numAsleep ()
 Number of currently-sleeping real bodies (diagnostics / tests).
 
void setHertzMaterial (int mat, float youngs, float poisson)
 Per-material Young's modulus + Poisson ratio for the Hertz-Mindlin engine (material ids as in setMaterialIds; without ids every particle is material 0).
 
void stepHertz (int substeps, float skin_frac)
 Advance substeps explicit soft-sphere Hertz-Mindlin steps of the stored dt (device-side loop; the (e, mu) pairs come from the impulse solver's material tables).
 
void setGlobalScale (float s)
 
float globalScale () const
 
void setDt (float dt)
 The time step every stepper uses (suite/docs/NAMING.md 1.5).
 
float dt () const
 
int capacity () const
 
void setMaterialParams (float restitution_normal, float restitution_tangent, float friction)
 
void setMaterialIds (const std::vector< int > &ids)
 Per-particle material ids (0..kMaxMaterials-1); pair (e, mu) values come from setPairMaterial.
 
void setPairMaterial (int a, int b, float restitution, float friction)
 Set the symmetric pair material (restitution, friction) for material ids (a, b).
 
void setWallMaterialId (int wid, int mat)
 Give an SDF wall a material id so particle-wall (e, mu) also resolves via the pair table.
 
void addPlane (float px, float py, float pz, float nx, float ny, float nz)
 
int addSdfWall (const std::vector< float > &grid, int nx, int ny, int nz, F3 origin, F3 spacing, float restitution, float friction)
 
void setWallVelocity (int wallIndex, F3 linVel, F3 angVel, F3 center)
 
void setWallTransform (int wallIndex, F3 translation, float qx, float qy, float qz, float qw)
 
std::vector< float > wallSdfAt (int wallIndex, const std::vector< float > &pts) const
 
void setPositions (const std::vector< float > &xyz)
 
void setScalesUniform (float s)
 
void setScales (const std::vector< float > &s)
 
void setVelocities (const std::vector< float > &v)
 
void setExternalForces (const std::vector< float > &f)
 
void clearExternalForces ()
 
void setExternalTorques (const std::vector< float > &t)
 
void clearExternalTorques ()
 
const V3 & externalTorquesView () const
 
const V3 & externalForcesView () const
 
const Vf & invMassView () const
 
void setQuaternions (const std::vector< float > &q)
 
void setAngularVelocities (const std::vector< float > &w)
 
void setInvInertia (const std::vector< float > &ii)
 
void setInvMass (const std::vector< float > &im)
 
std::vector< float > getAngularVelocities () const
 
std::vector< float > getInvInertia () const
 
void setGrowthParams (float rate, float new_factor)
 
float growthFactor () const
 
float getGrowthRate () const
 
std::vector< float > getMasses () const
 
std::vector< float > getPositions () const
 
std::vector< float > getVelocities () const
 
std::vector< float > getQuaternions () const
 
std::vector< float > getScales () const
 
void step (int n=1)
 Advance n XPBD substeps of the stored dt (set_dt first; suite/docs/NAMING.md 1.5).
 
void relax (int n=1)
 n dynamics-free RELAXATION substeps (overlap removal only, no gravity / velocity update): the growth-packing protocol's "settle" move.
 
float computeOverlaps ()
 
void exportLammps (const std::string &filename, int step) const
 
void exportSdf (const std::string &filename, int rx, int ry, int rz)
 
std::vector< float > getSdfGrid (int rx, int ry, int rz)
 
int numParticles () const
 
const V3 & positionsView () const
 
const V3 & velocitiesView () const
 
int numContacts ()
 
int numManifolds ()
 
std::pair< int, int > debugColoringConflicts ()
 
std::pair< int, int > debugColoringLeftovers ()
 
int debugMultilevelColoringConflicts ()
 
peclet::dem::SplitStats debugSplitStats () const
 
float maxOverlap ()
 
std::tuple< double, float, int > restBankStats ()
 Poisson-restitution diagnostics: (sum, max, count>0) of the committed per-pair owed separation impulse (prevRestBank[0:prevPairCount], physical units).
 
std::tuple< double, float, int > restOrphanStats ()
 Orphan-account diagnostics: (sum, max, count>0) of the per-body orphaned budget.
 
void writeVtp (const std::string &filename) const
 
- Public Member Functions inherited from peclet::dem::ShapeRegistry
void setSphereShape (float radius)
 
void initializeShape (int shape_type, float radius, float height, float thickness)
 
int addShape (int shape_type, float radius, float height, float thickness)
 Append an analytic shape and return its index, for simulations with a MIXTURE of shapes.
 
void setShapeIds (const std::vector< int > &ids)
 Per-particle shape assignment.
 
int addSdfShape (const std::vector< float > &grid, int nx, int ny, int nz, F3 origin, F3 spacing, const std::vector< float > &shellFlat, F3 invInertia, float boundingRadius)
 Append a grid-SDF shape (the general non-spherical particle) to the mixture and return its index.
 
int numShapes () const
 
void setSdfShape (const std::vector< float > &grid, int nx, int ny, int nz, F3 origin, F3 spacing, const std::vector< float > &shellFlat, F3 invInertia, float boundingRadius)
 
int addSceneShape (const std::vector< int > &nodeInts, const std::vector< float > &nodeReals, int root, const std::vector< float > &shellFlat, F3 invInertia, float boundingRadius)
 
std::vector< float > autoShell (const std::vector< float > &grid, int nx, int ny, int nz, F3 origin, F3 spacing, float boundingRadius) const
 Generate a collision shell for a grid SDF by sampling its own zero level set, so a caller does not have to supply one.
 

Static Public Member Functions

static void releaseAll ()
 
static std::vector< Simulation * > & registry ()
 

Additional Inherited Members

- Protected Member Functions inherited from peclet::dem::ShapeRegistry
void ensureContactCapacity ()
 
void clearShapes ()
 
void appendShape (ShapeDesc sd, const std::vector< F3 > &shell, F3 invI, float baseRadius)
 Append one shape, taking ownership of its shell.
 
void uploadShapes ()
 Rebuild the device Views from the host registry.
 
- Protected Attributes inherited from peclet::dem::ShapeRegistry
Particles P_
 
float baseRadius_ = 1.0f
 
std::vector< ShapeDesc > shapesHost_
 
std::vector< F3 > shellHost_
 
std::vector< F3 > invIHost_
 
std::vector< float > baseRadiusHost_
 
std::vector< float > sdfSamplesHost_
 
int shellPoints_ = 0
 
std::vector< peclet::core::geom::ShapeNode< float > > shapeNodesHost_
 
F3 defaultInvI_ {2.5f, 2.5f, 2.5f}
 

Detailed Description

Host-facing facade with std::vector setters/getters (binding-agnostic).

Definition at line 56 of file sim.hpp.

Constructor & Destructor Documentation

◆ Simulation()

peclet::dem::Simulation::Simulation ( int  capacity)
inlineexplicit

◆ ~Simulation()

peclet::dem::Simulation::~Simulation ( )
inline

Definition at line 64 of file sim.hpp.

References registry().

Member Function Documentation

◆ releaseViews()

void peclet::dem::Simulation::releaseViews ( )
inline

Definition at line 73 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_.

◆ releaseAll()

static void peclet::dem::Simulation::releaseAll ( )
inlinestatic

Definition at line 81 of file sim.hpp.

References registry().

Referenced by NB_MODULE().

◆ registry()

static std::vector< Simulation * > & peclet::dem::Simulation::registry ( )
inlinestatic

Definition at line 85 of file sim.hpp.

Referenced by releaseAll(), Simulation(), and ~Simulation().

◆ addAnalyticWall()

int peclet::dem::Simulation::addAnalyticWall ( const std::vector< int > &  nodeInts,
const std::vector< float > &  nodeReals,
int  root,
bool  invert,
float  restitution,
float  friction 
)
inline

Add an ANALYTIC wall from a core shape tree in the flat encoding (Layer 1).

Replaces the voxelised container/stirrer: exact at every scale, and no per-rank replicated sample pool.

nodeInts / nodeReals are core's flat node encoding (geom/scene_builder.hpp: 3 ints and 16 reals per node, kind/aux/params/transform).

SIGN. A wall must read POSITIVE in the void where the grains live and NEGATIVE in wall material; core's leaves are negative-inside-solid. So:

  • a STIRRER, a paddle, an obstacle – grains are OUTSIDE the tree's solid: invert = FALSE.
  • a CONTAINER – grains are INSIDE: describe the container as a SOLID body (a solid cylinder for a drum: kHollowCylinder with thickness = 2*rOuter) and pass invert = TRUE. Inverting a solid is what makes everything beyond the barrel read as wall, so a grain that escapes is pushed back.

Do NOT build a container from a thin TUBE and invert it: a tube's bore is already void, so inverting makes the bore read as solid and the solver pushes every grain out through it.

POSITION. An analytic wall is placed by its node TRANSFORM. Unlike add_sdf_wall, where the grid origin positions the field implicitly, a leaf with an identity transform sits at the ORIGIN – which is a domain corner in the usual [0,L]^3 setup, not the centre. Getting this wrong looks exactly like a sign error: grains start outside the body, read "solid", and are driven out of the domain.

Grid leaves are not supported inside an analytic wall tree – use add_sdf_wall for a sampled container.

Definition at line 115 of file sim.hpp.

References peclet::dem::ShapeRegistry::ensureContactCapacity(), peclet::dem::Particles::numWalls, peclet::dem::ShapeRegistry::P_, peclet::dem::WallSdf::shapeRoot, and peclet::dem::Particles::wallNodes.

Referenced by NB_MODULE().

◆ setDomain()

void peclet::dem::Simulation::setDomain ( float  lx,
float  ly,
float  lz,
bool  px,
bool  py,
bool  pz 
)
inline

◆ setDomainMinMax()

◆ enablePeriodicity()

void peclet::dem::Simulation::enablePeriodicity ( bool  x,
bool  y,
bool  z 
)
inline

◆ setDomainCanonical()

void peclet::dem::Simulation::setDomainCanonical ( F3  extent,
F3  origin,
bool  px,
bool  py,
bool  pz 
)
inline

◆ domainOrigin()

std::tuple< float, float, float > peclet::dem::Simulation::domainOrigin ( ) const
inline

◆ domainExtent()

std::tuple< float, float, float > peclet::dem::Simulation::domainExtent ( ) const
inline

◆ domainPeriodic()

std::tuple< bool, bool, bool > peclet::dem::Simulation::domainPeriodic ( ) const
inline

◆ setGravity()

void peclet::dem::Simulation::setGravity ( float  gx,
float  gy,
float  gz 
)
inline

Definition at line 201 of file sim.hpp.

References peclet::dem::Particles::gravity, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ gravity()

std::tuple< float, float, float > peclet::dem::Simulation::gravity ( ) const
inline

◆ setThermostat()

void peclet::dem::Simulation::setThermostat ( float  temperature,
float  tau,
float  kB 
)
inline

◆ setSolverIterations()

void peclet::dem::Simulation::setSolverIterations ( int  pos,
int  vel 
)
inline

◆ setVelocityUseGS()

void peclet::dem::Simulation::setVelocityUseGS ( bool  useGS)
inline

◆ velocityUseGS()

bool peclet::dem::Simulation::velocityUseGS ( ) const
inline

◆ setStabilizationMode()

void peclet::dem::Simulation::setStabilizationMode ( const std::string &  mode)
inline

Select the stabilization pass of the staged velocity solve: "off" (pure symmetric PGS), "onesided" (default: held-lower-side grounded impulses – arrests any collapse but is a momentum sink), "multilevel" (GraphMG contact-graph aggregation: coarse inelastic solves at super-body masses – momentum-conserving transport acceleration), "escalate" (extra symmetric sweeps up to 256; diagnostic/fallback), "ordered" (level-ordered symmetric sweeps; measurement mode, known insufficient for deep columns).

Definition at line 224 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::stabilizationMode.

Referenced by NB_MODULE().

◆ stabilizationMode()

std::string peclet::dem::Simulation::stabilizationMode ( ) const
inline

Definition at line 240 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::stabilizationMode.

Referenced by NB_MODULE().

◆ setRestitutionModel()

void peclet::dem::Simulation::setRestitutionModel ( const std::string &  model)
inline

Restitution model of the PGS velocity solve: "newton" (default; per-substep restitution with Moreau's target, -e x the pre-solve normal velocity on every closed contact above the resting threshold — docs/contact_physics_followups.md §4) or "poisson" (event-level: each pair banks its kinetic compression impulse and releases e x the bank as a budget-capped separation-velocity target during unloading — restores the multi-substep-impact rebound that per-substep restitution structurally cannot return; it keeps Newton's per-substep targets, -e x the approach on approaching contacts only, R-C4).

Definition at line 251 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::restitutionModel.

Referenced by NB_MODULE().

◆ restitutionModel()

std::string peclet::dem::Simulation::restitutionModel ( ) const
inline

Definition at line 259 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::restitutionModel.

Referenced by NB_MODULE().

◆ setSleeping()

void peclet::dem::Simulation::setSleeping ( bool  enabled,
float  threshold_scale = 2.0f,
int  consecutive = 64,
float  wake_scale = 40.0f,
bool  wake_on_lost_contact = false,
float  immovable_frac = 0.01f 
)
inline

Island sleeping / freezing (single-GPU statics, default ON; enabled=False disables).

A REAL body whose linear AND angular motion stays below scale x the resting floor (2 dt |g|) for K substeps while grounded is put to sleep: velocity zeroed, integration skipped, and a manifold whose BOTH endpoints are asleep (a static wall counts) is excluded from the colouring / sweeps / multilevel hierarchy — so a settled bed collapses to the broad/narrow-phase floor. A sleeper keeps a small POSITIVE effective inverse mass in the solve (sleepImmovableFrac x its own; heavy but not perfectly rigid), so an awake body wedged between sleepers relieves against them instead of the PGS normal impulse diverging; its velocity is re-zeroed each substep so no momentum accumulates. It wakes only when disturbed (fast approaching neighbour, contact-set change, moving wall). Requires gravity on and no external (CFD-DEM drag) force; inert under MPI. wake_on_lost_contact additionally wakes a sleeper whose support disappeared (rule (b)); immovable_frac is the sleeper's effective inverse-mass fraction in the solve (0 = exactly immovable; the default 0.01 keeps it 100x a grain's mass but not infinitely rigid).

Definition at line 275 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, peclet::dem::Particles::sleepImmovableFrac, peclet::dem::Particles::sleepingEnabled, peclet::dem::Particles::sleepK, peclet::dem::Particles::sleepScale, peclet::dem::Particles::sleepWakeLostContact, and peclet::dem::Particles::wakeScale.

Referenced by NB_MODULE().

◆ sleeping()

bool peclet::dem::Simulation::sleeping ( ) const
inline

True while island sleeping is enabled.

Definition at line 290 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::sleepingEnabled.

Referenced by NB_MODULE().

◆ setVerletSkin()

void peclet::dem::Simulation::setVerletSkin ( float  skin_frac)
inline

Verlet-cached impulse broadphase (single-GPU, non-periodic; default OFF).

skin_frac is the broadphase-skin fraction of the max grain radius: the ArborX rebuild is skipped while no particle has moved more than skin/2, so between rebuilds the candidate list is a superset and the narrowphase yields identical contacts. Composes with sleeping (a frozen bed never rebuilds).

Definition at line 296 of file sim.hpp.

References peclet::dem::Particles::impNumPairs, peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::verletSkinFrac.

Referenced by NB_MODULE().

◆ verletSkin()

float peclet::dem::Simulation::verletSkin ( ) const
inline

Definition at line 300 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::verletSkinFrac.

Referenced by NB_MODULE().

◆ setCudaGraphs()

void peclet::dem::Simulation::setCudaGraphs ( bool  enabled)
inline

CUDA-graph replay of the solver's iteration loops (single-rank CUDA; default ON).

Capture collapses each iteration's launch storm into one replay; the arithmetic, the residual readback and the adaptive stop are unchanged, so results are bit-identical either way. Inert on every non-CUDA backend and on the distributed step (ghost syncs forbid capture).

Definition at line 305 of file sim.hpp.

References peclet::dem::Particles::cudaGraphs, and peclet::dem::ShapeRegistry::P_.

◆ cudaGraphs()

bool peclet::dem::Simulation::cudaGraphs ( ) const
inline

Definition at line 306 of file sim.hpp.

References peclet::dem::Particles::cudaGraphs, and peclet::dem::ShapeRegistry::P_.

◆ setFusedSweeps()

void peclet::dem::Simulation::setFusedSweeps ( const std::string &  mode)
inline

Fused colour sweeps (CUDA): run a whole sweep — and where eligible the whole adaptive iteration loop — as ONE kernel iterating device-side behind software grid barriers.

"auto" (default) uses them exactly where graph replay is unavailable (the distributed step, or set_cuda_graphs(False)); "on"/"off" force. Same colour ordering, bit-identical results.

Definition at line 311 of file sim.hpp.

References peclet::dem::Particles::fusedSweeps, and peclet::dem::ShapeRegistry::P_.

◆ fusedSweeps()

std::string peclet::dem::Simulation::fusedSweeps ( ) const
inline

Definition at line 321 of file sim.hpp.

References peclet::dem::Particles::fusedSweeps, and peclet::dem::ShapeRegistry::P_.

◆ setIncrementalColoring()

void peclet::dem::Simulation::setIncrementalColoring ( bool  enabled)
inline

Incremental (warm-started) graph colouring of the contact manifolds (default ON): reuse last substep's colours and repair only the conflicts instead of recolouring from scratch.

This CHANGES RESULTS – the colouring fixes the Gauss-Seidel sweep order – so it is a numerical option, not just a speed one; False reproduces the pre-incremental behaviour.

Definition at line 328 of file sim.hpp.

References peclet::dem::Particles::incrementalColoring, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ incrementalColoring()

bool peclet::dem::Simulation::incrementalColoring ( ) const
inline

Definition at line 329 of file sim.hpp.

References peclet::dem::Particles::incrementalColoring, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setShellDetection()

void peclet::dem::Simulation::setShellDetection ( const std::string &  mode)
inline

Narrow-phase shell detection of the XPBD engine (step / step_mpi / relax / compute_overlaps; the Hertz engine is unaffected): "one_way" (default: the lower-index body's shell points against the other's SDF) or "two_way" (shell pairs are probed from both sides, and a sphere-shell pair always takes the exact sphere probe).

CHANGES RESULTS for non-sphere bodies; costs up to 2x the narrow phase and contacts of shell pairs (docs/solver_details.md, "Two-way shell detection"; detectContactsKokkos).

Definition at line 336 of file sim.hpp.

References peclet::dem::ShapeRegistry::ensureContactCapacity(), peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::shellDetection.

Referenced by NB_MODULE().

◆ shellDetection()

std::string peclet::dem::Simulation::shellDetection ( ) const
inline

Definition at line 345 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::shellDetection.

Referenced by NB_MODULE().

◆ numAsleep()

int peclet::dem::Simulation::numAsleep ( )
inline

Number of currently-sleeping real bodies (diagnostics / tests).

Definition at line 347 of file sim.hpp.

References peclet::dem::Particles::asleep, peclet::dem::Particles::numReal, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setHertzMaterial()

void peclet::dem::Simulation::setHertzMaterial ( int  mat,
float  youngs,
float  poisson 
)
inline

Per-material Young's modulus + Poisson ratio for the Hertz-Mindlin engine (material ids as in setMaterialIds; without ids every particle is material 0).

Definition at line 357 of file sim.hpp.

References peclet::dem::Particles::hertzE, peclet::dem::Particles::hertzNu, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ stepHertz()

void peclet::dem::Simulation::stepHertz ( int  substeps,
float  skin_frac 
)
inline

Advance substeps explicit soft-sphere Hertz-Mindlin steps of the stored dt (device-side loop; the (e, mu) pairs come from the impulse solver's material tables).

Definition at line 371 of file sim.hpp.

References peclet::dem::demStepHertz(), peclet::dem::Particles::dt, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setGlobalScale()

void peclet::dem::Simulation::setGlobalScale ( float  s)
inline

◆ globalScale()

float peclet::dem::Simulation::globalScale ( ) const
inline

Definition at line 379 of file sim.hpp.

References peclet::dem::Particles::globalScale, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setDt()

void peclet::dem::Simulation::setDt ( float  dt)
inline

The time step every stepper uses (suite/docs/NAMING.md 1.5).

Must be > 0; a step called before set_dt raises instead of silently running on a default.

Definition at line 382 of file sim.hpp.

References peclet::dem::Particles::dt, dt(), and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ dt()

float peclet::dem::Simulation::dt ( ) const
inline

Definition at line 388 of file sim.hpp.

References peclet::dem::Particles::dt, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE(), relax(), and setDt().

◆ capacity()

int peclet::dem::Simulation::capacity ( ) const
inline

Definition at line 389 of file sim.hpp.

References peclet::dem::Particles::capacity, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE(), and Simulation().

◆ setMaterialParams()

void peclet::dem::Simulation::setMaterialParams ( float  restitution_normal,
float  restitution_tangent,
float  friction 
)
inline

◆ setMaterialIds()

void peclet::dem::Simulation::setMaterialIds ( const std::vector< int > &  ids)
inline

Per-particle material ids (0..kMaxMaterials-1); pair (e, mu) values come from setPairMaterial.

Ids default to 0; without any setPairMaterial call the global material applies everywhere.

Definition at line 408 of file sim.hpp.

References peclet::dem::Particles::materialId, peclet::dem::Particles::numReal, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setPairMaterial()

void peclet::dem::Simulation::setPairMaterial ( int  a,
int  b,
float  restitution,
float  friction 
)
inline

Set the symmetric pair material (restitution, friction) for material ids (a, b).

The first call allocates the pair table, initialised from the current global material for every pair.

Definition at line 417 of file sim.hpp.

References peclet::dem::Particles::frictionDynamic, peclet::dem::kMaxMaterials, peclet::dem::ShapeRegistry::P_, peclet::dem::Particles::pairMaterials, and peclet::dem::Particles::restitutionNormal.

Referenced by NB_MODULE().

◆ setWallMaterialId()

void peclet::dem::Simulation::setWallMaterialId ( int  wid,
int  mat 
)
inline

Give an SDF wall a material id so particle-wall (e, mu) also resolves via the pair table.

Definition at line 439 of file sim.hpp.

References peclet::dem::Particles::numWalls, peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::walls.

Referenced by NB_MODULE().

◆ addPlane()

void peclet::dem::Simulation::addPlane ( float  px,
float  py,
float  pz,
float  nx,
float  ny,
float  nz 
)
inline

◆ addSdfWall()

int peclet::dem::Simulation::addSdfWall ( const std::vector< float > &  grid,
int  nx,
int  ny,
int  nz,
F3  origin,
F3  spacing,
float  restitution,
float  friction 
)
inline

◆ setWallVelocity()

void peclet::dem::Simulation::setWallVelocity ( int  wallIndex,
F3  linVel,
F3  angVel,
F3  center 
)
inline

Definition at line 505 of file sim.hpp.

Referenced by NB_MODULE().

◆ setWallTransform()

void peclet::dem::Simulation::setWallTransform ( int  wallIndex,
F3  translation,
float  qx,
float  qy,
float  qz,
float  qw 
)
inline

◆ wallSdfAt()

std::vector< float > peclet::dem::Simulation::wallSdfAt ( int  wallIndex,
const std::vector< float > &  pts 
) const
inline

◆ setPositions()

◆ setScalesUniform()

void peclet::dem::Simulation::setScalesUniform ( float  s)
inline

◆ setScales()

void peclet::dem::Simulation::setScales ( const std::vector< float > &  s)
inline

◆ setVelocities()

void peclet::dem::Simulation::setVelocities ( const std::vector< float > &  v)
inline

◆ setExternalForces()

void peclet::dem::Simulation::setExternalForces ( const std::vector< float > &  f)
inline

◆ clearExternalForces()

void peclet::dem::Simulation::clearExternalForces ( )
inline

Definition at line 666 of file sim.hpp.

References peclet::dem::Particles::extForce, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setExternalTorques()

void peclet::dem::Simulation::setExternalTorques ( const std::vector< float > &  t)
inline

◆ clearExternalTorques()

void peclet::dem::Simulation::clearExternalTorques ( )
inline

◆ externalTorquesView()

const V3 & peclet::dem::Simulation::externalTorquesView ( ) const
inline

Definition at line 686 of file sim.hpp.

References peclet::dem::Particles::extTorque, and peclet::dem::ShapeRegistry::P_.

◆ externalForcesView()

const V3 & peclet::dem::Simulation::externalForcesView ( ) const
inline

Definition at line 687 of file sim.hpp.

References peclet::dem::Particles::extForce, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ invMassView()

const Vf & peclet::dem::Simulation::invMassView ( ) const
inline

Definition at line 688 of file sim.hpp.

References peclet::dem::Particles::invMass, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ setQuaternions()

void peclet::dem::Simulation::setQuaternions ( const std::vector< float > &  q)
inline

◆ setAngularVelocities()

void peclet::dem::Simulation::setAngularVelocities ( const std::vector< float > &  w)
inline

◆ setInvInertia()

void peclet::dem::Simulation::setInvInertia ( const std::vector< float > &  ii)
inline

◆ setInvMass()

void peclet::dem::Simulation::setInvMass ( const std::vector< float > &  im)
inline

◆ getAngularVelocities()

std::vector< float > peclet::dem::Simulation::getAngularVelocities ( ) const
inline

◆ getInvInertia()

std::vector< float > peclet::dem::Simulation::getInvInertia ( ) const
inline

◆ setGrowthParams()

◆ growthFactor()

float peclet::dem::Simulation::growthFactor ( ) const
inline

Definition at line 744 of file sim.hpp.

References peclet::dem::Particles::growthFactor, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ getGrowthRate()

float peclet::dem::Simulation::getGrowthRate ( ) const
inline

Definition at line 745 of file sim.hpp.

References peclet::dem::Particles::growthRate, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ getMasses()

std::vector< float > peclet::dem::Simulation::getMasses ( ) const
inline

◆ getPositions()

std::vector< float > peclet::dem::Simulation::getPositions ( ) const
inline

◆ getVelocities()

std::vector< float > peclet::dem::Simulation::getVelocities ( ) const
inline

◆ getQuaternions()

std::vector< float > peclet::dem::Simulation::getQuaternions ( ) const
inline

◆ getScales()

std::vector< float > peclet::dem::Simulation::getScales ( ) const
inline

◆ step()

void peclet::dem::Simulation::step ( int  n = 1)
inline

Advance n XPBD substeps of the stored dt (set_dt first; suite/docs/NAMING.md 1.5).

Definition at line 774 of file sim.hpp.

References peclet::dem::demStep(), peclet::dem::SplitStats::mlHubAggregated, peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::splitStats.

Referenced by exportLammps(), and NB_MODULE().

◆ relax()

void peclet::dem::Simulation::relax ( int  n = 1)
inline

n dynamics-free RELAXATION substeps (overlap removal only, no gravity / velocity update): the growth-packing protocol's "settle" move.

Runs the pipeline with dt = 0 and restores the stored dt afterwards; does not require set_dt.

Definition at line 783 of file sim.hpp.

References peclet::dem::demStep(), peclet::dem::Particles::dt, dt(), peclet::dem::SplitStats::mlHubAggregated, peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::splitStats.

Referenced by NB_MODULE().

◆ computeOverlaps()

float peclet::dem::Simulation::computeOverlaps ( )
inline

Definition at line 793 of file sim.hpp.

References peclet::dem::computeOverlapsKokkos(), and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ exportLammps()

◆ exportSdf()

void peclet::dem::Simulation::exportSdf ( const std::string &  filename,
int  rx,
int  ry,
int  rz 
)
inline

◆ getSdfGrid()

◆ numParticles()

int peclet::dem::Simulation::numParticles ( ) const
inline

Definition at line 958 of file sim.hpp.

References peclet::dem::Particles::numReal, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ positionsView()

const V3 & peclet::dem::Simulation::positionsView ( ) const
inline

Definition at line 962 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::pos.

Referenced by NB_MODULE().

◆ velocitiesView()

const V3 & peclet::dem::Simulation::velocitiesView ( ) const
inline

Definition at line 963 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, and peclet::dem::Particles::vel.

Referenced by NB_MODULE().

◆ numContacts()

int peclet::dem::Simulation::numContacts ( )
inline

◆ numManifolds()

int peclet::dem::Simulation::numManifolds ( )
inline

◆ debugColoringConflicts()

◆ debugColoringLeftovers()

◆ debugMultilevelColoringConflicts()

◆ debugSplitStats()

◆ maxOverlap()

float peclet::dem::Simulation::maxOverlap ( )
inline

Definition at line 1125 of file sim.hpp.

References peclet::dem::Particles::maxOverlap, and peclet::dem::ShapeRegistry::P_.

Referenced by NB_MODULE().

◆ restBankStats()

std::tuple< double, float, int > peclet::dem::Simulation::restBankStats ( )
inline

Poisson-restitution diagnostics: (sum, max, count>0) of the committed per-pair owed separation impulse (prevRestBank[0:prevPairCount], physical units).

Definition at line 1132 of file sim.hpp.

References peclet::dem::ShapeRegistry::P_, peclet::dem::Particles::prevPairCount, peclet::dem::Particles::prevRestBank, and peclet::dem::restBankStatsKokkos().

◆ restOrphanStats()

std::tuple< double, float, int > peclet::dem::Simulation::restOrphanStats ( )
inline

Orphan-account diagnostics: (sum, max, count>0) of the per-body orphaned budget.

Definition at line 1136 of file sim.hpp.

References peclet::dem::Particles::bodyOrphan, peclet::dem::Particles::numReal, peclet::dem::ShapeRegistry::P_, and peclet::dem::restBankStatsKokkos().

◆ writeVtp()

void peclet::dem::Simulation::writeVtp ( const std::string &  filename) const
inline

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