PRISMS-Fatigue computational framework for fatigue analysis in polycrystalline metals and alloys

The PRISMS-Fatigue open-source framework for simulation-based analysis of microstructural influences on fatigue resistance for polycrystalline metals and alloys is presented here. The framework uses the crystal plasticity finite element method as its microstructure analysis tool and provides a highly efficient, scalable, flexible, and easy-to-use ICME community platform. The PRISMS-Fatigue framework is linked to different open-source software to instantiate microstructures, compute the material response, and assess fatigue indicator parameters. The performance of PRISMS-Fatigue is benchmarked against a similar framework implemented using ABAQUS. Results indicate that the multilevel parallelism scheme of PRISMS-Fatigue is more efficient and scalable than ABAQUS for large-scale fatigue simulations. The performance and flexibility of this framework is demonstrated with various examples that assess the driving force for fatigue crack formation of microstructures with different crystallographic textures, grain morphologies, and grain numbers, and under different multiaxial strain states, strain magnitudes, and boundary conditions.


INTRODUCTION
Fatigue is a complex process that involves cyclic inelastic deformation and formation and growth of cracks. During high cycle fatigue (HCF) experiments conducted on polycrystalline metals and alloys, the early stages of fatigue crack formation and microstructurally small crack growth are governed by the microstructure 1,2 . Due to the complex nature of these early stages of fatigue crack formation and growth and their close connection with the material microstructure, it is perhaps more challenging to study directly than fatigue crack growth of macroscopic cracks much larger than the scale of microstructure. The size of the microstructurally small fatigue crack at initial stages is comparable to microstructure features such as grain/phase size. Consequently, all these features including the deformation mechanisms inside the grains and interaction of grain boundaries with the small fatigue cracks become important. Fatigue life in polycrystalline metals and alloys can be divided into fatigue crack formation and propagation phases; the former dominates the sample lifetime in HCF 2 . This results in large lifetime variability as compared to experiments at higher applied strains in the Low Cycle Fatigue (LCF) regime. This variability is closely linked to microstructure and any initial defects that may contribute to crack formation. Dunne 3 reviewed several computational tools to study the mechanisms of microstructure deformation spanning various length scales, such as atomistic simulations, discrete dislocation plasticity, crystal plasticity, and homogenized plasticity. Only a few studies have addressed fatigue failure mechanisms using atomistic simulation 4 and discrete dislocation plasticity 5 because these methods suffer from substantial length and time scale constraints. Consequently, fatigue crack formation and early growth has typically been investigated using crystal plasticity and homogenized continuum plasticity simulations [1][2][3]6,7 . A parametrically homogenized constitutive model (PHCM) crystal plasticity framework with uncertainty quantification 8 and two-way multiscale coupling was developed by Ozturk, Kotha, and colleagues 9 . This framework has been extensively used to investigate fatigue crack nucleation in titanium alloys 9 . Very recently, Xu et al. 10 presented a microstructural fracture mechanics model using computational crystal plasticity validated with experimental tests and characterization. They showed a relation between the crack tip stored energy density and stress intensity in Zircaloy-4 alloy beam samples. In another work, Xu et al. 11 investigated the dwell fatigue behavior of titanium alloy IMI834 using a temperature-coupled discrete dislocation plasticity (DDP) model. Zheng et al. 12 also employed a DDP model to study the elastically stored energy associated with the interactions of dislocations and their structures, and how this dislocation configuration energy affects fatigue crack nucleation and growth. To better assess the performance of crystal plasticity model and backstress formulations, high energy X-ray diffraction microscopy (HEDM) experiments and simulations were used to track the stress-state of individual grains within a polycrystalline Ni-base superalloy subjected to cyclic loading 13 . HEDM has recently become more ubiquitous in microstructure-sensitive fatigue investigations because it allows for a direct comparison between the micromechanical simulated vs. experimental stress-strain response of individual grains 14,15 .
An important element that facilitates comparison of various microstructures in modeling fatigue crack formation is the concept of a Fatigue Indicator Parameter (FIP) [16][17][18][19] . FIPs were introduced to serve as computable surrogate measures of the fatigue crack formation driving force at the scale of individual grains/phases or subgrains 1 . FIPs can capture the effects of intrinsic and extrinsic microstructure properties (e.g., grain size 20 , phase volume fraction 20 , surface roughness 21 , porosity 22 , presence of inclusions 23 , etc.) and loading conditions (e.g., applied strain state and magnitude 17,24 ) on the probability of failure. Various FIP formulations exist using different internal state variables as descriptors 17,25 (e.g., stored energy density 26 , plastic shear strain range with an additional influence of the stress normal to the slip plane 20 , etc.). A proper calibration can relate FIPs to experimental fatigue life 27 . Different nomenclatures may have been used for a similar method in the literature, but the concept remains the same. After capturing the driving force for fatigue crack formation within a grain, its growth to a length of several grains is still strongly affected by the microstructure. Accordingly, the microstructure still plays a key role in this phase, well within the socalled regime of fatigue crack formation.
Numerous fatigue studies and corresponding modeling frameworks have been developed as stand-alone codes or subroutines used with commercial software. Thus far, there has been little emphasis within the fatigue community on open-source toolboxes for simulation and relative assessment of microstructures with regard to resistance to fatigue crack formation. The main challenges are tracking with standard testing protocols, reproducibility of the results, and model and code documentation. Clearly, reinventing common codes and methods routinely is inefficient and leads to difficulty in verification and validation. An alternative paradigm more commonly pursued in modern digital materials science is based on developing an open-source framework, which can be used and/or modified by the fatigue community. In this regard examples in related materials research communities include Density-functional theory (DFT) calculations (DFT-FE 28 ), first-principles statistical mechanics (CASM 29 ), atomistic simulation (LAMMPS 30 ), crystal plasticity finite element method (CPFEM) codes (PRISMS-Plasticity 31 ), and phase-field codes (PRISMS-PF 32 ). Developing an open-source fatigue framework for microstructurescale comparisons broadens the community of research to investigate complex fatigue-related problems, with a focus on developing other features rather than reimplementing basic elements of the framework in limited-use, homegrown codes and subroutines. Finally, the PRISMS-Fatigue framework is linked to the Materials Commons 33 to keep a record of simulations and workflows, share with collaborators, and publish data, which is key to data reproducibility in the scientific community. More importantly, it increases the rate at which materials and microstructures can be evaluated for fatigue-critical applications, with a corresponding acceleration of the pace of materials discovery and development.
The open-source PRISMS-Fatigue platform allows the material science and mechanics community to use and contribute to fatigue-related research and applications. The framework is linked to the open-source software DREAM.3D 34 , PRISMS-Plasticity 31 , Python, and ParaView to respectively generate microstructure instantiations, calculate material response, execute scripted workflows to compute volume-averaged FIPs, and to visualize data. DREAM.3D is widely used by the materials science community to generate synthetic 17,25,[35][36][37] and reconstruct experimental (e.g., EBSD with serial sectioning 38 , Laguerre tessellations using grain centroids and relative volumes from HEDM experiments 15 ) microstructures, largely for subsequent numerical simulation. PRISMS-Plasticity 31 serves as the CPFE engine for PRISMS-Fatigue. PRISMS-Plasticity 31 is an open-source parallel 3D crystal plasticity finite element (CPFE) software, that can handle both rate-dependent and rate-independent formulation along different hardening models. The PRISMS-Plasticity software is modular, flexible, and scales well with large simulations. Furthermore, the model can handle different twinning mechanisms 39,40 and multiphase simulations.
Parallel performance of the framework is critical since most microstructure-sensitive fatigue applications require detailed and expensive CPFEM simulations. The performance of PRISMS-Fatigue is tested against a similar framework implemented using the commercial software ABAQUS 41 with an identical simulation setup. The constitutive model and simulation setup are similar for both fatigue frameworks implemented in ABAQUS and PRISMS-Fatigue (see Supplementary Note 1). However, the model implementations are slightly different in ABAQUS and PRISMS-Fatigue (see Supplementary Note 5). A set of applications are then presented to demonstrate the performance and flexibility of the framework in assessing the fatigue crack formation driving force. These include different crystallographic textures (cubic, random, and rolled), grain morphologies (equiaxed and elongated), multiaxial strain states (uniaxial, shear, and biaxial), strain magnitudes, and boundary conditions (bulk vs. surface effects). As a last application, the effect of sample size, i.e., number of grains, on the fatigue crack formation driving force is investigated. The largest simulation is a~160,000 grain sample discretized with 250 3 elements, which is, to the best of the authors' knowledge, the largest microstructure-sensitive CPFEM simulation available in the literature. A detailed discussion of the methods mentioned above and their implementation in the framework, including the code structure, constitutive material model library, FIPs, extreme value statistics, integration with DREAM.3D 34 , implicit time stepping, inputs and outputs, periodic boundary conditions, parallelization, and integration of PRISMS-Fatigue with the Materials Commons are elaborated in the Methods section of this article.

