Generating polycrystalline microstructures with prescribed tensorial texture coefficients

This work is concerned with synthetic microstructure models of polycrystalline materials. Once a representation of the microstructure is generated, the individual grains need to be furnished with suitable crystal orientations, matching a specific crystal orientation distribution. We introduce a novel method for this task, which permits to prescribe the orientations based on tensorial Fourier coefficients. This compact representation gives rise to the texture coefficient optimization for prescribing orientations method, enabling the determination of representative orientations for digital polycrystalline microstructures. We compare the proposed method to established and dedicated algorithms in terms of the linear elastic as well as the non-linear plastic behavior of a polycrystalline material.


Introduction
Understanding the mechanical fatigue behavior of components made from polycrystalline materials requires either substantial experimental effort [1] or suitable analytical [2] and numerical methods [3,4]. To reduce the experimental effort and to ensure accurate as well as reliable results, it is imperative to use models which take into account the influence of the underlying microstructure onto the fatigue behavior [3,5].
For components with polycrystalline microstructures, models based on crystal plasticity (CP) [6] provide powerful tools to link the underlying microstructure to the macroscopic material properties. Starting from computational cells, see Bargmann et al. [7] for a recent overview, equipped with suitable boundary conditions and singe crystal material models, predictive models for the lifetime of polycrystalline microstructures can be constructed. Examples include, but are not limited to, investigating various loading conditions B Matti Schneider matti.schneider@kit.edu 1 Corporate Sector Research and Advance Engineering, Robert Bosch GmbH, Renningen, Germany 2 Institute of Engineering Mechanics, Karlsruhe Institute of Technology (KIT), Karlsruhe, Germany [8,9], the influence of inclusions [9,10] or different atmospheres [11] and microstructural short crack growth [12].
Utilizing micromechanical CP methods requires an accurate representation of the microstructure. Albeit it appears to be the most natural approach, solely relying on experimental image data poses quite a few challenges. 3D imaging techniques for polycrystalline materials, e.g., serial sectioning [13,14] are available, but these techniques are still quite time and cost intensive. Additionally, there is ongoing discussion regarding the error introduced when computing on non-periodic images [15,16].
Instead, using synthetic representative volume elements (RVE) [15,17] provide a way to generate periodic computational cells within a reasonable amount of time. However, using these RVEs comes with the challenge of accurately reproducing the investigated microstructure, or at least the important characteristics of it. In case of polycrystalline materials, this problem may be divided into two tasks: matching the microstructure morphology and assigning suitable crystallographic orientations to the crystallites.
For the former problem, powerful so-called microstructure generators are available. A popular framework for creating RVEs for polycrystalline microstructures are tessellations, i.e., subdivisions of the considered computational into non-overlapping domains, which represent individual crystallites and whose union covers the entire cell.
These tessellations can be tuned to match experimental data, like grain size and aspect ratio distributions [18]. For instance, based on an innovative reformulation as a convex optimization problem, Bourne et al. [19] proposed an algorithm to generate Laguerre tessellations matching prescribed grain volume fractions, which runs only a few minutes on a standard desktop computer. Using modern convex optimization solvers, Kuhn et al. [20] further reduced the required computation time and showed the capabilities of such an approach to reproduce a given grain size distribution. However, using these methods, it is not straightforward to match other geometric properties of polycrystalline microstructures, e.g., aspect ratios. Methods based on the Random Sequential Addition (RSA) algorithm provide a way to iteratively match aspect ratio distributions [21][22][23], with the drawback of increased computational cost.
For fixed grain morphology, the next step consists of assigning crystallographic orientations to the obtained grain representations. For polycrystalline microstructures, this is often treated as a post-processing step (in contrast, for example, to the RVE generation of short fiber reinforced composites [24]). There exist a variety of methods [18,21,25], basically following two different approaches. The first approach discretizes the one-point correlation function, describing the orientation state within the polycrystal, i.e., the crystallite orientation distribution function (CODF) [26,27]. Subsequently, orientations are selected based on their respective CODF values, i.e., an orientation with a high value is more likely to be selected than one with a low value [26,28]. Modern microstructure generators employ varieties of this discretization technique. For instance, the work of Groeber and Jackson [21] uses a discretization in combination with an iterative binning algorithm [29] to match the prescribed orientation state. Roters et al. [25] sample the discretized distribution function using a combination of deterministic and stochastic procedures [30]. In recent publications, these methods were further improved, either by iteratively adjusting the parameters [31,32] of the generator or by improving the discretization of the CODF [23,33]. A different approach is based on matching special cases of the CODF, e.g., uniform or aligned distributions. For instance, Quey et al. [34] proposed a dedicated algorithm to generate uniformly distributed orientations. It is also possible to approximate the CODF by a superposition of different so-called texture components [35][36][37]. By modeling these components [38] individually, it is possible to sample these orientations and assign them to cells [39].
However, these methods suffer from the drawback that they either need the CODF or a (possibly large) data set which serves as an accurate representation of the CODF. In this work, we propose a method based on condensing the information carried by the CODF via the coefficients of a tensorial series expansion [40,41]. As these tensorial coeffi-cients are easy to compute from experimental data, directly linked to the bounds of mechanical properties [42,43] and easily applied in microstructural sensitive design [44,45], we prefer them to an approach involving spherical harmonics [46,47]. Moreover, Böhlke [48] introduced a method for estimating the crystallite orientation distribution function for a finite number of given texture coefficients and Junk et al. [49] analyzed this approach in the context of maximum entropy moment problems. Böhlke [50] derived a hierarchy of evolution equations for the texture coefficients under the Taylor-Voigt assumption of vanishing strain fluctuations on the microscale. Motivated by these observations, we propose to use a limited set of tensorial texture coefficients as the input of a microstructure generator, with the goal to obtain crystallographic orientations for each crystallite matching the prescribed texture coefficients. We follow a two-step procedure. First, the orientations are sampled randomly. In a second step, these orientations are corrected in terms of a gradient-based optimization technique, which ensures that the resulting texture coefficients match the prescribed ones up to a given tolerance.
To introduce the T exture coefficient Optimization for Prescribing orientations (TOP) method, we briefly revisit the used material model and the notation of rotations in Secs. 2.1 and 2.2, respectively. In Sec. 2.3, we outline the problem formulation and the solution scheme. We investigate the capabilities of the proposed method, by comparing it to state-of-the-art algorithms in Sec. 3.

