← Back to team overview

yade-users team mailing list archive

Re: [Question #404193]: more detail instruction of yade.post2d

 

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

    Status: Open => Answered

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

if I use it in a cube sample, whether it projects the whole sample or just
> the middle slice of the sample. Can it project the specific slice or not?


it depends on extractor function. According to docs [2], it "receives Body
(or Interaction, if intr is True) instance, should return scalar, a 2-tuple
(vector fields) or None (to skip that body/interaction)"

so if you define it to return some values from defined slice and None
otherwise, you can postprocess only certain domain.

Can you give me some more examples that using yade.post2d except
> uniax-post.py and interaction-histogram.py?


Unfortunately there are no more examples in the source code, but I would
say the existing example is self-explanatory..

I want to know more detail usage about flattener.planar and
> flattener.normal.


>From user point of view, you don't need it. It would be only relevant if
you want to implement new Flatten class. According to docs [3], planar
takes a vector and returns its planar (two) coordinates, normal() takes
vector and returns its out-of-plana coordinate. Have a look e.g. at
cylindrical flatten source code [4], rotating values to a plane containing
cylinder axis. Btw. nice usage of vector algebra :-)

[1] https://yade-dem.org/doc/yade.post2d.html
[2] https://yade-dem.org/doc/yade.post2d.html#yade.post2d.data
[3] https://yade-dem.org/doc/yade.post2d.html#yade.post2d.Flatten
​[4] https://github.com/yade/trunk/blob/master/py/post2d.py#L124

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