This Julia code for phase field fatigue, written in the Ferrite.jl framework, is dividedin two files: 
Driver.jl and Subroutines.jl

For most users it is sufficient to only interact with Driver.jl, which defines and runs the problem. 

The user will need to have the appropriate Julia packages installed, namely Ferrite, SparseArrays, Tensors, Printf and LinearAlgebra.
To install a package write in a Julia terminal e.g. 

	]add Ferrite

The current verssion of Driver.jl contains a small test problem that should run in a few minutes without issue when the proper packages are installed. 

To use meshes generated by other softwares, additional packages may be required. See https://ferrite-fem.github.io/Ferrite.jl/stable/manual/grid/ for more information on supported formats and package requirements. 

Note that currently only displacement-controlled loading is supported. The extension to force controlled loading is simple, but not implemented here - sorry. If needed, consult the Ferrite documentation for a great introduction to implementing this yourself. 
Output: 
The code produces two types of output:
HistoryOutput.txt contains the following information in each line: 
Timestep, Crack extent*, Total number of Matrix factorizations on the displacement subproblem, Matrix factorizations on damage subproblem, total iterations on displacement subproblem, iterations on damage subproblem, total outer iterations, Applied Displacement, Total force in x-direction**, total force in y-direction**

*Measured as the point with \phi=0.95 furthest from a_0 in the direction CrackDir, both defined in the Driver file. 
**total force for the nodeset defined as outputset in the driver file. 

Point data in .vtu files for plotting in paraview. Currently only outputs displacement and damage values. 
The .vtu files are gatheres in a timeseries file named TimeSeries.pvd 

Please note that while the code is capable of performing monotonic loading analyses, the solution scheme is not very efficient for this purpose. 

If using this code for research or industrial applications please cite: 

P.K. Kristensen, A. Golahmar, E. Martínez-Pañeda, C.F. Niordson. Accelerated high-cycle phase field fatigue predictions. European Journal of Mechanics A/Solids 100, 104991 (2023)