Crystal plasticity model
As studying the cyclic fatigue behavior in polycrystals serves as our primary motivation, we consider a small-strain crystal plasticity model with kinematic hardening as presented by Kuhn et al. [51], which we briefly summarize. The total strain tensor ε is additively decomposed into an elastic ε e and a plastic ε p contribution The stress σ is related to the elastic strain by Hooke's law where C denotes the fourth order stiffness tensor. Single crystal plasticity assumes that plastic deformation is the result of dislocation movement, the latter taking place on the corresponding crystallographic slip systems. We consider volume-preserving slip mechanisms, i.e., conservative glide. An arbitrary slip system α is characterized by two orthogonal vectors, the slip direction m α and the slip plane normal n α . Activating slip system α requires the resolved shear stress to exceed a critical value τ α c . The flow rule arises by superposing the crystallographic slip rates on the individual slip systemṡ (2.4) involving the plastic slip rateγ α of slip system α. As we consider cyclic loading scenarios, we use a model for the plastic slip rateγ α which captures typical cyclic phenomena, such as the Bauschinger effect [52] and ratcheting [53]. More precisely, for the study at hand, we use the flow rule proposed by Hutchinson [54] augmented by a backstress term X α b following Cailletaud [55]. To describe the evolution of the backstresses X α b in terms of the slip rate, we use the Ohno-Wang kinematic hardening model [56] which extends Chaboche's formulation [57]. For a more sophisticated approach based on a backstress tensor, we refer to Harder [58] and the references therein.

Representing the texture
Describing the deformation behavior of a polycrystal, i.e., an agglomerate of crystals, by crystal plasticity requires taking the distinct orientation of each crystallite into account. For instance the stiffness tensor C in Hooke's law (2.2) depends on the crystal orientation. To describe the orientations in a polycrystalline material, for each crystallite we use a proper orthogonal tensor where (e 1 , e 2 , e 3 ) and (g 1 , g 2 , g 3 ) represent the fixed orthonormal basis of the sample and the crystallite, respectively. Thus, the orientation of a crystallite is encoded by the rotation from the crystal coordinate system into the sample coordinate system. All orientation tensors Q are elements of the group of proper rotations in three dimensions, i.e., Q ∈ SO (3). In the following, we use the expressions rotation and orientation interchangeably. For a given polycrystal, the orientation may be succinctly described in terms of the crystallite orientation distribution function (CODF) f , a probability distribution on SO(3) w.r.t. the Haar Measure d Q (normalized to unity). More precisely, the CODF f is non-negative, and normalized For a (measurable) subset S ⊆ SO(3) of orientations, the expression S f (Q) d Q computes the probability to find orientations contained in the set S. Due to the invariance properties of the Haar measure [59], the invariance property holds for all Q 0 ∈ SO (3). Moreover, the CODF reflects the underlying symmetries of the crystals forming the aggregate, i.e., where S C denotes the (discrete) symmetry group of the crystals, as the orientation states Q and Q H C correspond to the same physical orientation state of the crystallite. As a result of a forming process, the sample itself may possess a certain symmetry, encoded by a symmetry group S S . This is reflected by the CODF in terms of the condition where S S denotes the symmetry group of the sample. For the sake of readability, we will only consider the case of cubic crystals and triclinic sample symmetry in the following [60,Ch. 3]. Our approach permits a straightforward extension to the general case with arbitrary crystal and sample symmetries, see Zheng and Fu [61,62]. If the CODF is not uniform, i.e., f (Q) = 1 for some Q ∈ SO(3), then the material will be said to possess a crystallographic texture. Working with the full CODF is oftentimes impractical. Guidi et al. [40] proposed a way to condense the encoded information. More precisely, any square integrable function f may be expressed in terms of a tensorial Fourier series [40,41] f (2.13) involving the tensorial Fourier, or texture, coefficients V α i and the tensor functions F α i [48,63]. The subscript i denotes the number of linear independent harmonic cubic tensors of rank α. Harmonic tensors, denoted by a prime (·) , are completely symmetric and traceless, i.e., the relations reduce the number of degrees of freedom to 2α + 1 [48]. The tensor functions F α i (Q) in equation (2.13) arise by rotating suitable reference tensors T α i [40] denotes the Rayleigh product, i.e., the rotation of a tensor by Q. Without loss of generality and following Böhlke et al. [64] and Dyck and Böhlke [65], we normalize the Frobenius norm of the reference tensors to instead of T α i = 1 (as done by Guidi et al. [40]). Interpreting the texture coefficients V α i as a convex combination of normalized reference tensors of single crystal states [63], we compute the tensorial texture coefficients in the case of discrete (experimental) orientation data as [50] V α i (Q 1 , . . . ,  [43,50] use the norm to measure the degree of anisotropy. For a completely uniform CODF, all texture coefficients vanish, whereas for the case of single crystals the norm of all texture coefficients is equal to one. As we seek a compact representation of the CODF in the following, we will restrict to the texture coefficients up to rank six. As the cubic reference tensor of rank two is zero and, because of the cubic crystal symmetry, odd-rank reference tensors up to a rank of eight vanish [40], we focus on the texture coefficients of rank four and six. For a precise overview and thorough discussion of texture coefficients in a more general context, the reader is referred to the work of Fernández and Böhlke [63].

