← Back to team overview

yade-users team mailing list archive

[Question #691584]: About periodic simple shear

 

New question #691584 on Yade:
https://answers.launchpad.net/yade/+question/691584

Hello, I am a new user for yade. When I study the yade documentation about periodic simple shear, I don't understand the meaning of "if 0:..., else:...". The detailed code is following:

from yade import pack,plot
# the "if 0:" block will be never executed, therefore the "else:" block will be
# to use cloud instead of regular packing, change to "if 1:" or something similar
if 0:
# create cloud of spheres and insert them into the simulation
# we give corners, mean radius, radius variation
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(2,2,2),rMean=.1,rRelFuzz=.6,periodic=True)
# insert the packing into the simulation
sp.toSimulation(color=(0,0,1)) # pure blue
else:
# in this case, add dense packing
O.bodies.append(
pack.regularHexa(pack.inAlignedBox((0,0,0),(2,2,2)),radius=.1,gap=0,color=(0,0,
,!1))
)

Please help me understand the grammar of "if 0:..., else:...". Thanks a lot!


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.