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

Hi YADE community,

I have a problem as the question's title said. 

The procedure that  I have done:

1.  Packing generation
2.  Save the result by using O.save()
3.  Reload the saved yade.gz file by using O.load()
4. Working around with the material and interaction and got the crash

Mini working scripts:
--- [Step 1] ---


### INPUT for Material  ###
young0= 30e9 
poisson0= 0.2
density0 = 2530
compFricDegree=15

### PARAMETERs of particle packing  ###
mn=Vector3(0.,0.,0.)
mx=Vector3(.4e-2,.6e-2,.4e-2) 
rMean0=4e-4 
rRelFuzz0=5./100 
porosity0=0.4
distributeMass0=True
seed0=1

### INPUT for mechanical loading ###
maxVel0=5e-7
confiningS= -2.725e5 

### defining MATERIALs ###
O.materials.append(FrictMat(young=young0,poisson=poisson0,frictionAngle=radians(compFricDegree),
 density=density0, label='spheres'))
O.materials.append(FrictMat(young=young0,poisson=poisson0,frictionAngle=0,density=0,label='frictionlessWalls'))

### creating the boundary walls ###
walls=aabbWalls((mn,mx),thickness=0,material='frictionlessWalls')
wallIds=O.bodies.append(walls)

### generating spheres ###
sp=pack.SpherePack()
sp.makeCloud(minCorner=mn,maxCorner=mx,rMean=rMean0,rRelFuzz=rRelFuzz0,porosity=porosity0,distributeMass=distributeMass0,seed=seed0)
 # POLY
O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in 
sp])

### mechanical loading #### To confer a solid-like nature to the packing

triax=TriaxialStressController(
        internalCompaction=True,
        goal1=confiningS,
        goal2=confiningS,
        goal3=confiningS,
        max_vel=maxVel0, 
        label="triax"
)

triax.maxMultiplier=1.+5e-6
triax.finalMaxMultiplier=1.+1e-7 

newton=NewtonIntegrator(damping=.4, gravity=(0.0,-9.81,0.0))
                
O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(label='aabb'),Bo1_Box_Aabb()]),
        InteractionLoop(
                
[Ig2_Sphere_Sphere_ScGeom6D(label='Ig2ssGeom'),Ig2_Box_Sphere_ScGeom()],
                
[Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True,
 label="cohesiveIp")],
                
[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
                        useIncrementalForm=True, always_use_moment_law=False,  
label='cohesiveLaw')]
        ),
        
GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.5),
        triax,
        newton
]               

### --- 1st stage, particle growing while boundary walls are fixed -- ###

NumDEMRun1=100000
while 1:

        O.run(NumDEMRun1,True) 
        unb=unbalancedForce() 
                
        if unb<0.01 and 
abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.001:
                break
                
### --- 2nd stage, particle sizes are fixed while boundary walls move very 
slowly -- ###

finalFricDegree = 30 # contact friction during the deviatoric loading
triax.internalCompaction=False
setContactFriction(radians(finalFricDegree))

NumDEMRun2=50000

while 1:
        
        O.run(NumDEMRun2 ,True) 
        unb=unbalancedForce()

        if unb<0.001 and 
abs(triax.goal1-triax.meanStress)/abs(triax.goal1)<0.001:
                break  
                
*********************************************************************************
--- [Step 4] ---

compFricDegree = 1 # Scholtes
young0= 30e9 
poisson0= 0.2
density0 = 2530
tensileStrength = 40e5  
shearStrength = 40e6 

### setup the material properties, first, Cohesion material 
O.materials.append(CohFrictMat(young=young0,poisson=poisson0,density=density0,frictionAngle=radians(compFricDegree),
 normalCohesion=tensileStrength, shearCohesion=shearStrength, 
momentRotationLaw=True,label='CohFrictspheres')) 

### --- change material of the spheres to create cohesive bond between 
particles  --- ###

pairs = [(i.id1,i.id2) for i in O.interactions]
for b in O.bodies: 
        if not isinstance(b.shape,Box): 
                b.mat = O.materials[2]          
                ### [0] is Friction spheres, [1] is frictionlessWalls, [2] is 
the newly added CohFrict sphere

O.interactions.clear()
for id1,id2 in pairs: utils.createInteraction(id1,id2)  ### The crash occurs 
here

*********************************************************************************

Any help or suggestion is highly appreciate!
Son Pham





-- 
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     : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to