Question #295301 on Yade changed: https://answers.launchpad.net/yade/+question/295301
Jan Stránský proposed the following answer: Hi Jabrane, thanks for the script. However, I was mainly interested in how you compute the elastic energy and the work :-) Jan 2016-06-16 9:28 GMT+02:00 Yor1 <[email protected]>: > Question #295301 on Yade changed: > https://answers.launchpad.net/yade/+question/295301 > > Yor1 posted a new comment: > Hi Jan, > > This is the script which i use: > > from yade import ymport, utils , plot > import math > > PACKING='X1Y2Z1_2k' > OUT=PACKING+'_tensionTest_r0002_energy' > > DAMP=0.4 s > saveData=100 > iterMax=40000 > saveVTK=1000 > > strainRate=0.002 > > intR=1.5028 > DENS=4000 > YOUNG=65e9 > FRICT=10 > ALPHA=0.4 > TENS=8e6 > COH=160e6 > > def sphereMat(): return JCFpmMat(type=1,density=DENS,young=YOUNG,poisson > = ALPHA,frictionAngle=radians(FRICT),tensileStrength=TENS,cohesion=COH) > > > O.bodies.append(ymport.text(PACKING+'.spheres',scale=1.,shift=Vector3(0,0,0),material=sphereMat)) > > dim=utils.aabbExtrema() > xinf=dim[0][0] > xsup=dim[1][0] > X=xsup-xinf > yinf=dim[0][1] > ysup=dim[1][1] > Y=ysup-yinf > zinf=dim[0][2] > zsup=dim[1][2] > Z=zsup-zinf > > bb=utils.uniaxialTestFeatures() > > negIds,posIds,axis,crossSectionArea=bb['negIds'],bb['posIds'],bb['axis'],bb['area'] > > O.engines=[ > ForceResetter(), > > InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb')]), > InteractionLoop( > > [Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom'),Ig2_Box_Sphere_ScGeom()], > > [Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')], > > [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(label='interactionLaw')] > ), > > UniaxialStrainer(strainRate=strainRate,axis=axis,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=1,blockRotations=1,setSpeeds=0,stopStrain=0.1,label='strainer'), > > GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.4, > defaultDt=0.1*utils.PWaveTimeStep()), > NewtonIntegrator(damping=DAMP,label='newton'), > > PyRunner(iterPeriod=int(saveData),initRun=True,command='recorder()',label='data'), > > #VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName=OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk') > ] > > O.step(); > > SSgeom.interactionDetectionFactor=-1. > Saabb.aabbEnlargeFactor=-1. > > layerSize=0.2 > for o in O.bodies: > if isinstance(o.shape,Sphere): > if ( > o.state.pos[axis]<(dim[0][axis]+layerSize*(dim[1][axis]-dim[0][axis])) ) or > ( o.state.pos[axis]>(dim[1][axis]-layerSize*(dim[1][axis]-dim[0][axis])) ) : > o.shape.color=(1,1,1) > > O.run(iterMax) > > -- > 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 > -- 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

