← Back to team overview

yade-users team mailing list archive

Re: [Question #692328]: How to export the overlap data

 

Question #692328 on Yade changed:
https://answers.launchpad.net/yade/+question/692328

    Status: Answered => Open

GUANGYAO LI is still having a problem:
Great!

Please see the code below. Finally a blank overlaps.dat file was generated.  
Thanks!

Regards,
Guangyao



from yade import pack
from numpy import arange
import itertools
import random
import yade.plot

## corners of the initial packing
mn,mx=Vector3(0,0,0),Vector3(0.03,0.03,0.03)

## create material #0, which will be used as default
id_Mat=O.materials.append(FrictMat(young=7e7,poisson=.4,frictionAngle=radians(5.8),density=2650,label='spheres'))
O.materials.append(FrictMat(young=7e10,poisson=.4,frictionAngle=0,density=26500,label='frictionless'))
Mat=O.materials[id_Mat]
#create assembly of spheres:
sp=pack.SpherePack()
sp.makeCloud(mn,mx,num=14000,rMean=.0005,rRelFuzz=0.0,periodic=False)#,
#sp.makeCloud(mn,mx,num=14000,psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True)#,distributeMass=True
O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])
print(len(sp),' particles generated.')
#sp.toSimulation()


## create walls around the packing
walls=aabbWalls(material='frictionless')
wallIds=O.bodies.append(walls)

from yade import qt
qt.Controller()
qt.View()


## hope that we got the ids right?!
triax=TriaxialCompressionEngine(
	wall_bottom_id=wallIds[2],
	wall_top_id=wallIds[3],
	wall_left_id=wallIds[0],
	wall_right_id=wallIds[1],
	wall_back_id=wallIds[4],
	wall_front_id=wallIds[5],
	internalCompaction=False,
        autoCompressionActivation=False,
        #autoStopSimulation=True,
        autoUnload=False,
        updatePorosity=True,
	sigmaIsoCompaction=-10e3,
	sigmaLateralConfinement=-10e3,
	strainRate=0.02,
	frictionAngleDegree=5.8,
	StabilityCriterion = 0.001,
	max_vel=1,
)

recorder=TriaxialStateRecorder(
	iterPeriod=20,
	file="./WallStresses-clumps",
	truncate=1
)
#recorder=VTKRecorder(iterPeriod=20,
	#file="./positions",
#)


O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
		[Ip2_FrictMat_FrictMat_FrictPhys()],
		[Law2_ScGeom_FrictPhys_CundallStrack()]
	),
	GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.2),
	triax,
	recorder,
	# you can add TriaxialStateRecorder and such here…
	NewtonIntegrator(damping=.001),
        VTKRecorder(fileName='parclm-',iterPeriod=10000,recorders=['spheres'])
]
O.stopAtIter=200020
#O.run(100000,True)
overlaps = [i.geom.penetrationDepth for i in O.interactions]
with open ("overlaps.dat","w") as f:f.writelines(str(o)+"\n" for o in overlaps)

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