yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #08252
Re: [Yade-users] Optimized contact detection available
On 26/01/12 10:49, Bruno Chareyre wrote:
>> the bottleneck is SpheresFactory which is working with new version
>> incorrectly and
>> cannot find places for new bodies.
> I think I see the problem. Since you are using bounding boxes for
> finding places, you have problems with the default Verlet distance (0.7
> * mean_radius).
> Your algorithm is searching place for bodies larger than what they
> actually are. Setting a small verlet distance should fix the problem,
> but then you will get less speedup from the new algorithm.
> This is actually a problem on the sphere factory side. Using the
> collider for placement is not very consistent because the role of the
> collider is to tell what is "in the neighborhood of", not "what body is
> overlapping with" (it was the same in the previous logic, but since
> verletDist was smaller, the difference was less sensible). Checking real
> overlaps between bodies is the role of Ig2 functors.
> It is maybe possible to give a modified version of the "probe" function
> that would account for the verletDist, let me think.
>
>
Here is a correct way to fix the problem on sphere factory's side, using
Ig2 functor to check overlaps (found in ResetRandomPosition.cpp:101
from Sergei):
// Test overlap with other bodies
vector<Body::id_t> probedBodies=bI->probeBoundingVolume(bv);
FOREACH(Body::id_t id, probedBodies){
if
(iGME->explicitAction(b,Body::byId(id),/*force*/false)->geom){
is_overlap=true;
break;
}
}
if (is_overlap) continue; // new attempt
break;
It seems to me it can also be partly fixed in the probe function, by
substracting sweepLength in the bounds comparison. I can try that if I
have an example script. But still, it will fail to place spheres when
corners of the bounding boxes are overlapping, even if the sphere are
not actually overlapping.
B
References