← Back to team overview

yade-users team mailing list archive

Re: [Question #702750]: How to detect the coordinates of each particle?

 

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

    Status: Open => Answered

Jan Stránský proposed the following answer:
> ... coordinates of each particle?
> ... the z-value of the uppermost particle?
> ... the z-value of each particle in the uppermost layer.

please be consistent.

> in the uppermost layer.

first, define rigorously "the uppermost layer", i.e. how mathematically determine if particle belongs to this layer or not.
Then just:
###
def isUpperMostLayer(body):
    ... # your definition
    return False # or True

zValsUpperMostLayer = [b.state.pos[2] for b in O.bodies if isinstance(b.shape, Sphere) and isUpperMostLayer(b)]
print(zValsUpperMostLayer) # or whatever else with the values
###

Cheers
Jan

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