← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2809: Little changes in CpmStateUpdater

 

------------------------------------------------------------
revno: 2809
committer: Jan Stransky <_honzik@xxxxxxxxxx>
branch nick: yade
timestamp: Fri 2011-04-08 08:31:21 +0200
message:
  Little changes in CpmStateUpdater
modified:
  pkg/dem/ConcretePM.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/ConcretePM.cpp'
--- pkg/dem/ConcretePM.cpp	2010-12-21 12:19:50 +0000
+++ pkg/dem/ConcretePM.cpp	2011-04-08 06:31:21 +0000
@@ -394,6 +394,7 @@
 	assert(bodyStats[0].nCohLinks==0); // should be initialized by dfault ctor
 	avgRelResidual=0; Real nAvgRelResidual=0;
 	FOREACH(const shared_ptr<Interaction>& I, *scene->interactions){
+		if(!I) continue;
 		if(!I->isReal()) continue;
 		shared_ptr<CpmPhys> phys=dynamic_pointer_cast<CpmPhys>(I->phys);
 		if(!phys) continue;
@@ -421,6 +422,7 @@
 		nAvgRelResidual+=1;
 	}
 	FOREACH(shared_ptr<Body> B, *scene->bodies){
+		if (!B) continue;
 		const Body::id_t& id=B->getId();
 		// add damaged contacts that have already been deleted
 		CpmState* state=dynamic_cast<CpmState*>(B->state.get());


Follow ups