Texture coefficient optimization for prescribing orientations (TOP)
To create digital representations of polycrystalline microstructures, it is not sufficient to solely match the grain morphology. In addition, we have to take the orientation state, i.e., the CODF, into account [66]. Many tools either rely on simple model CODFs [18,34], need (possibly vast) experimental data [21] or at least a representation of the complete CODF [30] to generate orientations for digital microstructures. In this section, we propose a method to generate orientations based on tensorial texture coefficients. For a given unit cell, subdivided into individual grains, our goal is to prescribe the orientation per grain in such a way that the resulting texture coefficients V α of the unit cell match the prescribed onesV α up to a given tolerance tol, thus approximating the underlying CODF. To this end, we formulate our objective function as the difference in independent components between the current and the desired texture coefficients where Q G = (Q 1 , . . . , Q K ) is a vector of orientations (one for each of the K cells) and α max denotes the maximum rank of the considered texture coefficients. Starting from a randomly initialized set of orientations, we seek to minimize the objective function (Q G ). The objective function is continuously differentiable, and it is natural to use gradient-based optimization techniques. Indeed, the objective function is actually a polynomial in the components of the individual grain orientations Q K . In particular, the function is infinitely often differentiable.
The simplest conceivable approach proceeds via gradient descent, i.e., following the direction of steepest descent. Please keep in mind that the objective function is defined (2.19) on the K -fold product of SO (3). The space of special orthogonal tensors SO(3) forms a non-linear subset of the space of second-order tensors. In particular, a simple explicit Euler discretization of gradient descent does not work, as the next trial point does not necessarily lead to vector whose components satisfy the constraints of SO(3) [67,68]. This is illustrated in Fig. 1(a). On a curved space with Riemannian metric, the natural extension of straight lines are so-called geodesics, which emanate from a point in a specific (tan- gent) direction by parallel translation. On a (compact, matrix) Lie group with its natural Riemannian metric (the Killing form), following the geodesics may be computed in terms of the matrix exponential. In case of SO (3), this reduces to Rodrigues' formula describing a rotation around an axis u by an angle θ and where we set ω = θ u as well as The gradient descent scheme, with a fixed step size t > 0, works as follows.
. Then, we investigate the function by the chain rule, gradient descent proceeds via

Setup
In the following sections, we wish to provide insights into the performance of the proposed TOP method. As a first step, we consider linear elastic material behavior, i.e., we investigate the effective stiffness. Secondly, we study cyclic stress-strain hystereses.
To create the morphology of the microstructures under investigation, we use the algorithm described in Kuhn et al. [20] to generate digital polycrystalline microstructures with prescribed volume fractions. For the morphology we consider two cases, a unique and log-normal grain size distribution (GSD). The former means that all grains have the same volume, i.e., V g = 1 /G, where G denotes the total number of grains in the volume element. Restricting to a unique grain size permits us to study the influence of the individual grain orientations exclusively. Due to their frequent occurrence in experiments [69], we also investigate microstructures with an equivalent diameter following a log-normal grain size distribution with mean equal to unity and a standard deviation of 0.15, see Kuhn et al. [20].
For a fixed morphology, we furnish the grains with orientations, where we investigate three different CODFs, namely a uniform, one with a slight texture and one with an increased texture. For the former, we compare the accuracy of TOP and the algorithm proposed by Quey et al. [18,34], integrated into the polycrystal generation software Neper. In addition, we include a random orientation sampling (realized using the scipy implementation for sampling the Haar distribution [70]) as a benchmark. For the textured CODFs, we compare the TOP method to random sampling from discrete orientation measurements, which is a common practice [71,72]. For the textured CODFs and a log-normal GSD, we additionally consider the Texture Discretization Technique (TDT) algorithm proposed by Melchior and Delannay [27], which, in a first step, samples orientations using the method proposed by Tóth and Van Houtte [26]. In a subsequent clustering step, a binary look-up table is computed by evaluating the misorientation of each pair of sampled orientations. If this misorientation is below a chosen threshold value, the corresponding entry in the look-up table is set to 1 otherwise to 0. To assign orientations to grains, each grain is associated with a number of so-called elementary volumes according to their size, which is used to find orientations in the look-up table with at least this number of orientations having low misorientation. The corresponding crystallographic grain orientation is then the average of orientations with low misorientation to each other. The parameters, i.e., the number of elementary volumes per grain and the threshold value for the misorientation, have to be chosen judiciously. The TOP method is implemented in Python with Cython extension following the optimization procedure outlined in Sec. 2.3. Unless otherwise specified, we use a tolerance of tol = 10 −8 to solve the optimization problem and consider texture coefficients up to rank six.
The material model described in Sec. 2.1 is implemented in a user-material-subroutine (UMAT). The coefficients of the elastic stiffness tensor are taken from the literature [73,74], whereas the critical resolved shear stress, assumed to be identical for all slip systems, and the parameters of the kinematic hardening model were fitted to experimental stress-strain hystereses of the steel C45 using Bayesian optimization [51]. The complete set of used model parameters is summarized in Table 1.
To efficiently compute the effective stiffness as well as the macroscopic stress-strain hystereses, we use the FFT-based solver FeelMath [75][76][77]. For the stiffness computations we rely on the conjugate gradient method [78,79], whereas for the non-linear problem we use a Newton-CG method [80,81]. For both problems we use the Moulinec-Suquet discretization [82,83]. For a perspective of solution schemes and discretizations, we refer to the recent review article by Schneider [84]. By default, we carry out the computations on periodic microstructures, discretized by 64 3 voxels. Please note that we apply periodic boundary conditions to compute the stiffness and hystereses.

