yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18513
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:
Sorry for the late but i was far away from the office.
This is my analysis for the total time involved to perform the same
simulation (both lammps and yade write on file and insert particle
almost in the same way).
#Nballl TotCPU YADE
200 23.1
400 42.9
800 85.4
1200 144.9
1600 225.7
2000 416.3
#Nballl TotCPU LAMMPS
200 15.3
400 25.1
800 36.9
1200 44.8
1600 60.1
2000 78.0
I give you the YADE script used. Run it as
time yade -j 4 -n MyScript.py Nball logfile
i use the command time that print you the total time at the end of the
execution.
Andrea
---------------------------------------------------------------------------------------------
from yade import pack,ymport,export,geom,bodiesHandling,timing
import numpy as np
import math
import sys
import random
def printator():
neff=len(O.bodies)-nBodyCont
f1.write(str(O.iter)+' '+str(O.time)+' '+str(O.speed)+'
'+str(O.realtime)+' '+str(kineticEnergy())+' '+str(neff)+'\n')
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+nBodyCont-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])
f1=open(str(sys.argv[2]), 'w')
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),],label='collider',verletDist=rball*0.3),
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(),len(O.bodies)-nBodyCont",iterPeriod=10000)]+[PyRunner(command
=
"adder()",iterPeriod=10000),PyRunner(command =
"printator()",iterPeriod=10000)]
O.timingEnabled=True
O.dt=0.2*tRay
O.run(500000)
O.wait()
exit()
On 11/30/18 6: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:
> Welcome.
> That would be interesting for me to see:
>
> N=.. | YadeTime | LammpsTime
> 200
> 400
> ...
> 2400
>
> I was checking Ig2_Facet_Sphere and there is certainly a way to avoid
> some matrix manipulation by escaping sooner when there is no contact.
> However I'll not hurry on that one though and it would not change you
> life by orders of magnitude anyway.
>
> Besides, it is not a surprise if details of the Hertz models differ, and
> that would be interesting top know the consequence from a physics point
> of view also.
>
> Looking forward. :)
>
> Bruno
>
--
You received this question notification because your team yade-users is
an answer contact for Yade.