YADE stops when click [Show 3D] button

Asked by Hien Nguyen

Hello everybody,
I have Yade-daily installed from the precompiled binaries and another one YADE 1.00 which I compile from the download page.
This is what happened when I run from the compiled version: when I run and press F12, the graphic interface pop out, and when I click the Show 3D button, the 3D view just flash for a moment and turn off right away, then the graphic interface window and the terminal turn off themself unexpectly also.
And as I recalled, when I compiled Yade, I already had all the prerequisite packages installed.

For the Yade from precompiled binaries, that function runs well, no problem.
My system is Ubuntu 12.04.1 64bit
Any help?

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Alsidqi Hasan (alsidqi-hasan) said :
#2

Dear Yade user,

I am using facetBunker (funnel like shape) to rain the particles. It gave me the following problem:

IndexError                                Traceback (most recent call last)
/usr/lib/yade/py/yade/__init__.pyc in <module>()

/usr/lib/yade/py/yade/__init__.pyc in checkUnbalanced()
     51    if utils.unbalancedForce()<.05:
     52       O.pause()
---> 53       plot.saveDataTxt('bbb.txt.bz2')
     54
     55 def addPlotData():

/usr/lib/yade/py/yade/plot.pyc in saveDataTxt(fileName, vars)
    641         else: f=open(fileName,'w')
    642         f.write("# "+"\t\t".join(vars)+"\n")
--> 643         for i in range(len(data[vars[0]])):
    644                 f.write("\t".join([str(data[var][i]) for var in vars])+"\n")
    645         f.close()

IndexError: list index out of range

I can avoid this error by reducing number of particles significantly. Is there anyone can help me what is the IndexError: list index out of range means? and what is the work around so that I can use the funnel but at the same time don't want to reduce the number of particle.

Thank you,
Best Regards,

Alsidqi

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

Hi Alsidqi,

sorry for late relpy. Could you please attach an example script (just copy
it to the mail body) reproducing the error? If you could delete unnecessary
code, it would be nice :-) With the script we can try to run it and it will
help us to solve the prbolem
Thanks
Jan

2013/11/3 Alsidqi Hasan <email address hidden>

> Question #237548 on Yade changed:
> https://answers.launchpad.net/yade/+question/237548
>
> Alsidqi Hasan posted a new comment:
> Dear Yade user,
>
> I am using facetBunker (funnel like shape) to rain the particles. It
> gave me the following problem:
>
> IndexError Traceback (most recent call last)
> /usr/lib/yade/py/yade/__init__.pyc in <module>()
>
> /usr/lib/yade/py/yade/__init__.pyc in checkUnbalanced()
> 51 if utils.unbalancedForce()<.05:
> 52 O.pause()
> ---> 53 plot.saveDataTxt('bbb.txt.bz2')
> 54
> 55 def addPlotData():
>
> /usr/lib/yade/py/yade/plot.pyc in saveDataTxt(fileName, vars)
> 641 else: f=open(fileName,'w')
> 642 f.write("# "+"\t\t".join(vars)+"\n")
> --> 643 for i in range(len(data[vars[0]])):
> 644 f.write("\t".join([str(data[var][i]) for var in
> vars])+"\n")
> 645 f.close()
>
> IndexError: list index out of range
>
> I can avoid this error by reducing number of particles significantly. Is
> there anyone can help me what is the IndexError: list index out of range
> means? and what is the work around so that I can use the funnel but at
> the same time don't want to reduce the number of particle.
>
> Thank you,
> Best Regards,
>
> Alsidqi
>
> --
> 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
Alsidqi Hasan (alsidqi-hasan) said :
#4

Dear Jan,

Thanks for help. The following is the code.

from yade import pack, plot
O.bodies.append(utils.geom.facetBox((.5,.5,1),(.5,.5,1),wallMask=29))

O.bodies.append(utils.geom.facetBunker((.5,.5,1.5),1,0.5,4,0.5,hPipe=0.1))

O.bodies.append(utils.geom.facetBox((1.25,0.5,.25),(.25,.25,.25),wallMask=2))
O.bodies.append(utils.geom.facetBox((1.25,0.5,.25),(.25,.25,.25),wallMask=4))
O.bodies.append(utils.geom.facetBox((1.25,0.5,.25),(.25,.25,.25),wallMask=8))
O.bodies.append(utils.geom.facetBox((1.25,0.5,.25),(.25,.25,.25),wallMask=16))
O.bodies.append(utils.geom.facetBox((1.25,0.5,.25),(.25,.25,.25),wallMask=32))

O.bodies.append(facet([(1,0,2),(1,1,2),(1,1,0.5)],dynamic=False))
O.bodies.append(facet([(1,0,2),(1,1,0.5),(1,0,0.5)],dynamic=False))

