About oedometric test example in the yade documentation

Asked by Lei Hang on 2020-07-04

Dear all,

When I study the Gravity deposition example in the yade documentation, some places of the script confuse me a lot.
The script link is as following:
https://gitlab.com/yade-dev/trunk/blob/master/doc/sphinx/tutorial/03-oedometric-test.py

My questions:
1. In the first line "readParamsFromTable(rMean=.05,rRelFuzz=.3,maxLoad=1e6,minLoad=1e4)", are they the default values of the variables in the parameters table?

2.In the line "O.forces.f(O.forces.f(plate.id)[2]", Why the "plate.id" not write as"plate" directly? Does the [2] mean Z-coordinate?

3. Does the "plate.state.vel*=-1" just mean the opposite orientation of former velocity "plate.state.vel=(0,0,-.1)"? Are the values of the two velocity same?

4.Why "plot.saveDataTxt(O.tags['d.id']+'.txt')" not write as "plot.saveDataTxt(O.tags['d.id'].txt.bz2')"?

Many thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
2020-07-04
Last query:
2020-07-04
Last reply:
2020-07-04
Best Jan Stránský (honzik) said : #1

Hello,

> About oedometric test example ...
> When I study the Gravity deposition example ...

please try to be consistent, especially in the case of copy-pasting :-)

> 1. ... are they the default values of the variables in the parameters table?

yes, default values if run in "plain" yade and default values if not specified in the table for "yade-batch"

> 2. ... Why the "plate.id" not write as"plate" directly?

Try it yourself :-) (even though the smile, it is serious suggestion, it would teaches you to treat and understand errors)

Because O.forces.f takes ID, not body, see documentation [1]

> 2. ... Does the [2] mean Z-coordinate?

yes, vector[2] is vector's z coordinate

> 3....

yes.

plate.state.vel*=-1
is a shortcut for
plate.state.vel = plate.state.vel * (-1)

4.Why "plot.saveDataTxt(O.tags['d.id']+'.txt')" not write as "plot.saveDataTxt(O.tags['d.id'].txt.bz2')"?

Try it yourself :-) (again a serious suggestion)
Written as you provided would be syntax error, because you have "unclosed" quotation mark (') after bz2.
Written without ' aster bz2 it would be something like AttributeError saying that something has not attribute 'txt'. As .txt would normally mean get "txt" attribute of the current object.

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.ForceContainer.f

Lei Hang (h-stone) said : #2

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