## 4 Adaptive Mesh Refinement Algorithm  
The adaptive \(h\)-refinement implemented in this work uses _a posteriori_ refinement indicators to determine which cells of the triangulation must be refined (see, for example, [15] and [16]).4 For the damage model presented in this paper, we are primarily concerned with isolating the damage evolution to a small area of the domain, and adequately resolving the morphology of the damage solution. Therefore, the proposed scheme should be viewed as a tool for increasing the resolution of the damage field locally, while maintaining reasonable problems sizes. While it is hoped that this approach may be beneficial to producing repeatable results when the solutions are mesh dependent, it is not a cure or fix for such a condition. Rather, this is a first attempt by the authors at incorporating adaptive refinement into dynamic damage models.  
Footnote 4: Note that there is a distinction between error estimators and refinement indicators. The former measure the error present in the approximate solution for a given cell in the triangulation, while the latter simply determines whether or not the cell should be refined. While these two concepts are often used together, in this paper, we are simply interested in refining the mesh where damage is evolving without any direct attempt to estimate the error.  
We construct two refinement indicators, which subsequently require two separate algorithms. The first indicator is based exclusively on the damage variable  
\[r_{K}^{\phi}=\begin{cases}0&\text{if }h_{K}<h_{\text{min}},\\ \left(\phi_{h}^{n+1}-\phi_{h}^{n}\right)/\Delta t&\text{otherwise},\end{cases} \tag{38}\]  
while the second is based on the excess energy release rate \(G-G_{cr}\)  
\[r_{K}^{G}=\begin{cases}0&\text{if }h_{K}<h_{\text{min}},\\ \int_{K}\left\langle G-cG_{cr}\right\rangle dK&\text{otherwise},\end{cases} \tag{39}\]  
where \(c\) is a constant, \(h_{K}\) is the diameter of the \(K\)-th cell and \(h_{\text{min}}\) is the minimum cell diameter allowed in the simulation. The use of a minimum mesh size is a simple and well-known method for addressing localization. Here we propose that it should be related to the particular microstructure of the body in question; however, we provide no relationship between \(h_{\text{min}}\) and any specific physics, as the point of this paper is not the physical model itself but rather numerical techniques. The constant \(c\) in (39) allows us to adjust the excess energy release rate. In particular, \(c<1\) will cause \(r_{K}^{G}\) to be non-zero before damage growth occurs, and in effect preemptively refine the mesh. The complete mesh refinement algorithms are given in Figures 1 and 2, for the damage based scheme and the energy release rate scheme, respectively. The minimum cell length defines the scale at which damage evolution will occur. Accordingly, each of the algorithms iterates through refinement cycles, within a given timestep, until each cell which has a non-zero refinement indicator has a diameter less than \(h_{\text{min}}\). No mesh coarsening is implemented, as we do not want to have damage evolving at a mesh size greater than the minimum one.  
Throughout the refinement process, the triangulation is changed, resulting in the need to resize the associated matrices and vectors, as well as transfer the solution from the previous triangulation to the new one. This require time and changing memory requirements, and are detrimental to the performance of the code. However, even with these performance issues, the resulting algorithm is still much faster than using a fine scale mesh from the onset of the simulation.  
Figure 1: Damage based refinement algorithm flow chart.  
Figure 2: Energy Release Rate based algorithm flow chart.