RESULTS AND DISCUSSION Overview
The scaling performance of the PRISMS-Fatigue framework is investigated first for a large-scale fatigue simulation of aluminum alloy 7075-T6. Volume-averaged FIPs are fit to the Gumbel extreme value distribution (EVD), which permits comparison of fatigue resistance between different microstructures 17,37 , or fatigue life prediction with a proper calibration 27 . In the following step, a slightly smaller simulation is used as a benchmark to compare the FIP EVD response and performance scalability of an identical Al 7075-T6 microstructure instantiation simulated in both PRISMS-Fatigue and a similar framework implemented using ABAQUS. Lastly, several fatigue applications including the effects of crystallographic textures, grain morphologies, boundary conditions, multiaxial strain states, strain magnitudes, and sample size, i.e., number of grains, are presented to demonstrate the capabilities of PRISMS-Fatigue.

Parallel scaling
One of the important aspects of a parallel code is the capability to scale to a large number of degrees of freedom using multiple processors while solving problems in a reasonable amount of time. Microstructure-sensitive fatigue analysis through CPFEM simulations frequently includes problems with millions of degrees of freedom. Accordingly, the scalability of the PRISMS-Fatigue framework is key to its performance. The strong scaling of PRISMS-Fatigue is investigated here by studying the extreme value fatigue response of an Al 7075-T6 microstructure instantiation with 41,000 equiaxed grains and random initial crystallographic texture. The 160 3 voxelized microstructure was generated using DREAM.3D 34 (Fig. 1a). Each microstructure voxel is modeled with reduced integration linear hexahedral elements, resulting in an FE mesh with 4,096,000 elements; each grain is represented by multiple elements. A phenomenological viscoplastic flow rule and associated hardening rules with OW kinematic hardening [42][43][44][45] were implemented in the PRISMS-Plasticity 31 material library. Three fully reversed uniaxial straining cycles are applied to a strain amplitude of 0.7% and at a strain rate of 10 À3 s À1 to facilitate elastic-plastic shakedown. Periodic boundary conditions were incorporated to represent bulk, subsurface material response 46,47 . All simulations performed in this work were conducted on Georgia Institute of Technology's Partnership for an Advanced Computing Environment (PACE) Hive supercomputing cluster equipped with Intel Xeon 6226 CPU processors and 8 GB memory per processor. Figure 1b shows the cyclic response of the sample during three straining cycles. The variation of elemental FIPs throughout the sample is shown in Fig. 1c. Microplasticity is heterogeneously distributed throughout the microstructure and fatigue crack formation is most probable at hot spots corresponding to high FIP values. Accordingly, the Gumbel EVD of the highest 50 subband averaged FIPs is illustrated in Fig. 1d. Furthermore, the grains with the highest 50 sub-band averaged FIPs are presented in Fig.  1e. The simulation was conducted with different number of processors (between 6 and 480) and the strong-scaling results are presented in Fig. 1f, which demonstrate excellent scalability. The required wall times to reach the point of initial maximum compressive strain for the 160 3 voxelized microstructure are 250 h using 6 processors or 8.4 h using 480 processors. The details of the crystal plasticity constitutive model, volume-averaged FIP calculation, and computing environment are presented in the Methods and Supplementary Information sections.

