← Back to team overview

yade-users team mailing list archive

Re: ::go function

 

> a question on the function ::go used for instance in a contact law.
> Where is actually this function declared? How does it work? For
> instance, I would expect a loop over all the existing interactions..
> (if IICR the action() function was doing a loop in that sense). In the
> case of the ::go function where do I find such loop? Just to know..
Those are called from dispatchers. Have a look at
InteractionDispatchers::action, for instance. There is a loop traversing
all interactions, calling appropriate functors for each (lines 114, 131,
149). The code is a little hairy, because of caching functor resolution
etc, but I think you will get the idea. (Note that the exact
implementation details will get a little different in the future)

> About the contact law. Exactly at which point the interaction becomes
> real? In the InteractionGeometryFunctor, right? Why do we need to
> request a delete of the interaction at the level of the contact law?
> Maybe this an old question, but at the moment I am not able to access
> the mailing list archive.
http://beta.arcig.cz/~eudoxos/yade/sphinx/prog.html#handling-interactions
(I know there are typos etc, but you will get the idea, I think)

> Another general question on the code. For my understanding I am trying
> to start from the main file and reconstruct how the whole simulation
> works. Is in the main file where everything starts from, right? Is in
> this file where we create all the objects, call the engines and so on?
Well, no... the core/main/main.cpp is not used anymore (thanks for
reminding me of removing it).

Everything starts from core/main/main.py.in (yes, python; the .in suffix
means that we do some replacing of ${variable} things in the file before
copying it over to yade-* file, otherwise it is regular python script).

This handles command-line options and import the yade parent module
(which is really py/__init__.py.in). The one initializes the c++ part
(using the yade.boot module, defined in core/main/pyboot.cpp), including
loading plugins. Then, (back in py/__init__.py.in) we either run script
from command line or load xml file or do noting etc.

(good idea to describe this thing in the manual as well :-) )

HTH, Vaclav






Follow ups

References