size vs. hSize vs. hSize0 vs. refSize in "Cell"

Asked by enki

In my case, instead of using a stresscontroller(), I applied the velocity directly to the periodic boundary. Then, I want to indicate the strain values : ex,ey,ez in the plot.addData() step.

I know that the stress value can be obtained through getStress(), i.e. getStress()[0,0], but how to directly represent the strain value such as stress?

I thought the "cell" class would contain the strain information, right? However, I can't decide which parameter should be used to represent the strain value.

From the YADE documentation, the "Cell" class has the following parameters: size, hSize, hSize0, and refSize. But I don't think I can fully distinguish them.

Question information

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

Hello,

> how to directly represent the strain value such as stress?
> I thought the "cell" class would contain the strain information, right?

right [1,2,3,4] (and more getSomething methods, see [5] as linked from docs)

> However, I can't decide which parameter should be used to represent the strain value.

It is up to you, depending on what "the strain value" mean to you and your purposes [5].
[2] is probably a good start if you do not know.

> From the YADE documentation, the "Cell" class has the following parameters: size, hSize, hSize0, and refSize. But I don't think I can fully distinguish them.

You can print the values and try to set the values to see the effect.
If the documentation is not sufficient, feel free to open an issue on gitlab or even improve it yourself.

###
O.periodic = True
O.cell.hSize = Matrix3(9,1,2, 3,8,4, 5,6,7)
print("size",O.cell.size)
print("refSize",O.cell.refSize)
print("hSize",O.cell.hSize)
print("hSize0",O.cell.hSize0)
#
O.engines = [NewtonIntegrator()]
O.dt = 1
O.cell.velGrad = Matrix3(1,2,3, 4,5,6, 7,8,9)
O.step()
O.step()
#
print("size",O.cell.size)
print("refSize",O.cell.refSize)
print("hSize",O.cell.hSize)
print("hSize0",O.cell.hSize0)
#
O.cell.hSize = Matrix3(9,1,2, 3,8,4, 5,6,7) # no problem, intended to set hSize
O.cell.refSize = Vector3(1,2,3) # warning: Setting Cell.refSize is deprecated
#O.cell.size = Vector3() # AttributeError: can't set attribute
#O.cell.hSize0 = Matrix3() # AttributeError: can't set attribute
###

Also source code [6,7] can be useful.

Cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.getDefGrad
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.getSmallStrain
[3] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.getLagrangianStrain
[4] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Cell.getEulerianAlmansiStrain
[5] https://en.wikipedia.org/wiki/Finite_strain_theory
[6] https://gitlab.com/yade-dev/trunk/-/blob/master/core/Cell.hpp
[7] https://gitlab.com/yade-dev/trunk/-/blob/master/core/Cell.cpp

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Hi,

"size, hSize, hSize0, and refSize"

The simple answer is: "hSize" gives the current shape.
You can ignore the others.
Their documentation is short but accurate, seemes to me.

Bruno

Can you help with this problem?

Provide an answer of your own, or ask enki for more information if necessary.

To post a message you must log in.