← Back to team overview

yade-dev team mailing list archive

Re: [yade-dev] How to access neighboring grains

 

> Is there a way to access all the neighbors (in contact I mean) to a
> given grain? I saw the "isNeighbor" variable but I cannot find out how
> to use it when looping on interactions or bodies.
Hi, there is no straightforward way, at least currently. You have to
loop over all interactions and check id1 and id2 for each of them. Have
a look at CpmStateUpdater::update, for instance, which computes mean
stress etc on particles.

In python, there is O.interactions.withBody(id) which returns list of
(real) interactions with id, and O.interactions.withBodyAll(id), which
returns real+potential interactions. Internally, they are loops
(py/yadeWrapper/yadeWrapper.cpp:256).

I would like to try storing interactions inside bodies, but I've not yet
done it (instead of InteractionVecMap, there would BodyVector and map
inside each body; speedwise should be the same, except that each intr
will be stored 2 times, once in each body; one step further to domain
decomposition as well).

Cheers, v




Follow ups

References