Question #678645 on Yade changed:
https://answers.launchpad.net/yade/+question/678645
Jan Stránský proposed the following answer:
Hello,
thanks for the code (although, as Bruno pointed, it is not very minimal ;-) Why
it is not MWE:
- unused or unnecessarry code (import datetime, qtr.bgColor)
- materials are irrelevant to the problem (and you define CohFrictMat and in
engines you have just FrictMat)
- facetCylinder is also not needed
- there are quite a lot particles for testing
- but MOST importantly, it is not WORKING example. Your Shrinkage function ends
with error and there are several problems:
- for i in O.bodies[Sphere]: # ???
- utils.growParticles(0.5,updateMass=True) # probably you meant just
growParticle (without s). growParticles grow all particles. Not what you want
and it not very reasonable to use it inside looping over all bodies..
Next time please try to create a MWE specific for the problem.
Quite often you solve the problem yourself this way ;-)
> the radius will be reduced instantly. but I want their reduction in each step.
> PyRunner(command='Shrinkage()', label='Shrink',iterPeriod=700000)
if you want the reduction in each step, use iterPeriod=1
a MWE (demonstration how to shrink particles and an inspiration how true MWE
could look like):
###
# you can see particles growing below the wall. For shrinkage, just use
multiplier <1
from yade import pack
rMean,num = 1e-3, 100
sp=pack.SpherePack()
sp.makeCloud((-5e-3,-5e-3,0),(5e-3,5e-3,20e-3),rMean=rMean,num=num)
O.bodies.append([utils.sphere(c,r) for c,r in sp])
O.bodies.append(wall((0,0,-5e-3),2))
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(gravity=(0,0,-9.81),damping=0.4),
PyRunner(iterPeriod=1,command='shrink()'),
]
O.dt=1e-5
def shrink():
for b in O.bodies:
if not isinstance(b.shape,Sphere):
continue
if b.state.pos[2] < -5e-3:
growParticle(b.id,1+1e-4,updateMass=True)
###
cheers
Jan
--
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 : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help : https://help.launchpad.net/ListHelp