PRISMS-Fatigue benchmarking versus ABAQUS
The performance and scalability of the PRISM-Fatigue framework is compared to a similar framework implemented in the commercial software ABAQUS using a smaller microstructure instantiation and the same material model. An Al 7075-T6 microstructure with~7500 grains, random initial crystallographic texture, and 90 3 voxels was instantiated using DREAM.3D (Fig. 2a). The same loading and boundary conditions were implemented as those of the parallel scaling investigation in the previous section.  Fig. 2d. Additionally, these highest FIPs occur in the same grains as simulated using the two frameworks. The maximum difference between EVD FIPs from ABAQUS and PRISMS-Fatigue is~5%. We emphasize that a comparison of extreme value response is arguably the strictest criteria to compare the simulation frameworks given the highly nonlinear constitutive model and different numerical implementations. Accordingly, a~5% difference in the highest FIPs demonstrates that the results of PRISMS-Fatigue agree well with ABAQUS. The average absolute difference between the FIPs obtained by ABAQUS and PRISMS-Fatigue for all grains, not just the highest 50 FIPs, is 1.1%. Additionally, the cyclic responses presented in Fig.  2b are precisely the same for ABAQUS and PRISMS-Fatigue. Although the constitutive model is similar for both fatigue frameworks implemented in ABAQUS and PRISMS-Fatigue (see Supplementary Note 1), the model implementations are slightly different in ABAQUS and PRISMS-Fatigue (see Supplementary Note 5). In the ABAQUS implementation, the slip (i.e., plastic shear strain) for each slip system is selected as the Newton-Raphson scheme variable. In the PRISMS-Plasticity implementation, however, the stress tensor and backstress for each slip system are selected as the Newton-Raphson variables. In a highly nonlinear model and large-scale simulation, a very small difference among the calculated FIPs is inevitable by these two fatigue frameworks.
The fatigue simulation was conducted using a different number of processors, which are 1-480 for PRISMS-Fatigue and 6-480 for ABAQUS. ABAQUS was not able to finish the simulation in less than 720 h using less than six processors. The strong-scaling results shown in Fig. 2f demonstrate significantly reduced simulation times using PRISMS-Fatigue. In the case of total simulation time, PRISMS-Fatigue requires much smaller wall time compared to ABAQUS for all numbers of processors. In addition to the simulation wall time, the ideal scaling of each framework is plotted in Fig. 2f. To plot the ideal scaling of ABAQUS, the simulation time of a single processor is estimated by assuming a similar scaling efficiency for PRISMS-Fatigue and ABAQUS in the case of using six processors, i.e., minimum number of processors in which ABAQUS was able to finish the simulation within 720 h. While ABAQUS demonstrates better scalability for a smaller number of processors, the trend is not consistent as 24 processors has a weaker scalability compared to 48 processors. Furthermore, ABAQUS scaling performance saturates at 240 processors, and cannot reduce the simulation time by further increasing the number of processors, which is not the case for PRISMS-Fatigue. In the case of massive fatigue simulations, the PRISMS-Fatigue framework becomes a more suitable tool compared to the similar framework implemented in ABAQUS. Figure 2f shows that PRISMS-Fatigue can simulate the sample in 1.08 h using 480 processors, while ABAQUS requires 28.5 h using the same number of processors. The details of the crystal plasticity constitutive model, volume-averaged FIP calculation, and computing environment are presented in the Methods and Supplementary Information sections.

