check breakOccurred in JCF contact law

Asked by Luis Barbosa on 2019-01-14

Hi all,

I am using the code [1] to check if a particle lose its cohesive contact and consequently belongs or not to a relative aggregate.
But I am not quite sure if i.phys.breakOccurred is really checking if the cohesive break occurred.

My question is:
Inside O.engines should I activate the flag used to trigger retriangulation as soon as a cohesive bond breaks or not?
Example (yes):
O.engines=[
  ForceResetter(),
...
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, Key="Wei", recordCracks=True, breakOccurred(=0))]
 ),
]
Example (no):

O.engines=[
  ForceResetter(),
...
  [Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=False, Key="Wei", recordCracks=True)]
 ),
]

Thank you,
Luis

[1]

def addBodyToAggreg(body,aggreg): # auxiliary function, add body [yade.Body instance] and all its neighbors into aggreg (python set instance)
   if body.id in aggreg: # do nothing if b is already in aggreg ...
      return
   aggreg.add(body.id) # ... otherwise add it to aggreg
   intrs = body.intrs()
   for i in intrs: # and add also all its neighbors ...
      if not isinstance(i.phys,JCFpmPhys): # ... but only that connected with JCFpmPhys interactions
         continue
      if i.phys.breakOccurred: # ... but only not yet broken
         continue
      i2 = i.id1 if i.id2==body.id else i.id2 # choose the other body of interaction
      b2 = O.bodies[i2]
      addBodyToAggreg(b2,aggreg) # and add it and all its neighbors to aggreg

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luis Barbosa
Solved:
2019-01-14
Last query:
2019-01-14
Last reply:
Luis Barbosa (luis-pires-b) said : #1

Hi folks,

I just realized how to solve it.
I used now i.phys.isBroken.