more detail instruction of yade.post2d

Asked by liukeqi

Hi,
  I want to use yade.post2d to do some postprocessing.
  I have some questions about the yade.post2d module.

  [1] The instruction of the yade.post2d module said that it is used for projecting points from 3d to 2d. I want to know, 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?
  [2] Can you give me some more examples that using yade.post2d except uniax-post.py and interaction-histogram.py? I want to know more detail usage about flattener.planar and flattener.normal.

Thank you.
Liu keqi

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Best Jan Stránský (honzik) said :
#1

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

Revision history for this message
liukeqi (891979456-h) said :
#2

Thanks Jan Stránský, that solved my question.