Applications
Five different fatigue-related applications are investigated to demonstrate the flexibility of the PRISMS-Fatigue framework. The applications include the effects of different crystallographic textures, grain morphologies, boundary conditions, multiaxial strain states and strain magnitudes, and sample sizes, i.e., number of grains, on the FIP EVDs (fatigue crack formation driving force) 17,35,37 . The first four applications employ the more traditional strategy of simulating Statistical Volume Element (SVE) ensembles to build up the extreme value response. The fatigue simulations of microstructure instantiations with 90 3 and 160 3 voxels are computationally intractable for researchers without access to a very powerful supercomputing cluster and an advanced parallel code such as PRISMS-Fatigue. The alternative method is to simulate multiple smaller microstructure instantiation (i.e., SVEs), which facilitates a near equivalent study of material fatigue response with reduced computational demands.  Table 1. Figure 3 shows the results for each of these applications, which employ the same Al 7075-T6 crystal plasticity constitutive model as mentioned in the scaling study simulations (see Methods and Supplementary Information sections for precise details of this CPFEM model).
Initial crystallographic texture plays a potentially important role in the micromechanical response of polycrystalline materials, including the microstructure-sensitive fatigue crack formation driving force 48 . Moreover, morphological texture (e.g., shape of grains) and boundary conditions also play important roles, even for high symmetry fcc metals such as Al alloys 49 . Accordingly, SVE ensembles of three different crystallographic textures are instantiated using DREAM.3D and include cubic, random, and rolled textures (See Supplementary Information section) 37 . For each of the three textures, three ensembles were instantiated, i.e., nine ensembles in total, as follows: (1) equiaxed grains with fully periodic boundary conditions, (2) elongated grains with fully periodic boundary conditions, and (3) equiaxed grains with one set of parallel faces in each SVE set as traction-free/free surfaces/ nonperiodic while the other two pairs of faces are set as periodic. The latter instantiations are analogous to a material with a high surface area to volume ratio. Each SVE was subjected to fully reversed cyclic straining to a strain amplitude of 0.7% and at a strain rate of 10 −3 s −1 . FIPs were calculated and volume averaged across the third straining cycle. Compressive straining was initiated in the X direction relative to the ODF pole figures.
The effects of crystallographic texture and grain morphology are investigated first. After FIPs are calculated, they are volume averaged over subgrain regions entitled sub-bands (see Methods section) 37 . Figure 3a shows the highest 50 sub-band averaged (SBA) FIPs from each ensemble of 30 SVEs fit to the Gumbel EVD. The cubic texture results in the lowest fatigue crack formation driving forces. Examination of the cubic ODF pole figure indicates that grains are predominantly oriented for slip on multiple slip systems (nominally 8 of the 12 slip systems). Fatigue is expected to occur in locations of substantial local cyclic plastic deformation for which the Fatemi-Socie (FS) transgranular FIP is intended to apply. It is therefore expected that the cubic texture should result in relatively lower FIP EVDs, as slip is more homogeneously distributed throughout the microstructure; this decreases the probability of a single slip system with substantial slip. Conversely, both random and rolled textures exhibit higher FIP EVDs. Grain morphology in the cubic-textured SVEs does not considerably change the FIP EVDs. However, in the random and rolled textures, grain elongation considerably decreases the FIP EVDs (Fig. 3a). It is important to note that the equiaxed and elongated grain SVEs contain the same nominal number of grains (i.e., grain volumes are similar). Thus, the lower values of these FIPs may be a consequence of plastic shear strain constraints due to the reduced mean free slip path in the elongated grains. The applications entitled Texture_Effect_Al7075T6 and GrainMorphology_Effec-t_Al7075T6 on Materials Commons contain the required information to perform these or similar simulations in PRISMS-Fatigue. The fatigue response of certain alloys is more sensitive to local micromechanical response near a free surface. Elastic/plastic anisotropy, surface condition, and applied strain play a strong role. For instance, in the lower crystal symmetry hcp titanium alloy Ti-6Al-4V, fatigue crack initiation (FCI) was observed more than 500 μm below the specimen surface in the HCF regime but In a, FIP EVDs from microstructure ensembles with elongated grain morphology reduce FIP magnitudes. In b, the combined effects of crystallographic texture and boundary conditions show an increase in FIP magnitudes in the presence of a free surface for the random and rolled textures. c The 50 highest sub-band averaged FIPs from b are plotted as a histogram of the distance to the edge of the sample, which indicates that the highest FIPs manifest close to the free surface for the random and rolled textures. However, there is no correlation between the grains with high FIPs and distance to the edge of the sample in the case of periodic boundary conditions. Iso-FIP contours in d are shown on a multiaxial gamma (Γ) plane and cover a range of multiaxial strain states (uniaxial, equibiaxial, and pure shear) and amplitudes 17,55 . In e, f, the effect of sample size is investigated. In e, different size samples show indistinguishable stress-strain responses. However, in f, the FIP EVDs strongly depend on the sample size such that FIPs from the larger microstructures progressively increase and shift to the right. occurred near the surface in LCF 50 . Comparable Ti-alloys exhibit similar behavior with FCI at the surface only under rough surface conditions 51,52 . Conversely, FCI in aluminum alloy 7010-T7451 is observed near the specimen surface under various surface conditions 53 . In the LCF regime (below 10 5 cycles), FCI occurred within 10 μm of the surface in Al 7075-T6, whereas in the HCF regime (above 10 5 cycles) all cracks initiated at the surface 54 . The simulations performed here aim to capture these differences in the fatigue crack formation driving force in Al 7075-T6 using two sets SVE ensembles for the three crystallographic textures with equiaxed grains. In the first set, boundary conditions are set to fully periodic in all three directions to imitate bulk material response. In the other set, one pair of parallel SVE faces are set to nonperiodic and traction-free to replicate free surface conditions. This second set is representative of a thin sheet of material with a high surface area to volume ratio. A comparison of the FIP EVDs for the three textures with surface vs. bulk boundary conditions is shown in Fig. 3b. The random and rolled textures show a substantial increase in FIP EVDs (these data are shifted to the right), which indicates the framework can capture the complex effects of free surface interactions on local micromechanical response, in accordance with experimental observations 54 . In addition, Fig. 3c shows the 50 highest SBA FIPs from each of the ensembles in Fig. 3b plotted as a function of the distance from the SVE boundary, which indicates that the highest FIPs occur close to the free surface for the random and rolled textures. However, there is no correlation between the FIP and the distance from the SVE boundary in the case of periodic boundary conditions. The application entitled FreeSurface_Effect_Al7075T6 on Materials Commons contains the required information to perform these or similar simulations in PRISMS-Fatigue.
The fourth application demonstrates the ability to capture the effects of multiaxial strain states and different strain amplitudes. Fatigue-critical components rarely experience simple uniaxial strain states, but simple laboratory fatigue experiments are typically performed in such a fashion. More complex strain states require complex machinery and/or specimen geometries (hollow/ tubular or cruciform specimens) 17 . The multiaxial Gamma (Γ) Plane introduced by Brown and Miller 55 considers how strain state and amplitude affect fatigue life with iso-life contours for completely reversed loading. Design engineers can use such diagrams to support multiaxial fatigue design of components. PRISMS-Fatigue is used here to generate a computational Γ Plane as outlined by Stopka and McDowell 17 ; the strategy is briefly reviewed below.
Another ensemble of 10 SVEs with equiaxed grains and initially random crystallographic texture is instantiated with DREAM.3D. SVEs contain 30 3 voxels, an average of 250 grains, and have one pair of faces set to traction-free/nonperiodic since the concept of the Γ Plane involves macroscopic plastic strain with respect to the free surface. The calculation of macroscopic plastic strain is elaborated in the Supplementary Information section. Each SVE in the ensemble undergoes 95 different combinations of strain state and amplitude to populate the Γ Plane response coordinates using the macroscopic plastic strain tensor. At each response coordinate, the average of the 10 highest SBA FIPs for the ensemble are used as the response surface. A Gaussian Process Regression (GPR) model is then used with the response coordinates and surface as an input to populate the Γ Plane (i.e., interpolate across the Plane). The computational Γ Plane is shown in Fig. 3d and closely resembles experimental trends observed by Brown and Miller 55 and matches previous work by Stopka and McDowell 17 . The upper and lower limits represent uniaxial and equiaxial strain states, respectively, and the abscissa corresponds to pure shear. The application entitled MultiaxialFatigue_Al7075T6 on Materials Commons contains the required information to perform these or similar simulations in PRISMS-Fatigue.
The fifth and final application investigates the effect of sample size, i.e., number of grains, on the fatigue crack formation driving force. This application demonstrates the remarkably large size of microstructural ensembles that PRISMS-Fatigue can generate, simulate, and postprocess to assess the microstructure-sensitive fatigue response. Four progressively larger samples of the Al alloy are generated and undergo cyclic straining to a strain amplitude of 0.7% as before. The four samples contain~250, 7500, 41,000, and 160,000 grains discretized with 29 3 , 90 3 , 160 3 , and 250 3 elements, respectively. Each sample is generated as fully periodic and contains equiaxed grains with random initial crystallographic texture. Mesh density is unchanged so the absolute size between samples is different, but the constitutive model employed does not consider size effects. To the best of the authors' knowledge, the 160,000 grain microstructure discretized by 15,625,000 elements is the largest microstructure-sensitive fatigue CPFEM simulation available in the literature. The required wall time to reach the point of initial maximum compressive strain for the 250 3 voxelized microstructure is 12 h using 1200 processors. Figure 3e shows the cyclic stress-strain response between the four samples. The results demonstrate that the macro response is identical across the four different sample sizes and show that even the microstructure with 250 grains and 29 3 elements is large enough to capture the macro response. FIPs are computed across the third and final straining cycle and are subsequently averaged over sub-bands. The highest 50 FIPs from each sample are then fit to the Gumbel EVD as shown in Fig. 3f. Whereas the macroscopic response between these samples is identical, the extreme value fatigue response is radically different. FIPs from the larger microstructures progressively increase and shift to the right in Fig. 3f. This reflects the experimentally observed volume knockdown effect in fatigue, where larger specimens of the same material exhibit lower fatigue lives due to an increased probability of a critical hot-spot for fatigue crack nucleation 56 . Similarly, the larger samples contain more grains and therefore a higher probability of grains favorably oriented for significant slip.
Comparison of FIPs from different types of microstructures to rank-order fatigue resistance requires a sufficiently large simulated volume. This is often computationally intractable and consequently, ensembles of SVEs are simulated to build up a reliable extreme value distribution 1 . In contrast, a Representative Volume Element (RVE) contains sufficient grain/phase heterogeneity to reach convergence of some material property independent of boundary conditions 57,58 . The RVE size for macroscopic elastoplastic properties (as shown in Fig. 3e) is relatively small whereas the FIP EVDs in Fig. 3f increase and suggest convergence is within reach. Thus, studies of RVE fatigue characteristics previously thought intractable can now be investigated by researchers using the superior performance of PRISMS-Fatigue to generate, simulate, and postprocess very large polycrystalline samples. The postprocessing task is particularly challenging and requires efficient Python scripted digital workflows. The Al 7075-T6 material system modeled here follows a lognormal grain size distribution with a mean and standard deviation of 14 and 2 µm, respectively. However, for other material systems with a larger mean grain size, the physical size of the microstructure approaches experimental laboratory specimen size. For example, a mean grain size of 60 µm with~160,000 grains and with the same mesh density results in a cubic specimen with a side length of 2.625 mm.

