Question #674396 on Yade changed:
https://answers.launchpad.net/yade/+question/674396

    Status: Open => Answered

Jérôme Duriez proposed the following answer:
Hi,

1. and 2. Your problem/mistake is not clear to me, could you elaborate ? 
(what is the error message, if any ?) 
Also, it seems you started adapting from an existing YADE script, but you do 
not state which script.

3. O.engines[:3] and O.engines[4:] are two sub-lists extracted from
O.engines list.

The "+" concatenates these two lists to create a new one (see the
general Python doc for list operations, and more details regarding the
:3 or :4 notation -- so-called slice notation in Python)

Which is then affected back to O.engines, updating the engines for the 
simulation.
In the end, you just removed one engine from the DEM loop.

Try with the general Python example: (in Python interface or in YADE interface, 
it's the same here)
list = range(0,5)
list[:3] + list[4:]
and check the results of these two lines

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to