Skip to content

Commit 835178d

Browse files
committed
No longer allow infinite velocities
1 parent 390c8df commit 835178d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/DEM/kT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ inline void DEMKinematicThread::unpackMyBuffer() {
134134
solverScratchSpace);
135135
// Get the reduced maxVel value
136136
stateParams.maxVel.toHost();
137-
if (*(stateParams.maxVel) > simParams->errOutVel) {
137+
if (*(stateParams.maxVel) > simParams->errOutVel || (!std::isfinite(*(stateParams.maxVel)))) {
138138
DEME_ERROR(
139139
"System max velocity is %.7g, exceeded max allowance (%.7g).\nIf this velocity is not abnormal and you "
140140
"want to increase this allowance, use SetErrorOutVelocity before initializing simulation.\nOtherwise, the "

src/kernel/DEMMiscKernels.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ __global__ void computeMarginFromAbsv(deme::DEMSimParams* simParams,
4242
if (ownerID < n) {
4343
float absv = granData->marginSize[ownerID];
4444
unsigned int my_family = granData->familyID[ownerID];
45-
if (absv > simParams->approxMaxVel) {
45+
if (absv > simParams->approxMaxVel || (!isfinite(absv))) {
4646
absv = simParams->approxMaxVel;
4747
}
4848
// User-specified extra margin also needs to be added here. This marginSize is used for bin--sph or bin--tri

0 commit comments

Comments
 (0)