Future work
The PRISMS-Fatigue framework is flexible for including additional physics and mechanics, and to enhance performance, flexibility, and accessibility. After capturing the formation of a small fatigue crack within a grain, for example, its growth to a size over the first 5-10 grains 27 can be added to PRISMS-Fatigue. This regime is still strongly influenced by the microstructure and is important in its contribution to fatigue crack initiation lifetime in the transition from low cycle into high cycle fatigue as strain amplitude is decreased. As the fatigue crack continues to grow, eventually it can be modeled using fracture mechanics methods. Yet another aspect of the PRISMS-Fatigue framework is integration with phasefield methodology to model the macroscopic fatigue crack propagation for which the crack length and cyclic plastic zone are suitably large compared to the scale of microstructure. Accordingly, fatigue crack formation and early growth can be modeled by PRISMS-Fatigue, with subsequent propagation of macrocracks addressed using a phase-field framework. This provides a simulation platform for various stages of fatigue crack formation and growth coupled with microstructure. In this context, it is important to acknowledge that the PRISMS software includes PRISMS-PF, a high performance phase-field code 32 which is based on the same deal.ii subroutines and framework as PRISMS-Plasticity, and the two codes are well integrated 29 .
Adding other constitutive models into the material library is envisioned as a means to explore microstructure-sensitive fatigue simulation for a diverse range of materials. Currently, the code is developed in two separate parts written in programming languages Python and C++. A near-term extension is to absorb the Python part into the C++ part of the framework and present it as a single C++ package. A graphical user interface (GUI) is under development to simplify use of PRISMS-Fatigue for educational purposes. Finally, since PRISMS-Fatigue is integrated with the Materials Commons, it is anticipated that a broad community of practice will develop for application of this framework to a wide range of scientific studies on fatigue of structural materials.

