delete a specified number of particles on my sample randomly

Asked by Lin 1999

Hello. I am a beginner in Yade software. I want to randomly delete a specified number of particles on my sample. How should I do? Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Best Jérôme Duriez (jduriez) said :
#1

Hi,

You should probably use O.bodies.erase [*] function

[*] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.BodyContainer.erase

Revision history for this message
Lin 1999 (sarcasticli) said :
#2

Thank you. I used O.bodies.erase [*] function and random.randint() to accomplish my target.

Revision history for this message
Lin 1999 (sarcasticli) said :
#3

Thanks Jérôme Duriez, that solved my question.