← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2244: 1. Fix scene pointer in CohesiveFrictionalContactLaw

 

------------------------------------------------------------
revno: 2244
fixes bug(s): https://launchpad.net/bugs/582516
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-05-19 23:05:54 +0200
message:
  1. Fix scene pointer in CohesiveFrictionalContactLaw
  2. add doc to utils.avgNumContacts.
modified:
  pkg/dem/Engine/GlobalEngine/CohesiveFrictionalContactLaw.cpp
  py/utils.py


--
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/Engine/GlobalEngine/CohesiveFrictionalContactLaw.cpp'
--- pkg/dem/Engine/GlobalEngine/CohesiveFrictionalContactLaw.cpp	2010-05-18 10:28:02 +0000
+++ pkg/dem/Engine/GlobalEngine/CohesiveFrictionalContactLaw.cpp	2010-05-19 21:05:54 +0000
@@ -41,6 +41,7 @@
 	functor->shear_creep=shear_creep;
 	functor->twist_creep=twist_creep;
 	functor->creep_viscosity = creep_viscosity;
+	functor->scene=scene;
 	
 	FOREACH(const shared_ptr<Interaction>& I, *scene->interactions){
 		if(!I->isReal()) continue;

=== modified file 'py/utils.py'
--- py/utils.py	2010-05-17 08:12:59 +0000
+++ py/utils.py	2010-05-19 21:05:54 +0000
@@ -449,6 +449,10 @@
 		if b.dynamic or not onlyDynamic: b.shape.color=color
 
 def avgNumInteractions(cutoff=0.):
+	"""Return average numer of interactions per particle, also known as *coordination number*.
+
+	:param cutoff: cut some relative part of the sample's bounding box away.
+	"""
 	nums,counts=bodyNumInteractionsHistogram(aabbExtrema(cutoff))
 	return sum([nums[i]*counts[i] for i in range(len(nums))])/(1.*sum(counts))