yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #05804
Re: [Question #192485]: O.load and O.loadTmp influences calculation speed ?!
Question #192485 on Yade changed:
https://answers.launchpad.net/yade/+question/192485
Christian Jakob posted a new comment:
#To reproduce, you can use this script:
load_ = 1 #=0 for NOT using O.loadTmp(), =1 for using O.loadTmp()
num_balls1D = 20
num_balls = num_balls1D*num_balls1D*num_balls1D
origin_wall = num_balls1D/2
x_pos = 0
y_pos = 0
z_pos = 0
friction=0.5
angle=atan(friction)
id_FacetMat=O.materials.append(ViscElMat(kn=1e8,ks=1e8,cn=0.0,cs=0.0,frictionAngle=angle))
id_SphereMat=O.materials.append(ViscElMat(kn=1e6,ks=1e6,cn=0.0,cs=0.0,density=1000,frictionAngle=angle))
FacetMat=O.materials[id_FacetMat]
SphereMat=O.materials[id_SphereMat]
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom()],
[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
[Law2_ScGeom_ViscElPhys_Basic()],
),
NewtonIntegrator(damping=0.7,gravity=(0,0,-9.81)),
]
from yade import timing
O.timingEnabled=True
O.dt=1e-3
#create spheres:
for ii in range(1,num_balls1D+1):
x_pos = x_pos + 1
y_pos = 0
z_pos = 0
for jj in range(1,num_balls1D+1):
y_pos = y_pos + 1
z_pos = 0
for kk in range(1,num_balls1D+1):
z_pos = z_pos + 1
O.bodies.append(utils.sphere([x_pos,y_pos,z_pos], material=SphereMat, radius=0.5))
#create facet:
id_facet=O.bodies.append(geom.facetBox((origin_wall,origin_wall,0),(200,200,0),material=FacetMat))
O.run(100,True)
if load_ == 1:
O.saveTmp()
O.loadTmp()
start_time = O.realtime
O.run(1000,True)
stop_time = O.realtime
calc_time_sec = stop_time-start_time
print calc_time_sec
timing.stats()
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.