Skip to content

cohesionBroken for CohFrictPhys

Hi,

I am trying to add cohesion to a YADE simulation after loading a saved state. My setup uses CohFrictMat with Ip2_CohFrictMat_CohFrictMat_CohFrictPhys and Law2_ScGeom6D_CohFrictPhys_CohesionMoment.

I saved the simulation, then loaded it using O.load(). The simulation runs fine. Now I want to activate cohesion on the already existing contacts. I tried:

savedStateFilename = "unsat.yade.gz"
O.load("unsat.yade.gz")
O.interactions.clear()

for i in O.interactions.all():
    physFunctor.setCohesion(i, cohesive=True, resetDisp=True)

However, when I check the contacts:

for i in O.interactions:
    if isinstance(i.phys, CohFrictPhys):
        print("Cohesion broken:", i.phys.cohesionBroken)

it immediately shows True, even though I just set cohesion.

My questions are:

  1. Why does cohesionBroken show True right after enabling cohesion on existing contacts?

  2. How can I correctly add cohesion to already existing soil-soil contacts so that it reflects the true state of the contact?

The code and saved file are atttached here: 1normalpile.py unsat.yade.gz