Question #702750 on Yade changed: https://answers.launchpad.net/yade/+question/702750
Status: Open => Answered Jan Stránský proposed the following answer: Thanks for the MWE. > But the zMax = max(b.state.pos[2] for b in O.bodies) string of code didn't solve my problem. It can only get the z-value of the highest particle before the run, and I need to get the z-value of the uppermost particles after gravity. the command gets the zMax value at the time it is executed. If you execute it before the run, it is evaluated before the run. If you execute it "after gravity", it is evaluated "after gravity". Here in your code, it is evaluated inside checkUnbalanced() function if unbalancedForce() < .05 is fulfilled. Also, max(b.state.pos[2] for b in O.bodies) takes into account all bodies, including facets. If you are interested only in spheres, you can modify it as: zMax = max(b.state.pos[2] for b in O.bodies if isinstance(b.shape,Sphere)) Cheers Jan -- You received this question notification because your team yade-users is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp