You can find here an interactive notebook with a tutorial on the implementation of gradient damage models and their use to simulate brittle fracture:

Azure Notebooks

You can play with it interactively (the basic account on azure is free).