O.bodies.append(facet([(1,0,0.5),(1,0.25,0.5),(1,0.25,0)],dynamic=False))
O.bodies.append(facet([(1,0,0.5),(1,0.25,0),(1,0,0)],dynamic=False))

O.bodies.append(facet([(1,0.75,0.5),(1,1,0.5),(1,1,0)],dynamic=False))
O.bodies.append(facet([(1,0.75,0.5),(1,1,0),(1,0.75,0)],dynamic=False))

#O.materials.append(FrictMat(density=2e3,young=30e6,poisson=.2,frictionAngle=.6,label="soils"))

sp=pack.SpherePack()
sp.makeCloud((0.15,0.15,2),(0.85,0.85,6.5),rMean=.02)##,rRelFuzz=0.)
sp.toSimulation()

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom()],
      [Ip2_FrictMat_FrictMat_FrictPhys()],
      [Law2_L3Geom_FrictPhys_ElPerfPl()]
   ),
   GravityEngine(gravity=(0,0,-9.81)),
   NewtonIntegrator(damping=0.05),
   PyRunner(command='checkUnbalanced()',realPeriod=2),
   PyRunner(command='addPlotData()',iterPeriod=100)
]

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

def checkUnbalanced():
   if utils.unbalancedForce()<.05:
      O.pause()
      plot.saveDataTxt('bbb.txt.bz2')

def addPlotData():
   plot.addData(i=O.iter,unbalanced=utils.unbalancedForce(),**O.energy)

yade.qt.View();

#plot.plots={'i':('unbalanced',None,O.energy.keys)}
#plot.plot()
O.saveTmp()

I have one more question:
How I change the properties of the spheres that I already created using makecloud.

Thank you very much,
Best Regards,

Alsidqi

On Wednesday, November 6, 2013 11:02 PM, Jan Stránský <email address hidden> wrote:

Question #237548 on Yade changed:
https://answers.launchpad.net/yade/+question/237548

Jan Stránský posted a new comment:
Hi Alsidqi,

sorry for late relpy. Could you please attach an example script (just copy
it to the mail body) reproducing the error? If you could delete unnecessary
code, it would be nice :-) With the script we can try to run it and it will
help us to solve the prbolem
Thanks
Jan

2013/11/3 Alsidqi Hasan <email address hidden>

> Question #237548 on Yade changed:
> https://answers.launchpad.net/yade/+question/237548
>
> Alsidqi Hasan posted a new comment:
> Dear Yade user,
>
> I am using facetBunker (funnel like shape) to rain the particles. It
> gave me the following problem:
>
> IndexError                                Traceback (most recent call last)
> /usr/lib/yade/py/yade/__init__.pyc in <module>()
>
> /usr/lib/yade/py/yade/__init__.pyc in checkUnbalanced()
>      51    if utils.unbalancedForce()<.05:
>      52      O.pause()
> ---> 53      plot.saveDataTxt('bbb.txt.bz2')
>      54
>      55 def addPlotData():
>
> /usr/lib/yade/py/yade/plot.pyc in saveDataTxt(fileName, vars)
>    641        else: f=open(fileName,'w')
>    642        f.write("# "+"\t\t".join(vars)+"\n")
> --> 643        for i in range(len(data[vars[0]])):
>    644                f.write("\t".join([str(data[var][i]) for var in
> vars])+"\n")
>    645        f.close()
>
> IndexError: list index out of range
>
> I can avoid this error by reducing number of particles significantly. Is
> there anyone can help me what is the IndexError: list index out of range
> means? and what is the work around so that I can use the funnel but at
> the same time don't want to reduce the number of particle.
>
> Thank you,
> Best Regards,
>
> Alsidqi
>
> --
> 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
>

--
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
Jan Stránský (honzik) said :
#5

Hi Alsidqi,

sorry for very late answer again. With the script you sent, I have no
problem with graphics. What system do you use and what version of Yade do
you have and how did you install it (from packeges or from source)?

>
> I have one more question:
> How I change the properties of the spheres that I already created using
> makecloud.
>

 you can modify properties by:

sp=pack.SpherePack()
sp.makeCloud((0.15,0.15,2),(0.85,0.85,6.5),rMean=.02)##,rRelFuzz=0.)
spheresIDs = sp.toSimulation()
for i in spheresIDs:
  b = O.bodies[i]
  b.state.whatever = whatever # [3], velocity, position...
  b.shape.whatever = whatever # [1,2], radius, color...

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#shape
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Sphere
[3] https://yade-dem.org/doc/yade.wrapper.html#state

...