Discussion
An open-source microstructure-sensitive computational fatigue framework is presented with a focus on performance and flexibility. The framework contributes to both research and educational purposes by providing the basic tools to model fatigue crack formation within nucleant grains/phases; we have demonstrated its capability to compare relative fatigue resistance of a range of microstructures distinguished by differences of crystallographic and morphological texture. This framework introduces a paradigm in which researchers can utilize the foundational tools developed to focus on different aspects of microstructure-sensitive fatigue without having to build their own tools from the ground up. The open-source software PRISMS-Plasticity serves as the CPFEM engine of PRISMS-Fatigue to capture micromechanical response of polycrystals. Benchmark simulations of surrogate fatigue driving forces, so-called Fatigue Indicator Parameters or FIPs, in a polycrystalline Al 7075-T6 sample with random crystallographic texture and equiaxed grains demonstrated that PRISMS-Fatigue is up to 26 times faster than a similar framework implemented in the ABAQUS (both using 480 processors) with minimal differences in extreme value FIP response. The simulation speed and scaling become particularly important with large-scale simulations (approximately tens of millions of DOFs), which should complete in a reasonable timeframe. PRISMS-Fatigue was developed around flexibility and modularity in a way that users can easily modify parts of the code to customize their investigation. Two important aspects are the material library in which users can define their own constitutive model, and the FIPs library in which they can introduce other fatigue criteria. Five applications demonstrated the performance and flexibility of PRISMS-Fatigue in capturing the fatigue crack formation driving force: different crystallographic textures, grain morphologies, multiaxial strain states and magnitudes using a computational multiaxial Gamma (Γ) Plane, boundary conditions, and sample sizes. Maximizing the downstream value of PRISMS-Fatigue depends on contributions from the research community analogous to other material science and mechanics platforms (e.g., PRISMS-PF 32 , DFT-FE 28 , CASM 29 , and LAMMPS 30 ). Thus, the link between PRISMS-Fatigue and Materials Commons will focus on facilitating continuous improvement in the framework as an efficient, flexible, scalable, and modular tool.

METHODS Overview
PRISMS-Fatigue serves as a foundation for establishment of a fatigue research community by providing an open-source fatigue framework, which implements advanced numerical schemes to achieve high performance, flexibility, and scalability. Since microstructure-sensitive CPFEM fatigue simulations are very demanding computationally, it is crucial that the framework can scale well with the size of problems and number of processors. The research community can use this framework at three different levels: (1) as a simple user of the predeveloped applications without any required programming skills, (2) adding applications including the modification or addition of other FIPs or constitutive models that require intermediate programming skills, and (3) contributing to the core library, which requires advanced programming skills. This article describes PRISMS-Fatigue version 1.0, which uses PRISMS-Plasticity version 1.2.0 as its CPFEM engine.

Code structure
PRISMS-Fatigue is developed in two separate parts written in the programming languages of C++ and Python. The C++ portion includes the core CPFEM simulations built upon PRISMS-Plasticity 31 and the deal.ii finite element library 59 , while the Python portion instantiates microstructures using DREAM.3D, calculates and volume-averages FIPs, and performs the statistical analysis with plot/visualization features. This combination provides efficient CPFEM computational performance with great data science flexibility for FIP analysis and postprocessing. The flowchart of the PRISMS-Fatigue framework for the simulated fatigue applications is illustrated in Fig. 4.

Constitutive material library
An essential part of PRISMS-Fatigue is the core CPFEM engine, PRISMS-Plasticity. The material constitutive models for fatigue applications should be able to model cyclic material response. For the PRISMS-Fatigue applications, both rate-independent and rate-dependent models are implemented in the library to represent the cyclic response of polycrystals. An important part of these implementations is the calculation of the algorithmic tangent modulus, which can considerably affect the simulation wall time and number of required steps to obtain the converged solution. The implemented models employ finite deformation continuum kinematics based on a multiplicative decomposition of the deformation gradient tensor 60,61 . A physically based multiscale cyclic model is developed within the PRISMS Center to include twinning-detwinning mechanisms as a part of constitutive model 39 . This is especially important for many applications and particularly for HCP polycrystals. Development and implementation of the crystal plasticity models requires tremendous experience and time. An open-source constitutive model library will thus considerably aid the research community and diminish time spent in reimplementing models. A user-defined constitutive model feature is designed to make the PRISMS-Fatigue framework as flexible as possible. Accordingly, one can integrate their constitutive model into the framework with modifications to the calculatePlasticity.cc file. The CPFEM model employed in the simulations presented here was developed initially by Hennessey et al. 45 as an ABAQUS User MATerial subroutine (UMAT). It was adapted for use in PRISMS-Plasticity.