Linear elastic stiffness
In this section, we study the effect of different orientationsampling techniques on the effective stiffness of polycrystalline microstructures. In order to minimize the influence of the underlying microstructure morphology, we use a fixed grain microstructure for each realization and all orientation sampling methods. This is illustrated in Fig. 2, where we show the results of different sampling techniques for a fixed grain structure with grains of identical volume.

Uniform CODF
We start with the case of a unique grain-size and a uniform orientation distribution, corresponding to mechanically isotropic behavior [86][87][88]. For the results to be representative, it is necessary to determine the number of grains which ensure an isotropic effective material response, see for example Kanit et al. [15] and Yang et al. [17]. In this spirit, we investigate microstructures with an increasing number of grains and study their effective stiffness.
As discussed in Sec. 2.2, for a uniform CODF, all texture coefficients vanish, i.e., holds for all considered texture coefficients. To quantify the anisotropy of the stiffness tensor we compare to the best approximation by an isotropic tensor (see Eq. (3.5)), i.e., we project the computed stiffness tensor onto the space of isotropic tensors of fourth order. For a detailed discussion Table 1 Parameters used for the crystal plasticity model [73,74] Cubic stiffness (in Voigt notation)  [85] see the work by Federov [89] and Arts [90]. We compute the mean stiffness of N = 10 realizations and extract the Lamé constants via whereC G,i j denotes the i j-th entry of the stiffness tensor in Voigt notation [91]. Using the best isotropic approximation C iso (μ app , λ app ) based on the extracted Lamé constants, we introduce the isotropy error δ iso via measuring the degree of anisotropy present in the computed stiffness.
For an increasing number of grains G ∈ {32, 64, 96, 128, 256, 384, 512, 768, 1024, 1536}, we show the resulting isotropy error for the three different orientation sampling methods in Fig. 3(a). We observe a decreasing isotropy error for all methods with an increasing number of considered grains. All methods decrease the isotropy error at a similar rate. However, they differ in the initial error level. For instance, all sampling techniques reach a low isotropy error for 1536 grains, namely 0.251%, 0.041% and 0.027% for random sampling, the Neper and TOP method, respectively. To reach a mean error below 1%, the microstructure has to consist of more than 64 grains if the orientations are sampled randomly or generated by Neper. For all investigated grain counts, the TOP method produces the lowest isotropy error. Neper starts with a substantially higher error (by roughly one order of magnitude) at low grain counts and reaches a similar performance to TOP for more than 300 grains. For the naive random sampling, the isotropy error has a quite large offset to the more involved algorithms. In addition to evaluating the degree of isotropy, we investigate the deviation from the effective, infinite-volume stiffness. As our ground truth, we consider the mean of ten apparent stiffnesses, each computed using volume elements consisting of 10 000 grains and discretized by 128 3 voxels (see Fig. 4a). The orientations are sampled using the TOP method. The mean stiffness and the 95% confidence intervals, computed via Student's t-distribution [92], are given in Table 2. The isotropy error of the mean stiffness is δ iso = 0.012%. We define the total error δ tot as the mean relative error between the stiffness of each realization and the one given in Table 2, i.e., For the total error, shown in Fig. 3(b), we make similar observations as for the isotropy error. All of the methods decrease the total error at a similar rate, but differ initially. For the case of orientations generated by Neper, the error for 32 grains is δ tot = 1.17% and therefore roughly twice as large compared to the TOP method with δ tot = 0.521%. To reach a similar error with randomly sampled orientations about 768 grains have to be considered. Random sampling leads to a mean error of 0.677% for 1536 grains. The errors produced by the Neper and TOP method are similar to each other with 0.073% and 0.078%, respectively.
To understand the similar rates of error decrease more thoroughly, it is helpful to decompose the total error δ tot into two contributions [15]. The first part is the random error and quantifies the inaccuracy associated with working on a reduced representation of the ground truth. The second contribution quantifies artificial long-range correlations introduced by working on periodic microstructures [15,16]. We attribute the visible offset in Figs. 3 and 6 to the random error, as we use the same geometric representations for each orientation sampling method. Thus, a smaller random error is achieved by the TOP method and further reduction of the total error δ tot is attributed to increasing the cell-size, i.e., increasing the number of grains.
Up to this point, our investigations were based on a polycrystal with a unique GSD, i.e., a unique grain size. However, to account for the influence of the grain size on the mechanical response, it may often be necessary, and therefore desirable, to match more realistic grain size distributions when generating synthetic polycrystalline microstructures. Thus, we turn to polycrystals with a log-normal GSD, as typically observed in real-world samples [69], with a mean equivalent diameter equal to unity and a standard deviation of 0.15. Figure 5 shows an example of a microstructure consisting of 128 grains, equipped with orientations from the three different sampling techniques. The isotropy as well as the total error for different sampling methods are shown in Fig. 6. For the log-normal GSD, we register a notable decrease in accuracy for the Neper sampling method compared to the unique grain size. Considering the case of 32 grains, the isotropy error and total error increase from 1.22% and 1.17% to 1.62% and 2.19%, respectively. This loss of accuracy persists, even for larger grain counts, e.g., for 1536 grains the total error for the unique and log-normal GSD are 0.07% and 0.37%, respectively. For randomly sampling the Haar distribution, the influence of a log-normal grain size distribution is smaller. For instance the biggest difference in the isotropy error is 1.23% and 1.60% for the unique and lognormal GSD and 32 grains, respectively. The proposed TOP method takes the volume fraction of each grain into account in an explicit way when optimizing the orientations. This results in strikingly similar error levels for both the unique and the log-normal case. Whereas the total error values realized by microstructures with 32 grains differ slightly for the unique and log-normal case, the resulting isotropy error is δ iso = 0.16% for both GSDs. We investigate the influence of the maximum rank of the texture coefficients considered in our optimization scheme in the case of a uniform orientation distribution. For this purpose, we consider the case of ten microstructures consisting of 1024 grains, see Fig. 4(b) for an example of one realization. We study two different cases: Using solely the texture coefficient of rank four to optimize the orientations and considering the coefficients of rank four  Fig. 7 Comparison of the δ tot and δ iso for the stiffness computed for 1024 grains with TOP orientations and different considered texture coefficients plotted on a finely resolved y-axis and six. For these two cases, the isotropy and total error are shown in Fig. 7 for different values of the tolerance tol used in the optimization procedure. Both errors show a decrease up to a value of tol = 10 −6 , after which the resulting errors do not change. Interestingly, considering only the texture coefficient of rank 4 appears to be beneficial. As all total errors are below 0.1% and all isotropy errors even below 0.03%, using texture coefficients of rank four and solving the problem up to a tolerance of tol = 10 −6 is sufficient for the case of a uniform orientation distribution when considering 1024 grains and solely the macroscopic stiffness is of interest.

