yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #27768
Re: [Question #701755]: about visualizing jcfpm cracks .vtu files
Question #701755 on Yade changed:
https://answers.launchpad.net/yade/+question/701755
Ziyu Wang gave more information on the question:
Hi,Robert.
Here is the complete code that can be run:
------------------------------------------------
from yade import pack, ymport, plot, utils, export, timing
import sys
rate=-0.1
saveVTK=2000
intR=1.5
density=2640
young=3000e9
friction=10
poisson=0.4
tens=160e6
cohes=1600e6
mn,mx=Vector3(0,0,0),Vector3(0.05,0.05,0.05)
OUT='compressionTest_JCFPM_uniaxial'
name='JCFPM_uniaxial'
O.materials.append(JCFpmMat(type=1,density=density,young=young,poisson=poisson,frictionAngle=radians(friction),tensileStrength=tens,cohesion=cohes,label='spheres'))
mn,mx=Vector3(0,0,0),Vector3(0.05,0.05,0.05)
sp=pack.SpherePack()
pred=pack.inAlignedBox(mn,mx)
sp=pack.randomDensePack(pred,radius=0.001,rRelFuzz=0,returnSpherePack=True,memoizeDb='/tmp/triax.sqlite')
spheres=sp.toSimulation(color=(0.6,0.5,0.15))
bb=utils.uniaxialTestFeatures(axis=2)
negIds,posIds,crossSectionArea=bb['negIds'],bb['posIds'],bb['area']
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=intR,label='Saabb')]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom(interactionDetectionFactor=intR,label='SSgeom')],
[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys(cohesiveTresholdIteration=1,label='interactionPhys')],
[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(recordCracks=True,Key=OUT,label='interactionLaw')]
),
UniaxialStrainer(strainRate=rate,axis=2,asymmetry=0,posIds=posIds,negIds=negIds,crossSectionArea=crossSectionArea,blockDisplacements=1,blockRotations=1,setSpeeds=0,stopStrain=0.015,dead=1,label='strainer'),
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=10,timestepSafetyCoefficient=0.8, defaultDt=utils.PWaveTimeStep()),
NewtonIntegrator(damping=0.4,label='newton'),
PyRunner(iterPeriod=int(100),initRun=True,command='recorder()',label='data'),
VTKRecorder(iterPeriod=int(saveVTK),initRun=True,fileName='JCFPM/'+OUT+'-',recorders=['spheres','jcfpm','cracks'],Key=OUT,label='vtk')
]
def recorder():
yade.plot.addData({'i':O.iter,
'eps':-strainer.strain,
'sigma':-strainer.avgStress,
'tc':interactionLaw.nbTensCracks,
'sc':interactionLaw.nbShearCracks,
'te':interactionLaw.totalTensCracksE,
'se':interactionLaw.totalShearCracksE,
'unbF':utils.unbalancedForce()})
plot.saveDataTxt(OUT)
plot.plots={'eps':('sigma',None,'tc','sc')}
plot.plot()
O.step()
SSgeom.interactionDetectionFactor=-1.
Saabb.aabbEnlargeFactor=-1.
cohesiveCount = 0
for i in O.interactions:
if hasattr(i.phys, 'isCohesive'):
if i.phys.isCohesive == True:
cohesiveCount+=1
print('the origin total number of cohesive bond is:',cohesiveCount)
strainer.dead=0
O.run()
---------------------------------------
Best wishes~
--
You received this question notification because your team yade-users is
an answer contact for Yade.