Integration with DREAM.3D
DREAM.3D is used to instantiate synthetic microstructures. It is a powerful open-source tool that can also be used to reconstruct microstructures from experimental data sets (e.g., EBSD with serial sectioning 38 and high energy X-ray diffraction microscopy (HEDM) 15 ). In this application, a Python wrapper calls DREAM.3D to generate either single, large microstructures or ensembles of SVEs. This consists of two main DREAM.3D files: a.dream3d file with the StatsGenerator filter, which specifies the statistics of the microstructure(s) to be instantiated (grain size distribution, crystallographic textures, grain morphology, phase, etc.), and the.json pipeline that contains the filters to create the synthetic volume, pack the phase(s), iteratively swap grains to achieve the desired crystallographic or morphological statistics, and to finally write out the required input files for PRISMS-Fatigue. DREAM.3D is executed entirely from within Python, but the user can instantiate microstructures using the DREAM.3D GUI if more precisely controlled microstructures are desired. However, the Python wrapper enables the generation of SVE ensembles with proper numbering, followed by automated grain banding and sub-banding as described in the FIPs section.

Fatigue indicator parameters
Fatigue Indicator Parameters (FIPs) serve as surrogate measures of the microstructurally small fatigue crack formation and growth driving force within individual grains/phases 1,62,63 . Stopka and McDowell recently reviewed several different FIP formulations 17 . A crystallographic version 64 of the Fatemi-Socie 65 critical plane damage parameter is employed here to demonstrate the capabilities of PRISMS-Fatigue. This FIP has been shown to correlate well with the crack tip displacement range for cracks lying at the interface of a slip band in a single crystal and cracks in homogeneous single crystals 64 . User-defined FIP formulations can be readily added to make the PRISMS-Fatigue framework as flexible as possible. This is done in the calculate_FIPs.py module in which users define FIPs based on PRISMS-Plasticity CPFEM outputs.
FIPs are computed for each integration point and slip system in the CPFEM simulations 17,37 and must be subsequently volume averaged to mitigate mesh sensitivity and reflect the subgrain damage process zone within the nucleant grain/phase 25,66 . The most straightforward approach is to average FIPs over all elements in a grain, but this will smear extreme FIPs in sub-regions of a grain. This may result in a skewed comparison of FIPs between microstructures since grain size typically follows a lognormal distribution and may vary excessively. A more sophisticated approach involves assigning the elements of a grain into bands that represent the different crystallographic slip planes (Fig. 5a) 66 . FIPs are then averaged over these bands. However, these bands may still vary in volume. Therefore, a recently devised strategy is adopted in which bands are further segmented into sub-band regions of a constant number of elements 17,37 (Fig. 5b). These sub-bands then serve as the volume averaging domain for FIPs, which capture the fatigue crack formation driving force while strictly holding the averaging volume fixed 25,37 . The default in PRISMS-Fatigue is set to average FIPs over these sub-band regions as demonstrated in this work but users have the option to average FIPs over grains or bands as well.

Extreme value statistics
The largest volume-averaged FIP per grain is determined and these highest FIPs are then compiled for each microstructure instantiation or SVE ensemble. Only the highest FIPs are of interest since these are associated with the highest fatigue crack formation driving forces and minimum  fatigue crack formation lifetimes. These highest FIPs are fit to the Gumbel Extreme Value Distribution (EVD), which is one of three possible nondegenerate distributions to which an adequately large sample size n can converge 67 . The other two include the Fréchet and Weibull EVDs, which are not considered; the latter requires an upper limit on the data (i.e., FIPs). Previous work revealed that FIPs are typically well characterized by the Gumbel EVD (i.e., appropriate to rank order the relative fatigue resistance of different types of microstructures), so the Fréchet EVD is also not considered here but is available for PRISMS-Fatigue users 17,36,37,68 . The Gumbel EVD is plotted in appropriate coordinates to ensure that true Gumbel distribution data appear as straight lines 17,36 .

Implicit time stepping
The iterative method of Newton-Raphson is used to solve the weak form of the equilibrium equation, as the governing equation for PRISMS-Fatigue application. To do so, the loading history is divided into small increments. The Newton-Raphson method is then used to solve the equilibrium equation at each increment. An algorithmic tangent modulus derived for each constitutive model is used to form the sparse stiffness matrix. In the standard Newton-Raphson scheme, the sparse stiffness matrix is updated in every iteration within an increment, which can be computationally expensive. A modified Newton-Raphson scheme is also implemented in the framework in which the sparse stiffness matrix is updated only at the start of each increment, which is effective for mildly nonlinear problems. This decreases the computational time of sparse stiffness matrix formation, which is considerable in large-scale simulations. The solution to the linear equation is obtained using the PETSc library 69,70 included in deal.ii 59 . Preconditioning of the sparse stiffness matrix improves convergence of the iterative scheme. The values of DOFs are updated using the solution from the previous iteration, which are then used to compute the external forces which are residuals for this iteration. The iterative process continues until the residuals meet certain criteria.