Textured CODF
To further investigate the capabilities of the TOP method, we turn to a non-uniform CODF, i.e., a textured polycrystal. The prescribed CODF was generated by MTex [38], taken from the MTex documentation [93], see Fig. 8 for the corresponding pole figures. As MTex allows the sampling of CODFs, we draw 50 000 samples at random for computing the texture coefficients, assuming the same weight for each sample.
As a ground truth we define the mean stiffness of ten realizations, each with 10 000 grains. The resulting stiffness for TOP orientations is given, with its respective 95% confidence intervals, in Table 3. The isotropy error of this stiffness computes to δ iso = 5.54%, i.e., a slight anisotropy appears. For this texture, we investigate the approximation quality of the stiffness for a varying number of grains, each with identical volume. The total error for randomly sampling from the gen-erated orientations and using texture coefficients is shown in Fig. 9(a). Randomly sampling the generated orientations gives a total error of δ tot = 4.47% for 32 grains and reaches an error below 1% for 936 orientations. The mean total error achieved by the TOP method of δ tot = 0.51% for 32 grains actually lies below the error value achieved by randomly sampling 1536 orientations. For the latter number of grains, TOP achieves an error δ tot = 0.07%. This difference is attributed to the notable offset between the random sampling and TOP method, as both decrease δ tot with the same rate.
Let us consider the case of a log-normal grain size distribution. For the TDT algorithm we assign eight elementary volumes to the smallest grain and increase the number of elementary volumes for each grain according to its size. We set the threshold misorientation value to 5 • . In Fig. 9(b), we provide the total error δ tot for ten realizations with a varying number of grains. For the case of randomly sampling from given orientations, we observe a slight increase in the error value induced by the underlying log-normal grain size distribution. For instance, for a microstructures with 32 grains, the mean error is δ tot = 3.12% and δ tot = 3.74% for the unique and log-normal GSD, respectively. This effect decreases when a larger number of grains is considered, as the effect of a single, large grain with specific orientation on the overall response decreases. In contrast, the TOP method is not adversely affected. Indeed, during optimization, the volume fraction is explicitly taken into account when computing the texture coefficients, see equation (2.18). Using the TDT algorithm results in a lower total error than random  Table 3 Mean and 95% confidence intervals in GPa for the stiffness in Voigt notation computed by averaging ten realizations of microstructures with 10 000 grains and TOP orientations for a synthetic CODF sampling for all grain numbers considered. For instance, for a 64-grain microstructure, the total error is δ tot = 3.75% and δ tot = 2.77% for random sampling and the TDT, respectively. For both algorithms the error decreases with a similar rate as for the proposed TOP algorithm, whereas they both result in higher total errors than using TOP.

