yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00722
Re: Simulation with Python
>
> My new question is about Python. I have a simulation which represents
> a fiber (red spheres) pull out in a matrix . I have the initial sphere
> packing (see attached file) with two types of spheres (fiber and matrix).
> After our conversation, i am sure that it is easier to do this
> simulation with Python. But i need know how :
>
> * Allocate different contact laws between two types of spheres.
> * Move only few spheres.
> * etc...
Hi, your question is rather about engines. You will probably have to use
groupMask magic to differentiate types of spheres and adjust the
constitutive law for that. Unfortunately there is no unification on this
(yet).
For moving the spheres that are being pulled out: create
TranslationEngine and subscribe only those red spheres, something like
this (let's suppose that they have groupMask==2, for example):
ids=[b.id for b in o.bodies if int(b['groupMask'] & 2)] # this will give
you the list of IDs of red spheres
then put something like this amongst your engines:
DeusExMachina('TranslationEngine',{'subscribedBodies':ids,'param1':value1,...})
OK, but maybe you want to move only a few spheres that are at the
beginning of the bar?
I am sorry to reply in such a brief manner, if you send me (here or
privately) the simulation setup (.xml or just sphere coordinates), I can
prepare for you abundantly commented script thursday.
HTH, Vaclav
>
> I didn't find Python tutorial on the Yade's site. Moreover, i think
> the Python lines for YADE are not general, the user must know the
> specific syntax.
> Please, can you help me to find good examples or this specific synthax
> to realize my modeling.
>
> King regards
> JF
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp
>
References