← Back to team overview

yade-users team mailing list archive

Re: [Question #701755]: about visualizing jcfpm cracks .vtu files

 

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

    Status: Needs information => Open

Ziyu Wang gave more information on the question:
Hi,Robert

Following is my MWE.
------------------------------------------------
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'))
O.bodies.append(ymport.text('packing-'+name+'.spheres',scale=1,shift=Vector3(0,0,0),material='spheres'))
#(The model is a cube containing about 5000 particles generated by the RandomDensePack method)

totalSpheres=len(O.bodies)
print('The number of sphere is:',totalSpheres)

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()
--------------------------------------------------------

Thanks!

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