Highly textured CODF
In practical applications, e.g., cold rolled steel, the intensities in the pole figure may reach values as high as ten. To investigate this scenario, we next consider a case with an increased texture in the CODF. We rely on synthetically generating a CODF using MTex [38] and show the resulting pole figures in Fig. 10.
For the ground truth we proceed in the same way as for the slightly textured CODF, using ten microstructures with 10 000 grains of equal volume, equipped with orientations from the TOP method to compute the mean stiffness. For this case, the mean and the 95% confidence intervals are given in Table 4. The isotropy error is δ iso = 18.78% which is more than three times the error of the slightly textured case, i.e., δ iso = 5.54%.
First, we investigate the case of a unique grain size distribution and show the resulting total error in Fig. 11(a). For TOP and random sampling, the error decreases with a similar rate, which is consistent with our observations in the slightly textured case. For TOP as well as for random sampling the total error is slightly lower than for the previously investigated CODF, e.g., for 32 grains the total error is δ tot = 3.62% and δ tot = 0.40% for random sampling and TOP, respectively. This holds for higher grain numbers as well. Indeed, for 1536-grain microstructures, randomly sampling orientation data leads to a total error of δ tot = 0.53%, whereas   Fig. 11 Total error δ tot of the effective stiffness computed for microstructures with a unique and log-normal grain size distribution and a highly textured CODF using orientations generated by TOP results in an error of δ tot = 0.06%. However, the relative difference between the total errors for the two CODFs is lower for random sampling than for TOP. For the case of a log-normal GSD, compared to microstructures with grains of equal volume, the total error increases for both methods. For microstructures with 64 grains equipped with orientations randomly sampled from experimental data, the total error is δ tot = 2.82% and δ tot = 3.11% for a uniform and log-normal GSD, respectively. This observation holds for the TOP method as well, e.g., using 64 grains leads to an error increase from δ tot = 0.40% for a unique GSD to δ tot = 0.45% if the grain sizes follow a log-normal distribution. For the TDT algorithm and a grain count below 768, we set the number of elementary volumes for the smallest grain to eight. To account for the increased grain count, we increase the number of elementary volumes to twelve for 1024 and 1536 grains in the microstructure, whereas we retain the threshold of 5 • for the misorientation computations. For our choice of parameters and grain numbers up to 256, we observe that the resulting error is close to random sampling. For instance, the total error obtained using a 256-grain microstructure is δ tot = 0.94% and δ tot = 1.37% for orientations from random sampling and the TDT algorithm, respectively. When increasing the grain count, there seems to be a limiting accuracy that the TDT algorithm can reach. Indeed, the total error does not decrease below 1%. The source of this phenomenon needs to be investigated more thoroughly, and is beyond the scope of this work.

Cyclic stress-strain hystereses
We expand our investigation into the elasto-plastic regime, focusing on the effect of the orientation sampling method on the cyclic stress-strain hystereses of the material. As boundary condition, we use a macroscopic strain which follows a triangular path with an amplitude of ε a = 0.7% and a cycle time of four seconds. To ensure a stabilized cyclic stressstrain hystereses, we compute two cycles in total and use the last one as our quantity of interest [74].
Because of the increased computational cost, we restrict the investigations to grain counts G ∈ {32, 64, 128, 256, 512, 1024} and use five realizations per number of grains, i.e., N = 5. We use the material parameters specified in Table 1.

