yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #10828
[Branch ~yade-pkg/yade/git-trunk] Rev 3954: Do not use getTorqueUnsynced and forces.getForceUnsynced in clumps
------------------------------------------------------------
revno: 3954
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2014-05-16 11:46:02 +0200
message:
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.
modified:
pkg/dem/NewtonIntegrator.cpp
--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/dem/NewtonIntegrator.cpp'
--- pkg/dem/NewtonIntegrator.cpp 2014-05-15 14:47:33 +0000
+++ pkg/dem/NewtonIntegrator.cpp 2014-05-16 09:46:02 +0000
@@ -146,14 +146,8 @@
// 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);
Follow ups