yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #07913
[Branch ~yade-dev/yade/trunk] Rev 2926: - fix Newton::gravity usage. Weight is g*mass, not just g...
------------------------------------------------------------
revno: 2926
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2011-10-06 17:31:48 +0200
message:
- fix Newton::gravity usage. Weight is g*mass, not just g...
modified:
pkg/dem/NewtonIntegrator.cpp
--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk
Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/dem/NewtonIntegrator.cpp'
--- pkg/dem/NewtonIntegrator.cpp 2011-09-27 12:30:14 +0000
+++ pkg/dem/NewtonIntegrator.cpp 2011-10-06 15:31:48 +0000
@@ -108,7 +108,7 @@
if(unlikely(!b || b->isClumpMember())) continue;
State* state=b->state.get(); const Body::id_t& id=b->getId();
- Vector3r f=gravity, m=Vector3r::Zero();
+ Vector3r f=gravity*state->mass, m=Vector3r::Zero();
// clumps forces
if(b->isClump()) {
b->shape->cast<Clump>().addForceTorqueFromMembers(state,scene,f,m);
@@ -118,7 +118,7 @@
scene->forces.getForceUnsynced(id)+=f;
#else
scene->forces.addTorque(id,m);
- scene->forces.addForce(id, f);
+ 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)