Parametric studies -Datas problem

Asked by Ferenc Safranyik

Hy Everybody,

I'm a newbie in Yade, for this reason please help me. I would like to make a parametric study of Triaxial test. I would like to change any parameters in the simulations. For this I used the yade batch mode, and everything was good. A little problem for me: I want to make a diagram from normal and shear forces based on the multiple simulations with one script. How can I save specified datas in all simulation than (if all of the simulations done) process these datas.

I hade been testing functions, for and while loops, but these were not good.

def Gravitydepos():
   # basic simulation showing sphere falling ball gravity,
   # bouncing against another sphere representing the support

  # DATA COMPONENTS

  # add 2 particles to the simulation
  # they the default material (utils.defaultMat)
  O.bodies.append([
    # fixed: particle's position in space will not change (support)
     utils.sphere(center=(0,0,0),radius=.5,fixed=True),
     # this particles is free, subject to dynamics
     utils.sphere((0,0,2),.5)
  ])

  # FUNCTIONAL COMPONENTS

  # simulation loop -- see presentation for the explanation
  O.engines=[
     ForceResetter(),
     InsertionSortCollider([Bo1_Sphere_Aabb()]),
     InteractionLoop(
        [Ig2_Sphere_Sphere_L3Geom()], # collision geometry
        [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
        [Law2_L3Geom_FrictPhys_ElPerfPl()] # contact law -- apply forces
     ),
     # apply gravity force to particles
     GravityEngine(gravity=(0,0,-9.81)),
     # damping: numerical dissipation of energy
     NewtonIntegrator(damping=0.1)
  ]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed
  O.dt=.5e-4*utils.PWaveTimeStep()

# save the simulation, so that it can be reloaded later, for experimentation
  O.saveTmp()

I can not call this function. please help me! Thanks a lot!

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#1

Hi Ferenc,
first of all please don't use GravityEngine anymore. It is now part of the newton integrator.
So using NewtonIntegrator(damping=0.1, gravity=(0,0,-9.81)) is enough.
If I got you right, your problem is that you can't execute your self-defined python functions in a yade simulation, right?
There is a Engine called PyRunner for this purpose [1]. This engine calls the specified function regularly. In your case it will be sufficent to call your function before (or after) your engine list:

Gravitydepos()
O.engines=[
     ForceResetter(),
     InsertionSortCollider([Bo1_Sphere_Aabb()]),
     InteractionLoop(
        [Ig2_Sphere_Sphere_L3Geom()], # collision geometry
        [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
        [Law2_L3Geom_FrictPhys_ElPerfPl()] # contact law -- apply forces
     ),
     # damping: numerical dissipation of energy
     NewtonIntegrator(damping=0.1,gravity=(0,0,-9.81)),
     #here would PyRunner go: (just for illustration)
     #PyRunner(command='Gravitydepos',iterPeriod=1)
  ]

Cheers,
Alex

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=pyrunner#yade.wrapper.PyRunner

Revision history for this message
Ferenc Safranyik (safranyikf) said :
#2

Thanks for the quick help Alex,

I can use the PyRunner, my problem in some detail:

 How can I make a parametric study (I want to change some parameters , such as with batch mode and parametersTable) and how can I process the results of multiple simulations (such as average force or stress calculation, regression, diagram plot) with one script?

Thank you for the help

Revision history for this message
Anton Gladky (gladky-anton) said :
#3

Hi,

batch-mode is the best option for you [1]. We should probably
update those scripts to make them more visible/readable.

[1] https://github.com/yade/trunk/tree/master/examples/test/multi

Anton

2014-07-22 10:16 GMT+02:00 Ferenc Safranyik
<email address hidden>:
> Question #251967 on Yade changed:
> https://answers.launchpad.net/yade/+question/251967
>
> Ferenc Safranyik posted a new comment:
> Thanks for the quick help Alex,
>
> I can use the PyRunner, my problem in some detail:
>
> How can I make a parametric study (I want to change some parameters ,
> such as with batch mode and parametersTable) and how can I process the
> results of multiple simulations (such as average force or stress
> calculation, regression, diagram plot) with one script?
>
> Thank you for the help
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp

Revision history for this message
Ferenc Safranyik (safranyikf) said :
#4

Is it possible to plot the maximum interaction force in function of initial speed from every simulation with the script [1]?

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#5

Hello,

Did you give a look to https://www.yade-dem.org/doc/user.html#merging-gnuplot-from-individual-jobs ?
I have the feeling it may help you.

Revision history for this message
Anton Gladky (gladky-anton) said :
#6

2014-07-22 11:07 GMT+02:00 Ferenc Safranyik
<email address hidden>:
> Is it possible to plot the maximum interaction force in function of
> initial speed from every simulation with the script [1]?

You can save each simulation in its own folder and
store there all needed data, then analyze it.

Anton

Revision history for this message
Ferenc Safranyik (safranyikf) said :
#7

Thanks for the help. Works!

Cheers.

Revision history for this message
Ferenc Safranyik (safranyikf) said :
#8

Thanks Jérôme Duriez, that solved my question.