← Back to team overview

yade-dev team mailing list archive

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

 

Ok thank you Vaclav. I will have a look at your suggestions. I would like to
do it through python, so I will probably need to create a function with
O.interactions.withBody(id) or O.interactions.withBodyAll(id)...

Just another precision BTW... I have already seen something about Real and
Potential interactions, but what is the "real" difference between them?
"Potential" interactions include grains with intersected AABB and "Real"
ones only those in contact?

  Luc

2009/12/18 Václav Šmilauer <eudoxos@xxxxxxxx>

>
> > 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
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> Post to     : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev<https://launchpad.net/%7Eyade-dev>
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References