Skip to content

ahcomat/PhaseFieldFracture

Repository files navigation

FEM Modeling of Phase-Field Fracture in Python

This repository contains the materials used during my research visit to CNRS-LSPM laboratory at Université Sorbonne Paris Nord, kindly hosted by Yann Charles.

The materials include three presentations:

  • FullyKineticHydrogen.pdf – the development of the fully kinetic hydrogen transport models in metals.
  • GeometricPFF.pdf – a light introduction to the geometric phase-field fracture method.
  • PHIMATS.pdf – an overview of the finite element software PHIMATS.

Additionally, two Jupyter notebooks implementing $J_2$ plasticity and the geometric phase-field fracture method of Miehe et al.:

  • Homogenous.ipynb – is basically a scalar implementation of coupling $J_2$ plasticity with homogenous phase-field fracture.
  • PFF_Plastic.ipynb – a full FEM implementation of a double notched sample with assisting functions in utils_Quad4.py.

These notebooks provide students and researchers with a step-by-step implementation in python of

  • Basic nonlinear finite element method.
  • Rate-independent plasticity with isotropic hardening.
  • A Modular phase-field fracture formulation.

My aim of sharing this repository is to provide an educational tool for understanding the underlying algorithms and/or assist with testing new constitutive relations before moving to a more programming-intensive platforms such as PHIMATS.


Features

The Jupyter notebook PFF_Plastic.ipynb provides scripts to:

  • Read and preprocess meshes generated by Gmsh via meshio.
  • Basic FEM formulation for Quad4 elements (8 DOFs for mechanics and 4 for PFF).
  • Implement a step-by-step return-mapping algorithm for $J_2$ plasticity (plane-strain), and assemble the global stiffness matrix.
  • Nonlinear global Newton-Raphson solver.
  • Geometric phase-field fracture with:
    • Spectral decomposition of elastic strain tensor, ensuring that only tensile energy contributes to crack driving forces.
    • Support for brittle, elastoplastic, and elastoplastic with threshold damage models.
    • Suppression of crack growth under compression via the function ConstrainElPhi with the algorithm proposed by Ambati et al.
  • Store simulation outputs in HDF5 format.
  • Support visualization through XDMF files compatible with ParaView (v5.9.1)

Documentation

The FEM theory behind these implementations can be found in the cited references in the functions' documentations and also summarized in PHIMATS theory manual: Finite Element Theory of PHIMATS


Download and installation

  • Download the repository via
git clone https://github.com/ahcomat/PhaseFieldFracture.git
  • All required Python libraries are included in the phimats Conda environment. To create the environment, run:
conda env create -f environment.yml

💡 Note: If you already have PHIMATS installed, you can use the existing phimats Conda environment directly.

  • ParaView v5.9.1 for visualization.

Citation

If you use this code, please cite it via:
DOI

A. Hussein, Finite Element Theory for PHIMATS, arXiv preprint, 2025. DOI: 10.48550/arXiv.2502.16283


License

This code is released under the GNU General Public License v3.0, or later.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published