Crack Volume and Crack Surface (For a joint plane & the whole sample)

Asked by Yousef Golabchi on 2020-04-17

Hello everyone,

I am doing a simulation with Yade. I have a sample with a main joint plane and I am injecting water in the joint plane.

I am supposed to monitor the crack volume (p33) and the crack surface (p32) of the whole sample and the joint specifically.

The code that I use is as follows:


#if npatches == 1:
def recorder():
 global ex0,ey0,ez0
 for i in O.interactions:
  if i.phys.breakOccurred:
  if i.phys.isOnJoint:
  if i.phys.isOnJoint:


I know form [1] that for a specific flow rate the crack opens however when I plot the Joint's Crack Surface and Volume, it shows that the joint crack surface and volume are always 0.

Could you please let me know what I do wrong in the code?

Thank you in advanced for your help.

Best regards,

P.S. [1]=

Question information

English Edit question
Yade Edit question
No assignee Edit question
Solved by:
Luc Scholtès
Last query:
Last reply:
Robert Caulk (rcaulk) said : #1

Because breakOccurred is always false unless a break has occurred in the most recent triangulation step [1]. Is the documentation unclear? Probably you seek isBroken [2].


Best Luc Scholtès (luc) said : #2

It should work... Isn't it just a problem of indentation?


Apart from printing up some variables during the simulation to see if your loops and tests are effective, I don't know what to say.


1) careful as you have the same test defined twice which would make your calculation wrong:

  if i.phys.isOnJoint:

2) I would use isBroken instead of breakOccurred as I think that breakOcurred is a global variable (unless you are using a custom version of the code).

Dear Luc and Robert,

Thanks for your replies. The indentation on the python file is correct. It was not copied here exactly as the python file. Same goes for the repetition. I was deleting the necessarily part to reduce the code here, so I inadvertently copied the "if i.phys.isOnJoint:" here twice.

I will change the breakOccurred to isBroken which is for crack volume and crack surface of the whole sample. However, my inquiry was more about the joint's crack volume and joint's crack surface which are 0.

Best regards,

Luc Scholtès (luc) said : #4

Did you define neverErase=True in the Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()?

Hi Luc,

Yes neverErase is True in the Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM().





Robert Caulk (rcaulk) said : #6

Please post an MWE so we can stop guessing [1].


Hi Robert,

You are right. I should have sent an MWE. However, please note that the problem of sending MWE is that it is not just a code. It is required to define a joint so the script uses another python code and also .stl file. Without them the script does not work, even if I I send it entirely let alone MWE.

Anyhow, I will provide the parts that might cause the problem soon.


I'm writing to sum up the question and mark it as solved. As Luc and Robert pointed out, the code 'isBroken' has to be replaced by 'breakOccurred' for the crack volume and the crack surface of the sample (rock medium). For the crack volume and crack surface of the joint plane, the code was correct as Luc said but I had to increase the time steps to be able to get results.


Thanks Luc Scholtès, that solved my question.

Robert Caulk (rcaulk) said : #10

Correction 'breakOccurred' needs to be replaced with 'isBroken'.