← Back to team overview

yade-users team mailing list archive

Re: Contact forces

 

> I checked the python script in _utils.cpp:147 and I cannot see why
> there is a difference (I didn't see anything to avoid spheres with
> less than 2 contacts in the script), but, I must confess that the code
> in there is not very meaningful to me... I have to add that when I
> look into the xml file, my C++ code tends to be accurate (just divide
> the total number of interactions by the number of particles and
> multiply by 2).

OK, I think I got it. How much are your numbers different? I bet they
are all scaled down by some small value.

utils.avgNumInteractions computes the average from the histogram (it
could be computed directly like you do, but... histogram already has the
filtering based on Aabb, so it was easier like this):

def avgNumInteractions(cutoff=0.):
	nums,counts=bodyNumInteractionsHistogram(aabbExtrema(cutoff))
	return sum([nums[i]*counts[i] for i in range(len(nums))])/(1.*sum(counts))

but the histogram doesn't have bin for bodies with 0 contacts.

I just added that in r2020, can you check that it is correct now?

Cheers, Vaclav






Follow ups

References