yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #02378
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
-
Logging problem
From: Bruno Chareyre, 2009-12-14
-
Re: Logging problem
From: Václav Šmilauer, 2009-12-14
-
Re: Logging problem
From: Bruno Chareyre, 2009-12-15
-
Contact forces
From: nejib hadda, 2009-12-15
-
Re: Contact forces
From: Václav Šmilauer, 2009-12-15
-
Contact forces
From: nejib hadda, 2010-01-15
-
Re: Contact forces
From: Luc SIBILLE, 2010-01-15
-
Re: Contact forces
From: luc scholtes, 2010-02-11
-
Re: Contact forces
From: Luc Sibille, 2010-02-11
-
Re: Contact forces
From: luc scholtes, 2010-02-12