## 2 Implementation of the Algorithms of Fatigue and J-Integral in FEM
### Calculation and Evaluation of the Peridynamic J-Integral  
The peridynamic J-integral calculation can be broken into subsequent procedures where mesh and contour integration dependent data are obtained, the first and second terms of the J-integral are calculated, and finally the J-integral is calculated seen as the flow chart shown in Figure 3. User-defined subroutines such as URDFIL and USDFLD do not have access to nodal position data or element connectivity data and thus it is necessary to read this data into arrays managed by the user. The most efficient method is to read portions of the solver file (the FE data file containing the mesh and boundary conditions) and store the data into an array containing node data and an array containing element data. Figure 3: Algorithm for Calculation of Peridynamic J-Integral within FEM Software. To complete the configuration portion of the J-integral algorithm, coordinates of the corners of a rectangular integration path are specified. Due to the path independence of the J-integral an arbitrary size and shape can be selected with some exceptions to the proximity to boundaries and the crack tip as outlined by [PERSON] et al. (2020). For simplicity of calculation a rectangular contour is chosen as shown in Figure 4. The contour path lies halfway between collocation points of the uniform mesh. The first term of the J-integral is the evaluation of the flux of strain energy across the integration boundary. To define this value, it is necessary to establish the nodes along the integration contour. Nodes encompassing the integration path are found from a search algorithm which utilizes the user-input coordinates from the corners of the integration path and the nodal array data. Strain energy density at the collocation points is found via a relation to strain energy in each of the connected truss elements. The relation for strain energy density in the truss elements is developed by first replacing the micromodulus with its representation in terms of FE parameters from Equation (4) for the determination of micropotential. The micropotential function is then described in the form given by Equation (12). \[\omega=\frac{1}{2}\bigg{(}\frac{AE}{V_{x}V_{q}}S^{2}|\xi|\bigg{)} \tag{12}\]  
Noting that \(|\xi|=L\) and \(S=\epsilon\), where \(L\) and \(\epsilon\) are truss initial length and truss strain, respectively, Equation (12) can be rewritten as Equation (13). \[\omega=\frac{1}{2}\bigg{(}\frac{AE}{V_{x}V_{q}}\epsilon^{2}L\bigg{)} \tag{13}\]  
Recall that for a single tension/compression member, such as a truss subject to applied load, the strain energy is given as Equation (14). \[U_{FE}=\frac{1}{2}AEL\epsilon^{2} \tag{14}\]  
Figure 4: Rectangular Integration Path used in Evaluation of Peridynamic J-Integral. To provide the total strain energy density at a collocation point the integral representation of strain energy density is written in discretized form as  
\[W(x)\approx\frac{1}{2}\sum_{q=1}^{\text{family of x}}\omega V_{q}=\frac{1}{2}\sum_{q =1}^{\text{family of x}}(\frac{U_{FE}}{V_{x}V_{q}})V_{q}=\frac{1}{2}\sum_{q=1}^{ \text{family of x}}\frac{U_{FE}}{V_{x}} \tag{15}\]  
where micropotential described by Equation (12) has been simplified by noting the relation of truss element strain energy density described by Equation (14). The parameter \(U_{FE}\) is determined from the strain energy density of the truss, available as output data from the FEM solution and its volume. Strain energy results are averaged from collocation points on either side of the integration path to obtain the strain energy density on the path. With strain energy density known at discrete locations on the contour, the first term of the peridynamic J-integral is calculated by the product of strain energy density, the outward normal of the integration path, and the grid spacing. The second term of the J-integral involves integration over a region rather than along a contour in the classical sense, due to the nonlocal attribute of peridynamics.