[Yade-users] [Question #667571]: How to build a sphere pack using a expression for the radius

2018-04-04 Thread Amauri Aguiar de Freitas
New question #667571 on Yade:
https://answers.launchpad.net/yade/+question/667571

Hello every one,

I am trying to reproduce the article “A spherical discrete element model: 
calibration procedure and incremental response”, and in this paper the autors 
used an expression to Rw, as indicated below, to determine the radius of every 
sphere in the sphere pack. My question is: How can I construct a sphere pack 
using an expression like this to determine the radius of every sphere?

Rw=Rmin+(Rmax-Rmin)(-0.15 * ln(1-rand[0;1]))^(1/0.75)

Regards,
Amauri

-- 
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 #667546]: The yade won't print anything until the python script is all finished in slurm command

2018-04-04 Thread JIPEIQI
Question #667546 on Yade changed:
https://answers.launchpad.net/yade/+question/667546

Status: Answered => Solved

JIPEIQI confirmed that the question is solved:
Hi Jan!
the sys.stderr.write works, thank you so much

-- 
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 #667546]: The yade won't print anything until the python script is all finished in slurm command

2018-04-04 Thread Jan Stránský
Question #667546 on Yade changed:
https://answers.launchpad.net/yade/+question/667546

Status: Open => Answered

Jan Stránský proposed the following answer:
Hello,
just an idea (not tested), would
###
print "whatever"
sys.stdout.flush()
###
help?

Alternatively, you can use a workaround, instead of print, use
sys.stderr.write("whatever\n") # [1]
as this was printed..

Even more workaround, instead of printing, you can open a file and write
to it..

cheers
Jan

[1] https://github.com/yade/trunk/blob/master/core/main/main.py.in#L180

-- 
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


[Yade-users] [Question #667546]: The yade won't print anything until the python script is all finished in slurm command

2018-04-04 Thread JIPEIQI
New question #667546 on Yade:
https://answers.launchpad.net/yade/+question/667546

Hi everyone! I'm using the HPC to run yade with the operation system of centos. 
You have to submit your job via the slurm [1] system. So here is the problem:
when you use "yade sth.py" command, it will print the information that you use 
"print "sth" " command in your python script line by line.
And in hpc, however you need to create another script like "a.sbatch" which 
writes:

#!/bin/bash
#SBATCH -c 8 -p hpxg -t 100 
yade -j 8 gravity.py 

Then you can type "sbatch a.sbatch" to submit your job. And when you do this, 
all printed informations will only show up when all of your python script is 
finished. I.e., for the gravity.py:

from yade import pack
import time
print 1
O.bodies.append(geom.facetBox((.5,.5,.5),(.5,.5,.5),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.01,rRelFuzz=.5)
sp.toSimulation()
print len(O.bodies)
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1),

VTKRecorder(fileName='/data/pqji/yade-run/gravity-',recorders=['all'],label='vvtk',iterPeriod=200),
PyRunner(command='checkUnbalanced()', iterPeriod=1000)
]
O.dt=.5*PWaveTimeStep()
print O.dt
def checkUnbalanced():
print "unbalance force is %s" % unbalancedForce()
if unbalancedForce()<.0001:
print "Finish"
O.pause()
O.run(wait=True)  #
time.sleep(1) # I have to add this line so the slurm won't kill my job, 
as if this line is not added,  the ipython line will show up and the slurm will 
think my job has finished.(At least I guess)

All informtions that should be printed show up until time.sleep(1) is excuated. 
Before that, the output log of slurm (similar like the output window when you 
use the yade sth.py command) is just:

TCP python prompt on localhost:9000, auth cookie `sdkaue'
Welcome to Yade 2018.02b 
XMLRPC info provider on http://localhost:21000
Running script gravity.py

Nothing showup but the VTK files are being created, which means the simulations 
are running.
Any instructions?

[1]https://slurm.schedmd.com/

-- 
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