Uniform CODF
For the uniformly distributed orientations, we asses the isotropy of the results. For this purpose, and a single realization, we compute three load cases to obtain the cyclic stress-strain hystereses in three different directions, i.e., X X-, Y Y -and Z Z-direction. For a perfectly isotropic response, the stress values would coincide for every considered direction. Thus, to measure the deviation from this isotropic result, we use the average stress values of all directions at each time step s as our reference. Then, for each realization n, we compute the sum of the squared relative differences between the stresses in every direction and the mean of all directions weighted by the number of stress values S, i.e., δ hys,iso n (3. to get confidence in our results. We use the microstructures from Sec. 3.2 with orientations prescribed by Neper, TOP and random sampling. For an increasing number of grains, we show the error δ hys,iso in Fig. 12(a). Neper and TOP behave similar to each other, both lying below the error values achieved by random sampling. For example, the mean errors obtained from microstructures with 32 grains are δ hys,iso = 5.63%, δ hys,iso = 5.97% and δ hys,iso = 1.10% for random sampling, Neper and TOP, respectively. For an increasing number of grains in the microstructure and randomly sampled orientations, the error decreases more slowly than for the other methods. Also, random sampling results in the highest mean error value of δ hys,iso = 4.49% for 1024 grains. We observe a steeper decrease in δ hys,iso for an increasing number of grains for Neper and TOP, both lying close to each other. For example, microstructures with 64 grains produce an error of δ hys,iso = 1.19% and δ hys,iso = 1.40% for TOP and Neper orientations, respectively. For 1024 grains, the error levels are δ hys,iso = 0.27% and δ hys,iso = 0.16% for Neper and TOP orientations, respectively.
In Sect. 3.2, Fig. 7(a), we observed that taking a higher texture coefficient than rank four into account does not increase the degree of isotropy of the effective stiffness matrix significantly. Facing non-linear plastic behavior, we revisit the influence of higher order coefficients onto the macroscopic mechanical response. In Fig. 12(b), we show the isotropy error δ hys,iso for different texture ranks and a varying number of grains. The curves show similar behavior for a small number of grains (up to about 256), with a comparable error of δ iso,hys = 1.69% when considering solely rank four texture coefficients and δ iso,hys = 1.10% when additionally optimizing rank six texture coefficients and using 32 grains. The difference becomes more pronounced for a larger number of grains, as the error obtained by optimizing the fourth rank coefficients is δ iso,hys = 0.36%, whereas accounting for the tensor of rank 6 reduces the error to δ iso,hys = 0.18% for 512 grains. Following the procedure in Sec. 3.2, in addition to investigating the degree of isotropy, we would like to assess the ability to reproduce the effective mechanical response with a minimum number of grains. In the case of non-linear mechanical behavior, we define our ground truth as the stress-strain hystereses computed for five realizations of a microstructure with 10 000 grains, discretized by 128 3 voxels. From these five realizations, we compute the mean stress-strain curve aŝ σ r ,s,n , (3.10) where σ r ,s,n denotes the macroscopic stress value in direction r at a given time step s and N refers to the number of realizations, i.e., N = 5. For the considered loading directions, the resulting stress-strain hystereses are shown in Fig. 13. We observe that the individual curves lie on top of each other, i.e., there is no anisotropy present. For each number of grains G and each realization, we compute the root of the mean squared relative error in each direction as δ hys,gt n,r where r refers to the loading direction, i.e., r ∈ {X X, Y Y , Z Z} in our case. Then, we compute the mean error over all considered directions δ hys,gt n,r , (3.12) where R denotes the number of considered directions, i.e., R = 3 in this case. Comparing δ hys,gt for different orientation sampling methods in Fig. 14, we observe similar trends as for the isotropy error δ hys,iso . For all methods, the error decreases with an increasing number of grains in the microstructure. For a small number of grains, the error resulting from TOP orientations is smallest with δ hys,gt = 1.80% and δ hys,gt = 0.78% for 32 and 256 grains, respectively. The error from using Neper orientations is higher, with δ hys,gt = 3.93% and δ hys,gt = 0.82%. Randomly sampling the Haar distribution results in an error of 9.00% and 2.15% for the same number The error δ hys,gt for taking only the texture coefficient of rank four into account, is shown in Fig. 14(b) together with the previously discussed results for considering texture coefficients with rank four and six. We observe that the error when accounting solely for rank four texture coefficients is higher than the error produced when considering higher ranks. The difference is less pronounced than for δ hys,iso . To extend our studies to a non-unique grain size distribution, we use microstructures with a log-normal grain size distribution. We fix the mean and standard deviation to mean = 1 and stdev = 0.15, respectively. To reduce the computational effort and because Neper and TOP provided the most promising results, we only consider orientations generated by Neper and TOP in the following. Figure 15(a) shows δ hys,iso for an increasing number of grains G. For every number of grains, the TOP methods provides a smaller error compared to Neper. For instance, using 32 grains, the error for TOP and Neper is δ hys,iso = 3.72% and δ hys,iso = 12.02%, respectively. The influence of the underlying GSD manifests. Indeed, for both cases, the values are larger than for the unique grain size distribution.
Similar to the uniform GSD, the hystereses error closely follows the trend observed fo the isotropy error, see Fig. 15(b).

Textured CODF
For the case with mild anisotropy, we consider the synthetic CODF described in Sec. 3.2. We compute the stress-strain hystereses using five microstructures consisting of 10 000 grains discretized by 128 3 voxels, see Fig. 4(a). In accor-dance with the case of a uniform orientation distribution, we use the mean stress values of these five realizations as our ground truth. The resulting stress-strain hystereses are shown in Fig. 16 for all three considered loading directions. We observe a slight anisotropy in Y Y -direction, whereas the stress-strain curves in X X-and Z Z-direction coincide. We show the total error to the mean stress values, i.e., Eq. (3.12), in Fig. 17(a) for the TOP method as well as for randomly sampling from given orientations.
Using random orientation sampling produces a larger error for all grain numbers considered. Especially for a small number of grains, the TOP method results in a visibly smaller error than for random sampling the experimental data. For 32 grains, the hysteresis total error δ hys, tot is 3.60% and 1.28% for random sampling and TOP, respectively. For random sampling, the error reduces to 0.76% for 1024 grains, which is close to the value achieved by TOP, with δ hys,gt = 0.52%. We observe similar behavior for the case of a log-normal grain size distribution with mean = 1 and stdev = 0.15 in Fig. 17(b). The error for 32 grains increases for both kinds of orientation sampling methods, namely to 3.84% and 1.41% for random and TOP sampling, respectively. For both the unique and log-normal case, similar errors of 0.85% and 0.44% are achieved for randomly sampling experimental orientations and using 1024 grains. Interestingly, the error for a log-normal GSD is actually smaller than for the unique GSD. For instance using the TOP method and 512 grains, we observe an error of δ hys,gt = 0.66% and δ hys,gt = 0.49% for the unique and log-normal distributions, respectively.
For the TDT algorithm, we observe a lower error than for random sampling when an intermediate number of grains is considered, i.e., for grain counts of 64, 128 and 256. For instance, the error for a microstructure consisting of 64 grains equipped with orientations of the TDT algorithm is δ hys,gt = 2.23% and δ hys,gt = 2.22% for 128 grains. With 64 and 128 grains, the random sampling leads to an error of δ hys,gt = 3.84% and δ hys,gt = 2.80%, respectively. For a larger number of grains, above 256, the error computed for the TDT algorithm exceeds the error of the randomly sampled orientations from given data. For 1024 grains, the error for random sampling is δ hys,gt = 0.85% and δ hys,gt = 1.00% for the TDT algorithm. All of the observed error values are above the errors obtained by TOP, e.g., using 32 grains, the error for the TOP method is δ hys,gt = 1.42% whereas the TDT algorithm and random sampling lead to an error of δ hys,gt = 4.37% and δ hys,gt = 3.84%, respectively.

Highly textured CODF
Last but not least, we consider the GSD outlined in Sec. 3.2 with an increased degree of anisotropy. Similar to the case of a slight anisotropy, we compute the stress-strain hystereses for five microstructures consisting of 10 000 grains and a discretization of 128 3 voxels. As our ground truth we use the mean stress of these five realizations. For microstructures with grains having a unique grain size distribution and orientations from TOP or randomly sampling experimental data, we show the total error in Fig. 18(a). We observe that, for all grain counts considered, using the TOP method results in lower error values compared to randomly sampling from given orientation data. For instance, using microstructures with 32 grains leads to a total error of δ hys,gt = 7.54% and δ hys,gt = 17.44% for TOP and random sampling, respectively. Thus, we observe an increase in the total error in comparison to the slightly textured CODF for both sampling methods and all microstructures. Indeed, for a 1024-grain microstructure equipped with orientations from TOP, the error increases from δ hys,gt = 1.42% for the slightly textured case to δ hys,gt = 5.24% for the case of higher texture. This observation holds for randomly selecting orientations from given orientation data, e.g., for a microstructure consisting of 256 grains the error for the highly textured CODF is δ hys,gt = 10.1% whereas it is δ hys,gt = 1.82% for the slightly textured case. Figure 18(b) shows the total error for the case of a lognormal GSD equipped with orientations from TOP, TDT and random sampling. We make similar observations to the slightly textured CODF, i.e., an increase in the total error compared to the results for the unique GSD. For instance, a 64-grain microstructure with TOP orientations leads to an increase in the total error from δ hys,gt = 5.36% for a unique GSD to δ hys,gt = 9.62% for a log-normal GSD. Comparing the same microstructures equipped with orientations from randomly sampled orientation data, the error increases from δ hys,gt = 13.2% to δ hys,gt = 16.3% for a unique and a lognormal GSD, respectively. For lower grain counts, i.e., below 256, using the TDT algorithm results in similar error values as randomly sampling orientation data. An exception is the 32-grain microstructure, for which the total error value δ hys,gt = 11.7% is close to the value obtained using TOP, i.e., δ hys,gt = 8.02%. For higher grain counts, i.e., above 256, the TDT algorithm does not decrease the total error but instead we observe an increase in the error values obtained, in line with observations made investigating the performance for the linear elastic properties in Sec. 3.

Conclusion
In this work, we proposed to use the coefficients of a tensorial Fourier expansion of the crystallite orientation distribution function [40] to equip digital polycrystalline microstructures with crystallographic orientations for micromechanical sim-ulations. Our proposed method is based on minimizing the difference between the current and the prescribed tensorial Fourier, or texture, coefficients and uses a gradient descent scheme on the Lie group SO (3).
We compared the proposed texture optimization for prescribing orientations (TOP) method to different stateof-the-art methods, e.g., implemented in the sophisticated microstructure generation tool Neper [34]. In a first step, we investigated the homogenized stiffnesses of polycrystals for the case of a uniform and two textured crystallite orientation distribution functions (CODF). Subsequently, we extended our studies to the non-linear case, where we investigated the macroscopic cyclic stress-strain hystereses of the microstructures. For both, the linear elastic and the non-linear plastic case, we considered a unique as well as a log-normal grain size distribution (GSD). By introducing suitable error measures we investigated and compared the performance of the proposed method.
In the isotropic, linear elastic case, TOP provided better results compared to the Neper method and random sampling of orientations. Using TOP, an isotropic effective stiffness could already be achieved for small grain numbers. Owing to the fact that the volume fraction of each individual grain is explicitly accounted for, the advantage becomes more pronounced when dealing with microstructures having a lognormal grain size distribution. Additionally, with TOP it is possible to reproduce the linear-elastic behavior of polycrystals with a unique GSD and a textured CODF more accurately and efficiently than via a random sampling from experimental orientation data. This holds as well for the case of a log-normal grain size distribution. Comparing to the Texture Discretization Technique (TDT) algorithm proposed by Melchior and Delannay [27], which also considers grain size during orientation assignment, the TOP method performed better for both CODFs considered. Our intensive numerical studies revealed that the performance of the TDT algorithm, in our setting, critically depends on the choice of parameters, i.e., the misorientation value and the number of elementary volumes per grain.
For the non-linear plastic behavior, the results of the Neper method were very similar to the ones provided by TOP, showing the capabilities of the dedicated algorithm. Although the effect was less pronounced than for the case of linear-elastic behavior, we observed that a underlying log-normal GSD results in a decreased performance for the Neper method. TOP, on the other hand, was able to produce similar results as for the unique GSD. In addition, microstructures with orientations provided by the TOP method allow to accurately compute the effective, non-linear behavior of polycrystals with an underlying texture. For both textured CODFs considered in this work, the defined error measures were lower compared to randomly sampling orientation data. The errors for a log-normal GSD obtained by TOP were below the ones obtained with random sampling or the algorithm of Melchior and Delannay [27], even for a small number of grains. Investigating a highly textured CODF and physically non-linear visco-plastic behavior, we observed higher error values compared to the slightly textured CODF for all algorithms considered. This contrasts with the linear elastic case where we observed a smaller error for the highly textured CODF. However, using orientations generated by the TOP method leads to significantly smaller errors than using the other two algorithms. Concerning the maximum number of texture coefficients which should be taken into consideration, we observed that, for the linear elastic case, a low tolerance and only the texture coefficient of rank four a sufficient. For the non-linear behavior, we observed that accounting for the texture coefficient of rank six is beneficial.
As the computational effort of micromechanical studies is mainly dominated by computing the effective behavior we omitted a comparison of the computational performance of TOP to the other methods.
To conclude, we showed that extracting relevant data from the CODF in terms of tensorial texture coefficients leads to the most flexible and performing method for generating crystallite orientations for digital representations of polycrystalline microstructures. As orientation assignment is typically treated as a post-processing step in microstructure generation, it is possible to couple the proposed algorithm with well-established microstructure generators [21][22][23]. With this modular structure, it is possible to use TOP for generating polycrystalline representations for a variety of applications [94,95]. As an additional benefit, for generating orientations, the TOP method requires only nine (or 22 variables, depending on the highest texture coefficient rank considered) to be stored, contrasting with methods that rely on the entire experimental database. Because of this low num-ber of parameters, it is possible to fuel data driven methods [96,97]. Additionally, as experimental data is always afflicted with some degree of measurement uncertainty, investigating the influence of the texture on the overall macroscopic response might be an interesting topic, i.e., via uncertainty quantification [98,99].