a problem about approxSectionArea

Asked by xjin

I learn the example: https://github.com/yade/trunk/blob/master/examples/concrete/triax.py
There is a parameter in the script---- approxSectionArea,which is shown like this:
--------------------------------------------------------------------------------------------------------------------------------------------------------
mm,mx=[pt[axis] for pt in aabbExtrema()]
coord_25,coord_50,coord_75=mm+.25*(mx-mm),mm+.5*(mx-mm),mm+.75*(mx-mm)
 area_25,area_50,area_75=approxSectionArea(coord_25,axis),approxSectionArea(coord_50,axis),approxSectionArea(coord_75,axis)
--------------------------------------------------------------------------------------------------------------------------------------------------------
can you explain the meaning of coord_25 in approxSectionArea(coord_25,axis)?
Does it mean the center of the section?
Thank you very much!

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:

This question was reopened

  • by xjin
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

coord_25 = mm+.25*(mx-mm)
# mx - mm = length of the sample along given axis
# mm + .25*(mx-mm) = mm+.25*length
# coord_25 ... coordinate at 25% length of the sample (the same meaning is for 50=50% and 75=75%)
# in the script the shape is hyperboloid, so the cross section vary along the sample

approxSectionArea [1] approximates cross section perpendicular to axis (0=x,1=y,2=z) at given coordinate (25% of length for coord_25)

cheers
Jan

[1] https://yade-dem.org/doc/yade.utils.html#yade._utils.approxSectionArea

Revision history for this message
xjin (jpeng22) said :
#2

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

Revision history for this message
xjin (jpeng22) said :
#3

Thanks for Jan Stránský!
For I am new to yade, I am confused about another problem .
If the sample is cube, does it use coord_100?
As in the yade._utils.approxSectionArea((float)arg1, (int)arg2), I understand (int)arg2 means the axis.
Can you explain the specific meaning of (float)arg1? How can I choose the value?
Very very thank you!

Revision history for this message
Best Jan Stránský (honzik) said :
#4

> If the sample is cube, does it use coord_100?

what does "it" mean?
If the sample is cubic, the choice of coord should not matter (as long as the coord belongs to the cube), see the example below

> Can you explain the specific meaning of (float)arg1? How can I choose the value?

You choose the value such that it corresponds to the point where you want to compute the cross section :-)

you can experiment with the following script
###############
from yade import pack
r=.2
sp = pack.regularHexa(pack.inAlignedBox((0,0,0),(10,10,10)),r,0) # cubic sample
sp = [s for s in sp if pow(5-s.state.pos[0],2)+pow(5-s.state.pos[1],2)<=pow(.5*10-.5*s.state.pos[2]-r,2)] # make it a cone
O.bodies.append(sp)
# -r in the <= condition assumes that the spheres are almost entirely (not only their centers) inside the cone
#
print -10, approxSectionArea(-10,2), 'should be 0'
print 20, approxSectionArea(20,2), 'should be 0'
for z in (0,2,4,6,8,10):
   print z, approxSectionArea(z,2), 'theoretically',pi*.25*pow(10-z,2)
###############

cheers
Jan

Revision history for this message
xjin (jpeng22) said :
#5

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