← Back to team overview

yade-users team mailing list archive

[Question #691822]: How to update volume of cells in PeriodicFlowEnigne

 

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

Dear all,

I'd like to use PeriodicFlowEngine to get Volume of Voronoi cell.I run MWE and I get Volume of Voronoi cell successfully in the first time. But the volume is not updated as the pack changes. How to update volume of cells in PeriodicFlowEngine?

Thanks for your any suggestions.

#####MWE#####

from yade import pack,qt
O.periodic=True

O.cell.hSize=Matrix3(0.2, 0, 0,
				0 ,0.2, 0,
				0, 0, 0.2)

sp=pack.SpherePack()
radius=5e-3
num=sp.makeCloud(Vector3().Zero,O.cell.refSize,radius,.2,5000,periodic=True) # min,max,radius,rRelFuzz,spheresInCell,periodic
O.bodies.append([sphere(s[0],s[1]) for s in sp])

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb()],verletDist=.05*radius),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()]
	),
	PeriTriaxController(dynCell=True,mass=0.2,maxUnbalanced=0.01,relStressTol=0.02,goal=(-1e4,-1e4,0),stressMask=3,globUpdate=5,maxStrainRate=(1.,1.,1.),label='triax'),
    NewtonIntegrator(damping=.2),
    PeriodicFlowEngine(dead=1,useSolver=3,label="flow"),
    PyRunner(command='test()',iterPeriod=1000)
]
O.dt=PWaveTimeStep()
O.run();
qt.View()

def test():
    volume=0
    flow.compTessVolumes()
    for b in O.bodies:
        volume += flow.volume(b.id)
    print (volume)

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