Delete some particles in a package

Asked by Nait on 2012-10-22

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.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2012-10-22
Last query:
2012-10-22
Last reply:
2012-10-22
Christian Jakob (jakob-ifgt) said : #1

You can use following command:

O.bodies.erase(id_of_the_body)

Best Jan Stránský (honzik) said : #2

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 <email address hidden>

> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Nait (xuhero1989) said : #3

To Christian Jakob (jakob-ifgt):

Thanks for your suggestions.

To Jan Stránský (honzik):

Thanks for your suggestions.
If I have applied stress on the boundaries of the origin package (i.e. before deleting particles), will there be convergence problems if I delete some particles in the package?

Jan Stránský (honzik) said : #4

Well, it depends on how you define convergence and convergence problems
:-) if you apply compressive stress on the boundaries and some damping, the
solution should always converge (in the sense that it will be compressed
and damped until quasi-static equilibrium, althought it may take long
time). Deleting particles just make the final equilibrium configuration
different (in some cases the tunel surface migh be destroyed etc.)

Jan

2012/10/22 Nait <email address hidden>

> Question #211937 on Yade changed:
> https://answers.launchpad.net/yade/+question/211937
>
> Status: Answered => Open
>
> Nait is still having a problem:
> To Christian Jakob (jakob-ifgt):
>
> Thanks for your suggestions.
>
>
> To Jan Stránský (honzik):
>
> Thanks for your suggestions.
> If I have applied stress on the boundaries of the origin package (i.e.
> before deleting particles), will there be convergence problems if I delete
> some particles in the package?
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Nait (xuhero1989) said : #5

Thanks Jan Stránský, that solved my question.

Nait (xuhero1989) said : #6

To Jan,

With your help I can now construct a simple tunnel by deleting some particles. However, when I continue my simulation, the following message show

egmentation fault (core dumped)

In fact I hope to see some particles falling down due to gravity after I construct the tunnel. Maybe this is what I call "convergence problem".

Do you have some suggestions for solving this problem?

P.S.
I use ThreeDTriaxialEngine to apply stress to the boundary, and add a gravity engine after the tunnel is construction.

Anton Gladky (gladky-anton) said : #7

Hi,

2012/10/22 Nait <email address hidden>:
>However, when I continue my simulation, the following message
> show
>
> egmentation fault (core dumped)

please, provide a script, which causes the segfault, it can be a bug.
What yade-version do you use?

Thanks,

Anton

Nait (xuhero1989) said : #8

To Anton and Jan,

I have double checked my script and found the error: one of my walls (boundary) is included in the list of bodies to be deleted. Maybe the message I mentioned above is shown just because I delete a boundary during a simulation and my script works now.

Thanks.

Nait

Jan Stránský (honzik) said : #9

Do you still have the old version with the error? if yes, please send it
anyway. As Anton mentioned, there may be a bug, which is active only in
some ciecumstances.
Jan

2012/10/23 Nait <email address hidden>

> Question #211937 on Yade changed:
> https://answers.launchpad.net/yade/+question/211937
>
> Nait posted a new comment:
> To Anton and Jan,
>
> I have double checked my script and found the error: one of my walls
> (boundary) is included in the list of bodies to be deleted. Maybe the
> message I mentioned above is shown just because I delete a boundary
> during a simulation and my script works now.
>
> Thanks.
>
> Nait
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Jan Stránský (honzik) said : #10

Do you still have the old version with the error? if yes, please send it
anyway. As Anton mentioned, there may be a bug, which is active only in
some ciecumstances.
Jan

2012/10/23 Nait <email address hidden>

> Question #211937 on Yade changed:
> https://answers.launchpad.net/yade/+question/211937
>
> Nait posted a new comment:
> To Anton and Jan,
>
> I have double checked my script and found the error: one of my walls
> (boundary) is included in the list of bodies to be deleted. Maybe the
> message I mentioned above is shown just because I delete a boundary
> during a simulation and my script works now.
>
> Thanks.
>
> Nait
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Jan Stránský (honzik) said : #11

Do you still have the old version with the error? if yes, please send it
anyway. As Anton mentioned, there may be a bug, which is active only in
some ciecumstances.
Jan

2012/10/23 Nait <email address hidden>

> Question #211937 on Yade changed:
> https://answers.launchpad.net/yade/+question/211937
>
> Nait posted a new comment:
> To Anton and Jan,
>
> I have double checked my script and found the error: one of my walls
> (boundary) is included in the list of bodies to be deleted. Maybe the
> message I mentioned above is shown just because I delete a boundary
> during a simulation and my script works now.
>
> Thanks.
>
> Nait
>
> --
> 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 : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>