Re: [Yade-users] [Question #155725]: Plot data

2023-08-28 Thread Yade Guide
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Yade Guide posted a new comment:
Hey there! As an automated bot, I've scanned through relevant threads
and compiled a summary for your reference. Feel free to explore further
by clicking on the links attached.

Title: "interaction histogram"
The user is having trouble plotting a polar interaction histogram using 
'interaction-histogram.py'. They have defined a function called 'Intrhisto()' 
which plots the histogram at certain intervals, but nothing is being plotted in 
the output file. The user has also successfully used 'utils.plotDirections()' 
before and wants help with this issue. The function plotDirections() uses other 
functions, interactionAnglesHistogram() and bodyNumInteractionsHistogram(), 
which are defined here: https://github.com/yade/trunk/blob/master/py/_utils.cpp.
https://answers.launchpad.net/yade/+question/247136


Title: "imposible to reach specific porosity"
The user encounters difficulty in achieving a specific porosity level during a 
periodical triaxial test tutorial, causing the simulation to halt when the 
condition is not met. The user suspects an issue with the 'O.run' command and 
expresses gratitude upon finding a solution.
https://answers.launchpad.net/yade/+question/703055

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-10 Thread Anton Gladky
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

Anton Gladky proposed the following answer:
Function creation is not yade feature. It is the python task to parse the 
code.
Python itself is very sensitive to indents. Try not to mix spaces and tabs 
in your script.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-10 Thread Arthur Mercier
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Answered = Open

Arthur Mercier is still having a problem:
I understand that Python is very sensitive to indents, but I really
tried everything: no space, 1 spaces, 2 spaces, 3 spaces, 4 spaces, 5
spaces, no tab, 1 tab, 2 tabs

Is this script working in yours ? http://www.2shared.com/file/iBvBTceR/prob.html
Because jduriez told me it works. I mean, is it really a wrong script or a 
problem in my Python or my Yade ?

Thanks

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-10 Thread Anton Gladky
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

Anton Gladky proposed the following answer:
Yes, it is working and draws a straight inclined line.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-09 Thread jduriez
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

jduriez proposed the following answer:
More simply, what happens if you do not save/reload ?

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-09 Thread Arthur Mercier
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Answered = Open

Arthur Mercier is still having a problem:
http://www.mail-archive.com/yade-
us...@lists.launchpad.net/msg03079.html

To install yade-daily, you just need to type in terminal:
sudo add-apt-repository ppa:yade-pkg/snapshots
sudo apt-get update
sudo apt-get install yade-daily
Thanks for the link.

So I i have Yade Bzr 2811 and Yade Daily but to create a function
doesn't work with any version, with or without saveTmp(). I don't know
where it could be from.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-06 Thread Chareyre
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

Chareyre proposed the following answer:
I see a saveTmp() in your script.
User defined functions like saveData are not saved with a simulation. 
Therefore if you reload the simulation you will get the NameError: name 
'saveData' is not defined  problem.
Is that what you are doing?

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-06 Thread Arthur Mercier
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Answered = Open

Arthur Mercier is still having a problem:
Yes it is what I'm doing... but even if I don't write saveTmp() in my
script, the problem occurs.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-06 Thread Anton Gladky
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

Anton Gladky proposed the following answer:
http://www.mail-archive.com/yade-users@lists.launchpad.net/msg03079.html

To install yade-daily, you just need to type in terminal:
sudo add-apt-repository ppa:yade-pkg/snapshots
sudo apt-get update
sudo apt-get install yade-daily

Anton



On Fri, May 6, 2011 at 8:35 PM, Arthur Mercier
question155...@answers.launchpad.net wrote:
 Question #155725 on Yade changed:
 https://answers.launchpad.net/yade/+question/155725

    Status: Answered = Open

 Arthur Mercier is still having a problem:
 I'm using Ubuntu 10.10.
 And I installed Yade as
 1) cd /home/arthur/yade This folder should be empty
 2) bzr checkout lp:yade
 3) scons PREFIX=/home/arthur/yade/build version='new'
 4) wait till it finishes
 5) /home/arthur/yade/build/bin/yade-new.

 How is it possible to have by ppa ?

 --
 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     : yade-users@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~yade-users
 More help   : https://help.launchpad.net/ListHelp


-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-05 Thread jduriez
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

jduriez posted a new comment:
It was with r2855

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-04 Thread Anton Gladky
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

Anton Gladky proposed the following answer:
But variables should be named differently:

def saveData():
 plot.addData(t1=O.time,t2=O.time)

plot.plots={'t1':('t2')}
plot.plot()

This example should work for you.
Also, if you use ubuntu, you need to update your python-matplotlib
package from our ppa:

sudo add-apt-repository ppa:yade-users/external
sudo apt-get update
sudo apt-get upgrade

Hope, that helps.

Anton



On Wed, May 4, 2011 at 5:48 PM, Arthur Mercier
question155...@answers.launchpad.net wrote:
 Question #155725 on Yade changed:
 https://answers.launchpad.net/yade/+question/155725

    Status: Answered = Open

 Arthur Mercier is still having a problem:
 Still the error message
 NameError: name 'saveData' is not defined

 Here is my script, does my script work in yours ?

 import numpy, plot, pack, geom, matplotlib

 from yade import utils,plot,pack


 # radius, number and distance of spheres
 rad,num=.1,15; dist=1.*rad

 idConcrete=O.materials.append(CpmMat(
 G_over_E=0.2,
 density=4800,
 poisson=0.19,
 young=30e9,
 dmgRateExp=0.3,
 dmgTau=1000,
 epsCrackOnset=0.0001,
 isoPrestress=0,
 neverDamage=False,
 plRateExp=0,
 plTau=-1,
 relDuctility=30,
 sigmaT=3e6,
 frictionAngle=0.7))

 len(O.materials)

 # create rectangular box from facets
 O.bodies.append(geom.facetBox((.5,-.5,.25),(.5,.5,.5),wallMask=63))
 O.bodies.append(geom.facetBox((5,-.5,.25),(.5,.5,.5),wallMask=63))
 O.bodies.append(geom.facetBox((3,1.2,.25),(.5,.5,.5),wallMask=63))

 O.bodies.append([utils.sphere((x,.1,0),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.1,.2),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.1,.4),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.3,0),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.3,.2),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.3,.4),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.5,0),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.5,.2),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])
 O.bodies.append([utils.sphere((x,.5,.4),rad,wire=True,material=0) for x in 
 numpy.arange(0,55*rad,dist)])

 O.dt=.5*utils.PWaveTimeStep()


 O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
        InteractionLoop(
                
 [Ig2_Sphere_Sphere_Dem3DofGeom(),Ig2_Facet_Sphere_Dem3DofGeom()],
                [Ip2_CpmMat_CpmMat_CpmPhys()],
                [Law2_Dem3DofGeom_CpmPhys_Cpm()]),
        GravityEngine(gravity=(0,-20,0)),
        TranslationEngine(translationAxis=(0,-1,0),velocity=1,ids=[24, 25, 26, 
 27, 28, 29, 30, 31, 32, 33, 34, 35]),
        NewtonIntegrator(damping=0.1),
        PyRunner(iterPeriod=100,command='saveData()'),
 ]

 def saveData():
  plot.addData({'t':O.time,'t':O.time})

 plot.plots={'t':('t')}
 yade.qt.Controller();
 O.saveTmp()

 --
 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     : yade-users@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~yade-users
 More help   : https://help.launchpad.net/ListHelp


-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-04 Thread Arthur Mercier
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Solved = Open

Arthur Mercier is still having a problem:
Ok, so I just changed the end of my script:

O.engines=[
[...]
PyRunner(iterPeriod=100,command=saveData()),
]

def saveData():
 plot.addData(t1=O.time,t2=O.time)

plot.plots={'t1':('t2')}
plot.plot()

yade.qt.Controller();

O.saveTmp()
Here is the complete script http://www.2shared.com/file/iBvBTceR/prob.html.

But really... I still have the problem when I run the simulation (compilation 
is done, no error),
NameError Traceback (most recent call last)

/home/arthur/yade/build/lib/yade-new/py/yade/__init__.pyc in module()
 1 
  2 
  3 
  4 
  5 

NameError: name 'saveData' is not defined.

Does my script works good in yours ?

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-03 Thread jduriez
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Open = Answered

jduriez proposed the following answer:
Hello,

data that you can plot are contained in a place you have to fill with
instruction plot.addData(what_you_want_to_store=how_you_get_it)

You have to launch this instruction (contained in more general function
like myAddPlotData() for example) each time you want to store a value.
Then the use of a PyRunner - among other engines - which will launch
periodically your myAddPlotData() function and stores periodically the
values you're interested in.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #155725]: Plot data

2011-05-03 Thread Arthur Mercier
Question #155725 on Yade changed:
https://answers.launchpad.net/yade/+question/155725

Status: Answered = Open

Arthur Mercier is still having a problem:
Ok, I think I understand but the problem is still I don't know how to create a 
function
It plots, but I have to pause the simulation and to write each time what I 
want... which is not conveniant. I'd like to plot automatically at each 50 
iterations for instance.
How to do the thing below at each 50 iterations ?
plot.plots={'t':('velocity')}
plot.addData({'t':O.time, 'velocity':O.bodies[77].state.angVel[0]})

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp