← Back to team overview

yade-users team mailing list archive

Re: [Question #660779]: particles exiting the geometry

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,

you can add PyRunner with a function checking/deleting the bodies:
###
O.engines = [
   ...
   PyRunner(iterPeriod=1000,command="checkAndDelete()"), # modify 1000 to your needs
]
def checkAndDelete():
   for b in O.bodies:
      x,y,z = b.state.pos
      if x<0 or x>10 or y<0 or y>20: # modify this condition to your needs
         O.bodies.erase(b.id)
###

For next questions, usually it is good idea to provide a MWE [1].

cheers
Jan

[1] https://yade-dem.org/wiki/Howtoask

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