← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2973: Should finally fix https://bugs.launchpad.net/yade/+bug/897237

 

------------------------------------------------------------
revno: 2973
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Wed 2011-11-30 15:39:48 +0100
message:
  Should finally fix https://bugs.launchpad.net/yade/+bug/897237
modified:
  pkg/dem/HertzMindlin.cpp
  pkg/dem/Shop.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/HertzMindlin.cpp'
--- pkg/dem/HertzMindlin.cpp	2011-11-23 12:09:58 +0000
+++ pkg/dem/HertzMindlin.cpp	2011-11-30 14:39:48 +0000
@@ -161,7 +161,7 @@
 	MindlinPhys* phys=static_cast<MindlinPhys*>(ip.get());	
 	const Real uN=geom->penetrationDepth;
 	if (uN<0) {
-		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		if (neverErase) {phys->shearForce = phys->normalForce = Vector3r::Zero(); phys->kn=phys->ks=0; return;}
 		else {scene->interactions->requestErase(id1,id2); return;}
 	}
 	// normal force
@@ -203,7 +203,7 @@
 	MindlinPhys* phys=static_cast<MindlinPhys*>(ip.get());	
 	const Real uN=geom->penetrationDepth;
 	if (uN<0) {
-		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		if (neverErase) {phys->shearForce = phys->normalForce = Vector3r::Zero(); phys->kn=phys->ks=0; return;}
 		else {scene->interactions->requestErase(id1,id2); return;}
 	}
 	
@@ -272,7 +272,7 @@
 	
 	Real uN = scg->penetrationDepth; // get overlapping 
 	if (uN<0) {
-		if (neverErase) phys->shearForce = phys->normalForce = Vector3r::Zero();
+		if (neverErase) {phys->shearForce = phys->normalForce = Vector3r::Zero(); phys->kn=phys->ks=0; return;}
 		else {scene->interactions->requestErase(id1,id2); return;}
 	}
 	/* Hertz-Mindlin's formulation (PFC) 

=== modified file 'pkg/dem/Shop.cpp'
--- pkg/dem/Shop.cpp	2011-10-17 07:33:59 +0000
+++ pkg/dem/Shop.cpp	2011-11-30 14:39:48 +0000
@@ -171,7 +171,7 @@
 		maxF=max(currF,maxF); sumF+=currF; nb++;
 	}
 	Real meanF=sumF/nb;
-	// get max force on contacts
+	// get mean force on interactions
 	sumF=0; nb=0;
 	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
 		if(!I->isReal()) continue;