MicroFract Code: A graph theoretic approach for microstructural fracture prediction

2D and 3D versions of the MATLAB based MicroFract code and the examples in the paper (Ref. 1) are available here for download and provides a valuable image-based tool for identifying weak links in a microstructure. The only input to the code is an image of the cohesive energy distribution and the user should graphically input the macroscopic crack line in 2D or plane in 3D.
To run the code: Download the Multi-label optimization/graph-cut library (gco-v3.0),, and add it to your MATLAB path (File->Set Path->add with subfolders).
Microfract 2D: The 2D codes and examples are in this zipped file zip files. Run MicroFract.m, the code opens a image window with the cohesive energy map. Click the initial and final points of the macroscopic crack. The code will output the crack trajectory at the microscale.
The cohesive energy map can be changed in the MicroFract.m code in the line 22, IMG = imread('polycrystal.bmp'); by default the image is read from "polycrystal.bmp" in the current folder.


Microfract 3D: The 3D version of MicroFract can be downloaded here zip files. The 3D version opens an image window with the 3D cohesive energy map. Click three pixels representing the crack plane. The code will output the crack trajectory at the microscale. A user defined cohesive energy image can be used in the MicroFract3D.m code; by default a 64^3 RGB color image is read from the *.vol files in the current folder. For this: comment lines 20-27 and uncomment lines 32-34 in microfract3d.m. The microstructure should be defined in a 3d integer matrix (of size n^3) and should be saved as "bondfull" (see 3dimage.mat for an example). enter the 'maxlevels' variable that defines the number of cohesive energy levels in the 'bondfull' matrix. For a binary image (0/1), the maxlevels variable is equal to 2. User can specify the size reduction for the microstructure in variable 'mag' (from n^3 to (n*mag)^3. The code is faster if 'mag' variable is lower, but the crack fidelity is also lower.


  1. Sundararaghavan, V. and Srivastava, S., 2017. MicroFract: An image based code for microstructural crack path prediction. SoftwareX, 6, pp.94-97.[PDF]
  2. The author would like to acknowledge the Air Force Office of Scientific Research (MURI program) contract FA9550-12-1-0458, for financial support.

Quick links