Segmentation fault due to the interaction

Asked by Defri

Dear all,

I am very new and only learn YADE from Youtube of Mr. Janek Kozicki, so I only know a few things. Probably my problem is in principle but unfortunately I cannot locate the problem itself more accurately. I am just assuming that it is in the interaction especially on the functors, I dunno how to use it efficiently.

I am using:
Yade 2020.01a
Using python version: 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
TCP python prompt on localhost:9000, auth cookie `kcysud'
XMLRPC info provider on http://localhost:21000

I am trying to build up a simulation for a simple Rockfall model, that if I can describe it, there are a boulder and grain (Z Y view), I want to make the boulder drops into the grains, and I want to make the grains is scattered under the weight of the boulder. The floor (I am using wall) has no interaction, just as a base/bed.
I tried to input other functor which is [Ip2_FrictMat_FrictMat_FrictPhys()] in twice, because if I input only once the "segmentation fault" will be happened.
If this script of mine is working properly, the sequence of simulation should be as follow:
Generate a sphere > create Spherepack > create a wall (as a floor) > a sphere (boulder) drops into the grains (spherepack)

I noticed that other researchers had asked similar question in Launchpad, but I still can't find a solution to my problem here.
My script is as follow:

##Define Geometry
O.bodies.append([utils.sphere(center=(.35,-.35,1),radius=.3)])

##Sphere pack in box shape
from yade import pack, timing
readParamsFromTable(num=12000)
sp=pack.SpherePack()
sp.makeCloud((-.1,.1,0),(.8,-.8,.5),.03*((12000./yade.params.table.num)**(1/3.)),.5)

##Wall
O.bodies.append(wall((0,0,0),axis=2))

##Engines and Constitutive Law
O.engines=[ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],),
 InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),
  NewtonIntegrator(damping=0.1,gravity=[0,0,-9.81])]

O.dt=.01*PWaveTimeStep()

#O.save('/tmp/c.xml.bz2');

I hope to get some advice on how to solve this problem of mine.
Thank you very much in advance!

Question information

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

Hello,

> I am very new

welcone :-)

is this question different from https://answers.launchpad.net/yade/+question/694167?
If not, please next time do not open a new question for the same question, but rather update / give more info to the original one

> I am just assuming that it is in the interaction especially on the functors, I dunno how to use it efficiently.

why are you assuming this?

> I tried to input other functor which is [Ip2_FrictMat_FrictMat_FrictPhys()] in twice, because if I input only once the "segmentation fault" will be happened.

InteractionLoop accepts three lists, Ig2, Ip2 and Law2 functors. The way you have it in the code does not make sense.

How do you run the script? (line-by-line in interactive console, using a script file, ...)?

cheers
Jan

Revision history for this message
Defri (daredefri) said :
#2

Hello Mr. Jan Stránský

>is this question different from https://answers.launchpad.net/yade/+question/694167?
If not, please next time do not open a new question for the same question, but rather update / give more info to the original one

Yes it is same..noted..I am sorry for the way I asked, because for the reply, you suggested me to open this [1] https://www.yade-dem.org/wiki/Howtoask therefore I made a new question. Anyway I already rejected the first one.

>why are you assuming this?
Because when I made the script for sphere and spherepack, they have been done..It run properly. However when I am using the interaction, I am always failed, the boulder could not drop into the grains. Then I gave comment to the interaction.

>How do you run the script? (line-by-line in interactive console, using a script file, ...)?
I am using a script file. Actually I interpret by myself how to use the functors. I do not understand how to use Ig2, Ip2 and Law2 for my case.

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

> I am sorry for the way I asked

for the first time it is acceptable :-)

> I am using a script file.

then run the file (producing the segmentation fault), just with "catchsegv" before it, and provide the output
so e.g. if you run
yade script.py
then provide output of
catchsegv yade script.py

> I do not understand how to use Ig2, Ip2 and Law2 for my case.

see e.g. [1]
this should work:
###
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()],), # no need to double Bo1_Sphere_Aabb
 InteractionLoop(
   [Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], # ig2 list, no need to double Ig2_Sphere_Sphere_ScGeom
   [Ip2_FrictMat_FrictMat_FrictPhys()], # ip2 list (just one list!)
   [Law2_ScGeom_FrictPhys_CundallStrack()]), # law2 list
###

cheers
Jan

[1] https://yade-dem.org/doc/user.html#functors-choice

Revision history for this message
Defri (daredefri) said :
#4

Thank you for the support

1. I typed catchsegv (yade script).py it did not show anything..just empty display, but when I only typed (yade script).py, it runs well, thank you so much.

2. The boulder drops well into the grains, but how to make the grains NOT moving down as well like the boulder? so just the boulder drops the grains, and the grains will be scattered due to the weight of the boulder.
The grains just stay there waiting the dropping boulder, not moving at the same time like the boulder.

Best regards.

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

1.
does it mean the segmentation fault problem is not present any more?

2.
please read [1] and open a new question for a new question :-)

cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Defri (daredefri) said :
#6

1. yes, it is not present any more. Since I ran your helping script, It runs normally now.

2. Okay, I will make a new question now.

thank you so much.