← Back to team overview

yade-users team mailing list archive

[Question #707909]: export the position of sphere

 

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

Hello,
I wanted to get the positions of spheres when unbalanced Force < .05 and use export.text() to get the positions of spheres, but I failed.


from yade import pack, plot
from yade import export

# create rectangular box from facets
O.bodies.append(geom.facetBox((.5, .5, .5), (.5, .5, .5), wallMask=31))

# create empty sphere packing
sp = pack.SpherePack()
# generate randomly spheres with uniform radius distribution
sp.makeCloud((0, 0, 0), (1, 1, 1), rMean=.05, rRelFuzz=.5)
# add the sphere pack to the simulation
sp.toSimulation()

O.engines = [
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.4),
        
        PyRunner(command='checkUnbalanced()', realPeriod=2),
        
]
O.dt = .5 * PWaveTimeStep()


# if the unbalanced forces goes below .05, the packing
# is considered stabilized, therefore we stop collected
def checkUnbalanced():
	if unbalancedForce() < .05:
		O.pause()
                export.textExt("positions.txt")
O.saveTmp()



I appreciate your help.

Best.
Mikexue

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