yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18466
Re: [Question #676451]: optimize camputational time for vibrated granular media
Question #676451 on Yade changed:
https://answers.launchpad.net/yade/+question/676451
Status: Answered => Open
Andrea Plati is still having a problem:
Here you find the working code: the comparison i'm talking about is
between the case of Nball=300 grains Nball=2600.
run the script as:
yade - j 4 -n script.py Nball
I misure the velocity of a simulation considering the average over time
of O.speed or the angular coefficient of the line O.realtime VS O.iter.
The verletList=2*rball has been chosen because after some attempts i
found that it makes faster the 300 ball case... but maybe there is a
better choice.
This is the timing.stats() in the case of 50000 steps in the stationary
state of the 2600 balls case:
Name Count Time Rel. time
-------------------------------------------------------------------------------------------------------
ForceResetter 50000
2226036us 3.09%
"collider" 340 549592us 0.76%
InteractionLoop 50000
57352064us 79.53%
NewtonIntegrator 50000
11860431us 16.45%
"shaker" 50000 121798us 0.17%
PyRunner 5 1367us 0.00%
PyRunner 5 199us 0.00%
TOTAL 72111491us 100.00%
Thanks!
Andrea
SCRIPT:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
from yade import pack,ymport,export,geom,bodiesHandling
import numpy as np
import math
import sys
import random
def adder():
if(len(O.bodies)<Nball+nBodyCont):
sp=pack.SpherePack()
sp.makeCloud(minCorner=(-rcont/1.4,-rcont/1.4,hcone),maxCorner=(rcont/1.4,rcont/1.4,hcone+hcil),rMean=rball,num=Nball+60-len(O.bodies))
sp.toSimulation()
#Dimensioni utili
rball=0.002
hcone=6.37*rball
rcont=22.5*rball
rconelow=4*rball
hcil=17.13*rball
Nball=int(sys.argv[1]) #Number Of Ball
A=0.00025 #amplitude shaker
fr=200 #freq shaker
#Steel
densSteel=8000
ySteel=21e7 #originale e9
poisSteel=0.293
shearModStell=ySteel/(2*(1+poisSteel))
#Plaexiglass
densPMMA=1190
yPMMA=33e6
poissPMMA=0.37
frictAngle=radians(26.57)
#Add material
#plexiglass as lammps
O.materials.append(FrictMat(young=yPMMA, poisson=poissPMMA,
frictionAngle=frictAngle,density=densPMMA, label='lmpPMMA'))
#Steel as lammps
O.materials.append(FrictMat(young=ySteel, poisson=poisSteel,
frictionAngle=frictAngle,density=densSteel, label='lmpSteel'))
#rayleigh time
tRay=math.pi*rball*(densSteel/shearModStell)**(0.5)/(0.1631*poisSteel+0.8766)
#container
coneId=O.bodies.append(geom.facetCone(Vector3(0,0,hcone/2.),rcont,rconelow,hcone,orientation=Quaternion((0,
0, 1),0),wallMask=(False*1+True*2+True*4),material='lmpPMMA'))
cyliId=O.bodies.append(geom.facetCylinder(Vector3(0,0,hcil/2.+hcone),rcont,hcil,orientation=Quaternion((0,
0, 1),0),wallMask=(True*1+False*2+True*4),material='lmpPMMA'))
contenitore=coneId+cyliId
nBodyCont=len(O.bodies) #60 facets
track=[]
for k in range(nBodyCont,len(O.bodies)):
track.append(O.bodies[k])
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),
],label='collider',verletDist=rball*2),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),
],
[Ip2_FrictMat_FrictMat_MindlinPhys(betan=0.4, betas=0.4),
],
[Law2_ScGeom_MindlinPhys_Mindlin(),
],
),
NewtonIntegrator(gravity=(0,0,-9.8),damping=0.0),
]
O.engines = O.engines + [HarmonicMotionEngine(ids = contenitore, A =
(0,0,A), f = (0,0,fr), label='shaker')]
O.engines = O.engines + [PyRunner(command = "print O.iter, O.time,
O.speed, O.realtime,
kineticEnergy()",iterPeriod=10000)]+[PyRunner(command =
"adder()",iterPeriod=10000)]
O.dt=0.2*tRay
O.run(1000000)
On 11/29/18 3:07 PM, Bruno Chareyre wrote:
> Your question #676451 on Yade changed:
> https://answers.launchpad.net/yade/+question/676451
>
> Status: Open => Answered
>
> Bruno Chareyre proposed the following answer:
> Very interesting feedback!
> It will be difficult to say something without a working script and without specific timings, though.
> I thus have questions, only. :)
>
> May I ask:
> - "faster": just to be sure, you are speaking of real wall clock time per numerical time iteration, correct? Are timesteps the same?
> - "more than 2000", what does it mean? 2500? one million?
> - do you have an approximately linear time vs. Nparticles?
> - "verletDist=rball*2", why?
> - would you share more of the data?
> - could you report timing.stats() [1]?
> - could you show a working script?
>
> Bruno
>
> [1] https://yade-dem.org/doc/prog.html#timing
>
--
You received this question notification because your team yade-users is
an answer contact for Yade.