yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10824
Test needed from Clumps-users
Dear users/devs, who is working with clumps,
I have done a tiny modification in NewtonIntegrator [1], which
should fix numerical instability with clumps in a rare cases.
============================================
============================================
Subject: [PATCH] Do not use getTorqueUnsynced and forces.getForceUnsynced in
clumps
It seems both of these commands are unsafe. It causes NaN velocities
in a very specific cases. From my point of view it is OK, because
addForceTorqueFromMembers does not modify data itself.
---
pkg/dem/NewtonIntegrator.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/pkg/dem/NewtonIntegrator.cpp b/pkg/dem/NewtonIntegrator.cpp
index e961bf2..082add8 100644
--- a/pkg/dem/NewtonIntegrator.cpp
+++ b/pkg/dem/NewtonIntegrator.cpp
@@ -146,14 +146,8 @@ void NewtonIntegrator::action()
// clumps forces
if(b->isClump()) {
b->shape->cast<Clump>().addForceTorqueFromMembers(state,scene,f,m);
- #ifdef YADE_OPENMP
- //it is safe here, since only one thread will read/write
- scene->forces.getTorqueUnsynced(id)+=m;
- scene->forces.getForceUnsynced(id)+=f;
- #else
scene->forces.addTorque(id,m);
scene->forces.addForce(id,f);
- #endif
}
//in most cases, the initial force on clumps will be zero and next
line is not changing f and m, but make sure we don't miss something
(e.g. user defined forces on clumps)
f=scene->forces.getForce(id); m=scene->forces.getTorque(id);
--
1.9.3
============================================
============================================
Please, test you scripts with the newest version. Yadedaily should
get this fix tonight.
Comments are very welcome.
[1] https://github.com/yade/trunk/commit/5707bb55fb9a3605e10a82cdecbec8efcc7d906f
Best regards
Anton
Follow ups