← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4157: Respect returnin value in computeForceTorqueViscEl

 

------------------------------------------------------------
revno: 4157
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Thu 2014-09-11 19:15:11 +0200
message:
  Respect returnin value in computeForceTorqueViscEl
  
  More correct way of returning true/false in
  Law2_ScGeom_ViscElPhys_Basic::go
modified:
  pkg/dem/ViscoelasticCapillarPM.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/ViscoelasticCapillarPM.cpp'
--- pkg/dem/ViscoelasticCapillarPM.cpp	2014-07-21 09:09:14 +0000
+++ pkg/dem/ViscoelasticCapillarPM.cpp	2014-09-11 17:15:11 +0000
@@ -142,12 +142,15 @@
     Vector3r torque1 = Vector3r::Zero();
     Vector3r torque2 = Vector3r::Zero();
     
-    computeForceTorqueViscEl(_geom, _phys, I, force, torque1, torque2);
-    
-    addForce (id1,-force,scene);
-    addForce (id2, force,scene);
-    addTorque(id1, torque1,scene);
-    addTorque(id2, torque2,scene);
+    if (computeForceTorqueViscEl(_geom, _phys, I, force, torque1, torque2)) {
+      addForce (id1,-force,scene);
+      addForce (id2, force,scene);
+      addTorque(id1, torque1,scene);
+      addTorque(id2, torque2,scene);
+      return true;
+    } else {
+      return false;
+    }
   }
   return true;
 }