yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #06538
Re: [Question #211937]: Delete some particles in a package
Question #211937 on Yade changed:
https://answers.launchpad.net/yade/+question/211937
Jan Stránský proposed the following answer:
Hello,
to delete certain particle, use [1]
O.bodies.erase(bodyId)
if you have e.g. a list of bodies that you want to delete, you can use
something like this:
bodiesToBeDeleted = []
for b in O.bodies:
if b.state.pos[0] > 10: # artificial condition for particles deletion,
use your own :-)
bodiesToBeDeleted.append(b)
for b in bodiesToBeDeleted:
O.bodies.erase(b.id)
good luck and if you have any more question, just ask :-)
Jan
[1] https://yade-dem.org/doc/yade.wrapper.html#bodycontainer
2012/10/22 Nait <question211937@xxxxxxxxxxxxxxxxxxxxx>
> New question #211937 on Yade:
> https://answers.launchpad.net/yade/+question/211937
>
> Hi,
>
> I am trying to simulate tunnel construction in YADE. I hope to generate a
> package of particles and apply stress on all the boundaries and then delete
> some particles in the package in order to simulate the tunnel excavation.
> How can I delete some particles in this simulation?
>
> Thanks.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.