Inputs and outputs
The Fatigue framework has two families of inputs including: (I) microstructure generation and FIP calculation inputs and (II) CPFEM inputs for PRISMS-Plasticity. The CPFEM simulation inputs can be summarized as: (1) Microstructure, including two files of orientation.txt, which defines the grain orientations in the Rodrigues space and phases (for multiphase simulations) and grainID.txt, which define the grain ID map inside the sample, (2) Boundary conditions, including a file BCinfo.txt, which defines the type of applied boundary conditions, (3) Latent hardening matrix, which can accommodate complex cases of latent hardening ratios in a matrix format, (4) Crystallographic information for slip (twin) directions and normal to the slip (twin) planes, and (5) main input files including the geometry, discretization, numerical integration, crystal plasticity simulation parameters, and convergence parameters. The FIP calculation input includes modifications to the input file that specifies what PRISMS-Plasticity should export (e.g., cyclic range of plastic shear strain on slip systems, peak stress normal to slip plane, etc.) in a.csv format. These are then read by the calculate_FIPs.py module to compute FIPs. Users can define their own FIP equation or select an option from the existing library.
The generate_microstructures.py module requires a single.dream3d input file (as described in the Integration with DREAM.3D section above) and generates the orientation.txt and grainID.txt files. It also stores the elements that belong to the desired volume averaging domain (e.g., grains, bands, or sub-bands) as an efficient.p pickle file. The calculate_FIPs.py module computes and stores FIPs for every element in pickle files as well. Both pickle files are then read by volume_average_FIPs.py to volume average FIPs over one of the available domains. The volume-averaged FIPs are stored in the same pickle format for efficient access by the plotting modules (compile_and_plot_FIPs.py and gamma_plane.py) but also to a.csv file for rapid user assessment. These last two modules can generate all the figures in the applications section of this work.
The PRISMS-Fatigue YouTube video tutorials and written tutorial describe each file input and output file in detail. Please see the Code Availability section for the direct link to the content.

Periodic boundary conditions
Included in PRISMS-Fatigue is the capability to perform CPFEM simulations with fully periodic boundary conditions (PBCs). This is crucial in calculations of fatigue resistance when smaller microstructure instantiations are employed that represent bulk, i.e., subsurface, material response.
Przybyla 46 presented the details of the PBCs required to mimic the subsurface microstructure response during fatigue simulations. In PRISMS-Fatigue, PBCs are implemented using a set of linear constraints. These constraints are defined on three components of opposing faces, parallel edges, and vertices. Rigid body motion is also excluded by assigning additional constraints. Three sets of constraints are applied on nodes on opposing faces (in the direction perpendicular to those faces), nodes on each set of four parallel edges (in the two directions perpendicular to the direction in which the edges are parallel), and vertices (in all directions). Contraction or expansion of the dimensions of the actual microstructure volume are considered. One should note that an efficient parallel implementation of the PBCs is nontrivial, which will be discussed later.

Parallelization
Efficient parallelization plays a key role in the PRISMS-Fatigue framework since the size of the microstructure-sensitive CPFEM simulations can grow considerably. A Message Passing Interface (MPI) framework is implemented as proposed by deal.ii 59 . The initial discretization is divided among the processors and each processor handles a part of DOFs. In addition, each processor will have access to a neighboring processor's layer of DOFs which requires their values during the simulation, termed as ghost DOFs. During assembly of the sparse stiffness matrix to solve the linear equation, each processor requires access to its own DOFs and the ghost DOFs. The ordinary MPI parallelization scheme makes the PBCs nontrivial to implement because certain processors may not have access to the required DOFs. Consequently, the parallelization scheme may change depending on the type of boundary conditions. The file periodicBCs.cc handles these tasks to appropriately implement PBCs. One should note that the conventional PBCs, which are different from the one used in PRISMS-Fatigue, is already implemented in deal.ii 59 . However, in the current PBCs used to model the subsurface effect, some constraints are defined between the DOFs of vertices and edges with the DOFs of the faces. These constraints are captured by efficiently modifying the ghost layer of each processor, which is handled by the file periodicBCs.cc. Another bottleneck in large-scale simulations is data-output. A serial data-output scheme can create an inefficient bottleneck as the simulation size increases. Thus, a parallel scheme is employed in which each processor is responsible for writing the outputs of its own DOFs.

Integration of PRISMS-Fatigue and Materials Commons
An important step towards ensuring the reproducibility and reusability of simulation data is taken here by linking PRISMS-Fatigue to Materials Common; such reproducibility and reusability has rarely been addressed in fatigue-related research and applications. The Materials Commons is a collaboration platform and information repository for the materials community 33 . The Materials Commons Python Application Programming Interfaces (MCAPI) wrapper is incorporated to link PRISMS-Fatigue to Materials Commons. Using MCAPI, the command line tool (CLI) reads in the input and output files and upload them at Materials Commons. The applications discussed in the Results and Discussion section are uploaded into Materials Common and published, which can be accessed using the link provided in the Data Availability section.
Materials Commons can also be used to establish a Community of Practice, which can share information for reuse, establish protocols, standards and best practices and, ultimately, curate information. This can include results of PRISMS-Fatigue simulations as well as experimental information for model calibration and validation. In order to expedite the rate at which materials are developed and implemented, the fatigue community is encouraged to transition to open-source simulations and software development as is already the case for other materials science software (DFT-FE, LAMMPS, etc.). The framework presented here will enable researchers to focus on critical microstructure-sensitive fatiguerelated problems (e.g., assessing other FIPs, more complex microstructure heterogeneity, as is the case with additively manufactured microstructures).