← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1920: 1. Fix https://bugs.launchpad.net/yade/+bug/499697 (sorry, Luc)

 

------------------------------------------------------------
revno: 1920
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-12-23 10:20:38 +0100
message:
  1. Fix https://bugs.launchpad.net/yade/+bug/499697 (sorry, Luc)
modified:
  pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp
  pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp
  pkg/dem/Engine/GlobalEngine/ElasticContactLaw.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/common/Engine/Dispatcher/InteractionDispatchers.cpp'
--- pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp	2009-12-21 22:19:11 +0000
+++ pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp	2009-12-23 09:20:38 +0000
@@ -95,6 +95,7 @@
 				geomCreated=I->functorCache.geom->go(b1->shape,b2->shape,*b1->state,*b2->state,shift2,/*force*/false,I);
 			}
 			if(!geomCreated){
+				if(wasReal) LOG_WARN("InteractionGeometryFunctor returned false on existing interaction!");
 				if(wasReal) scene->interactions->requestErase(I->getId1(),I->getId2()); // fully created interaction without geometry is reset and perhaps erased in the next step
 				continue; // in any case don't care about this one anymore
 			}

=== modified file 'pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp'
--- pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp	2009-12-21 22:19:11 +0000
+++ pkg/dem/DataClass/InteractionGeometry/Dem3DofGeom_FacetSphere.cpp	2009-12-23 09:20:38 +0000
@@ -145,9 +145,10 @@
 	bool isNew=false;
 	if(c->interactionGeometry) fs=YADE_PTR_CAST<Dem3DofGeom_FacetSphere>(c->interactionGeometry);
 	else {
-		isNew=true;
+		// LOG_TRACE("Creating new Dem3DofGeom_FacetSphere");
 		fs=shared_ptr<Dem3DofGeom_FacetSphere>(new Dem3DofGeom_FacetSphere());
 		c->interactionGeometry=fs;
+		isNew=true;
 		fs->effR2=sphereRadius-penetrationDepth;
 		fs->refR1=-1; fs->refR2=sphereRadius;
 		// postponed till below, to avoid numeric issues
@@ -156,7 +157,7 @@
 		// it was returning something like +1e-16 at the very first step
 		// when it was created ⇒ the constitutive law was erasing the
 		// contact as soon as it was created.
-		//fs->refLength=fs->effR2;
+		// fs->refLength=…
 		fs->cp1pt=contactPt; // facet-local intial contact point
 		fs->localFacetNormal=facet->nf;
 		fs->cp2rel.Align(Vector3r::UNIT_X,state2.ori.Conjugate()*(-normalGlob)); // initial sphere-local center-contactPt orientation WRT +x
@@ -164,7 +165,7 @@
 	}
 	fs->se31=state1.se3; fs->se32=state2.se3; fs->se32.position+=shift2;
 	fs->normal=normalGlob;
-	fs->contactPoint=state2.pos+shift2+(-normalGlob)*fs->effR2;
+	fs->contactPoint=state2.pos+shift2+(-normalGlob)*(sphereRadius-penetrationDepth);
 	// this refLength computation mimics what displacementN() does inside
 	// displcementN will therefore return exactly zero at the step the contact
 	// was created, which is what we want

=== modified file 'pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp'
--- pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp	2009-12-13 20:11:31 +0000
+++ pkg/dem/Engine/GlobalEngine/ElasticContactLaw.cpp	2009-12-23 09:20:38 +0000
@@ -113,7 +113,7 @@
 	Dem3DofGeom* geom=static_cast<Dem3DofGeom*>(ig.get());
 	ElasticContactInteraction* phys=static_cast<ElasticContactInteraction*>(ip.get());
 	Real displN=geom->displacementN();
-	if(displN>0){rootBody->interactions->requestErase(contact->getId1(),contact->getId2()); return; }
+	if(displN>0){ rootBody->interactions->requestErase(contact->getId1(),contact->getId2()); return; }
 	phys->normalForce=phys->kn*displN*geom->normal;
 	Real maxFsSq=phys->normalForce.SquaredLength()*pow(phys->tangensOfFrictionAngle,2);
 	Vector3r trialFs=phys->ks*geom->displacementT();