2,549
Views
17
CrossRef citations to date
0
Altmetric
Part A: Materials Science

Laguerre tessellations and polycrystalline microstructures: a fast algorithm for generating grains of given volumes

ORCID Icon, , ORCID Icon &
Pages 2677-2707 | Received 13 Dec 2019, Accepted 22 Jun 2020, Published online: 24 Jul 2020

ABSTRACT

We present a fast algorithm for generating Laguerre diagrams with cells of given volumes, which can be used for creating RVEs of polycrystalline materials for computational homogenisation, or for fitting Laguerre diagrams to EBSD or XRD measurements of metals. Given a list of desired cell volumes, we solve a convex optimisation problem to find a Laguerre diagram with cells of these volumes, up to any prescribed tolerance. The algorithm is built on tools from computational geometry and optimal transport theory which, as far as we are aware, have not been applied to microstructure modelling before. We illustrate the speed and accuracy of the algorithm by generating RVEs with user-defined volume distributions with up to 20,000 grains in 3D. We can achieve volume percentage errors of less than 1% in the order of minutes on a standard desktop PC. We also give examples of polydisperse microstructures with bands, clusters and size gradients, and of fitting a Laguerre diagram to 3D EBSD measurements of an IF steel.

1. Introduction

1.1. State of the art

Voronoi diagrams and their generalisations are often used to represent the microstructure of polycrystalline metals and foams, e.g. [Citation1–14], with individual Voronoi cells representing grains in metals and pores or bubbles in foams. They can be used to generate complex microstructures quickly using a relatively small number of parameters, and they are often used as representative volume elements (RVEs) for computational homogenisation, e.g. [Citation15–17].

In this paper, we focus on the class of weighted Voronoi diagrams known as Laguerre diagrams (or power diagrams or radical Voronoi tessellations), which provide a more accurate description of the geometry of polycrystalline materials than classical Voronoi diagrams [Citation8,Citation14]. However, Laguerre diagrams share the limitation of Voronoi diagrams that there is not an explicit relation between their generators and their geometric properties, such as the volumes of their cells. Consequently, an active area of research is to develop algorithms for generating Laguerre diagrams with prescribed geometric properties.

One popular method for approximately controlling the grain size distribution of Laguerre diagrams is using random close packing of spheres and ellipsoids [Citation4,Citation8,Citation10,Citation18]. This method is inexact, however, since it is impossible to tessellate Euclidean space with spheres or ellipsoids.

Several authors have developed methods for fitting Laguerre diagrams to image data (EBSD, XRD) of polycrystals. Here, geometric properties such as grain size, centroid location, and aspect ratio are fitted by minimising a measure of the fitting error using deterministic and stochastic optimisation methods, e.g. [Citation3,Citation9,Citation11,Citation19,Citation20]. While optimisation methods can give very accurate results, they can also be computationally expensive. Heuristic methods such as [Citation13] trade-off fidelity against speed.

Recently, several authors have generated RVEs with curved boundaries and non-convex cells grains using generalisations of Laguerre diagrams such as generalised balanced power diagrams [Citation1,Citation12,Citation13,Citation21] and multilevel Voronoi diagrams [Citation5,Citation17]. Complex geometries can also be created using the open-source software DREAM.3D [Citation22] and Neper [Citation23].

We will discuss some of these methods in more detail and compare them with ours in the Discussion section.

1.2. Goal of this paper

The goal of this paper is to develop algorithms for creating Laguerre diagrams with user-defined cell size distributions. Our motivation comes from steel modelling. We wish to generate realistic RVEs of single- and multi-phase steels for computational homogenisation simulations. Unlike much of the literature on Laguerre modelling of polycrystals [Citation1,Citation12,Citation13,Citation24], our primary aim is not to fit Laguerre diagrams to EBSD or XRD data, but rather to create a tool for generating a rich family of (possibly never-observed) microstructures, which can be combined with multiscale simulations to optimise grain geometries and lead to the development of new alloys. Having said that, our algorithms are also very well suited for generating Laguerre diagrams with texture intensities that match EBSD data, as we demonstrate in Example 5.3. With these applications to steel in mind, we often refer to Laguerre cells as grains, although our results can be applied more generally to other polycrystalline metals and to foams.

1.3. Contributions and outline of the paper

In Section 2, we recall the definition and some important properties of Laguerre diagrams. In particular, Property 2.3 forms the basis of our work. Section 3 includes our main result, Algorithm 2, for generating ‘regularised’ Laguerre diagrams with grains of prescribed volumes, up to any given tolerance. We also provide Algorithm 1 that can be used for fitting a Laguerre diagram to EBSD measurements of grain volumes and centroids (Example 5.3). We discuss practical issues about how the algorithms can be implemented in Section 4. Section 5 includes some large examples (10,000+ grains) and run-time tests in 3D, including examples of RVEs of Interstitial Free (IF) steels.

The theory underlying the algorithms presented in Section 2 uses results from computational geometry and optimal transport theory [Citation25,Citation26], a field of mathematics that has recently enormously grown in importance and found applications in a wide range of areas including data science, economics, image processing, partial differential equations and statistics. We believe however that this is its first application in the steel industry.

2. Laguerre diagrams

2.1. Notation and definitions

Let ΩRd be the region occupied by a metal. We consider both the 2- and 3-dimensional cases (d=2 and d=3). For simplicity, we assume that Ω is a convex polygon if d=2 or a convex polyhedron if d=3. In principle, the algorithms below can be used for non-convex regions with curved boundaries, but they become harder to implement. In all our examples below, we take Ω to be a rectangular box. If U is a subset of Ω, let |U| denote its area if d=2 or its volume if d=3.

Definition 2.1

([Citation27], [Citation28]):

Let x1,,xn be distinct points in Ω and w1,,wn be real numbers (not necessarily positive). The Laguerre diagram or power diagram generated by the weighted points (x1,w1),,(xn,wn) is the tessellation {Li}i=1n of Ω defined by(1) Li=xΩ:|xxi|2wi|xxj|2wj  j{1,,n}.(1) We refer to the sets Li as Laguerre cells or grains.

Laguerre diagrams have the following basic properties [Citation27,Citation28]:

  • Laguerre cells are convex polygons if d=2 or convex polyhedra if d=3.

  • The Laguerre cells tessellate Ω, which means that i=1nLi=Ω and cells can only intersect along their boundaries.

  • If all the weights are equal, w1=w2==wn, then the Laguerre diagram is simply a Voronoi diagram.

  • Adding a constant to all the weights does not affect the Laguerre diagram, i.e. the weighted points {(xi,wi)}i=1n and {(xi,wi+c)}i=1n generate the same diagram for any cR.

  • A generator xi needs not belong to its Laguerre cell Li.

  • There can be empty Laguerre cells, Lj= for some j.

Now, we recall two advanced properties of Laguerre diagrams, Properties 2.2 and 2.3. These are the key ingredients for generating RVEs with grains of given sizes (given areas if d=2 or given volumes if d=3). Property 2.2 states that there always exists a Laguerre diagram with grains of given sizes. Property 2.3 gives a constructive way of finding one.

Property 2.2

([27, p. 96, Corollary 6.1], [29]):

Let x1,,xn be distinct points in Ω. Let m1,,mn be positive numbers with i=1nmi=|Ω|. Then there exist weights w1,,wn such that the Laguerre diagram {Li}i=1N generated by (x1,w1),,(xn,wn) has cells of size m1,,mn:(2) |Li|=miforall i{1,,n}.(2)

The weights wi in Property 2.2 can be computed using the following result.

Property 2.3

([27, pp. 98–100], [29], [30, Theorem 2]):

Let x1,,xn be distinct points in Ω. Let m1,,mn be positive numbers with i=1nmi=|Ω|. Define the function g: RnR by(3) g(w1,,wn)=i=1n(mi|Li|)wi+i=1nLi|xxi|2dx,(3) where {Li}i=1N is the Laguerre diagram generated by (x1,w1),,(xn,wn). Then

  1. The function g is concave.

  2. The gradient of g has components(4) gwi=mi|Li|(4) for all i{1,,n}.

  3. If w=(w1,,wn) is a critical point of g, i.e. if g(w)=0, then the Laguerre diagram {Li}i=1N generated by (x1,w1),,(xn,wn) has cells of size m1,,mn:(5) |Li|=mifor all i{1,,n}.(5)

Property 2.3 forms the basis of Algorithms 1 and 2. It means that if we want to generate a Laguerre diagram with grains of given sizes, then we just need to find critical points of g. Since g is concave, this is equivalent to maximising g, or to minimising g, which is a smooth, unconstrained, convex optimisation problem. Fast numerical methods are available for solving this [Citation31].

2.2. Controlling the spatial distribution of grains

Property 2.3 not only allows one to control the size distribution of grains, it also gives some control over the spatial distribution. Given positive numbers m1,,mn with i=1nmi=|Ω|, there are infinitely many Laguerre diagrams {Li}i=1n such that |Li|=mi for all i{1,,n}. This can be seen from Property 2.3(iii); any choice of distinct points x1,,xn can give a Laguerre diagram with grains of size m1,,mn. In Section 4.3.1, we will show how to choose x1,,xn to control the spatial distribution of the grains.

2.3. Connection with optimal transport theory

Properties 2.2 and 2.3 can also be stated in the language of semi-discrete optimal transport theoryFootnote1; see, e.g. [Citation26, Sec. 6.4.2], [Citation30], [Citation32]. This connection provides a way of finding critical points of g using fast modern methods from optimal transport theory [Citation32,Citation33]. We discuss this connection further at the end of Section 3.2.3.

3. Main results

3.1. Statement of the algorithms

For concreteness we state the algorithms in three dimensions, but they can also be used in two dimensions (by substituting volume with area and polyhedron with polygon wherever they appear in Algorithms 1 and 2). Our main result is Algorithm 2. First, however, we consider a simplified version, Algorithm 1, which will help us to understand the importance of the regularisation step in Algorithm 2. Algorithm 1 can also be used for data-driven modelling to fit a Laguerre diagram to EBSD or XRD measurements of grain volumes and centroids (see Example 5.3). Algorithm 1 is not new and goes back at least as far as [Citation29]. Our role is simply to bring it to the attention of the microstructure modelling community.

Algorithm 1: Generate a Laguerre diagram with grains of given volumes.

Input: A convex polyhedron Ω representing a sample of metal, a list of volumes m1,,mn such that mi>0 and i=1nmi=|Ω|, and a relative error tolerance ε.

Output: The generators (x1,w1),,(xn,wn) of a Laguerre diagram {Li}i=1n such that grain Li has volume mi up to ε relative error, i.e. Li|mi|mi<ε, for all i{1,,n}.

Method:

Initialisation. Choose or randomly select n distinct points x1,,xn in Ω.

Optimisation step. Use a numerical optimisation method to find w=(w1,,wn) that maximises the function g defined in equation (Equation3). Initialise the optimisation method using the initial guess winit=0 and terminate it using the stopping criterion |g(w)|<εminjmj.

Example 3.1

(Example of Algorithm 1):

shows an example of Algorithm 1 implemented in MATLAB with n=50 grains in the square domain Ω=[0,1]×[0,1]. The grains have target areas mi=x for i{1,,35} and mi=10x for i{36,,50}, where x=1/185 so that the total area of all the grains equals the area of Ω. The actual areas of the grains returned by Algorithm 1 are correct to within 1% error (ε=0.01). The initialisation step of Algorithm 1 was performed using the MATLAB function rand to select x1,,x50 (pseudo)randomly from a uniform distribution. While the grains have the correct areas to within 1%, the microstructure is somewhat irregular and unrealistic, with some highly elongated grains. This leads us to Algorithm 2, which produces more regular microstructures; compare and (i).

Algorithm 2: Generate a regularised Laguerre diagram with grains of given volumes.

Input: A convex polyhedron Ω representing a sample of metal, a list of volumes m1,,mn such that mi>0 and i=1nmi=|Ω|, a relative error tolerance ε, and the number of regularisation steps K.

Figure 1. An example of Algorithm 1 with n=50 grains in the unit square Ω. There are 35 small grains and 15 large grains. The small grains have area x and the large grains have area 10x to within 1% error, where x=1/185. The black dots are the locations of the generators {xi}i=150. Notice that not every grain contains its own generator.

Figure 1. An example of Algorithm 1 with n=50 grains in the unit square Ω. There are 35 small grains and 15 large grains. The small grains have area x and the large grains have area 10x to within 1% error, where x=1/185. The black dots are the locations of the generators {xi}i=150. Notice that not every grain contains its own generator.

Output: The generators (x1,w1),,(xn,wn) of a regularised Laguerre diagram {Li}i=1n such that grain Li has volume mi up to ε relative error, i.e. Li|mi|mi<ε, for all i{1,,n}.

Method:

Initialisation. Choose or randomly select n distinct points x1(0),,xn(0) in Ω. Initialise the weights to be zero: w(0)=(w1(0),,wn(0))=0.

Iteration. For k=1,,K do:

  • (1) Regularisation step. For i{1,,n}, define xi(k) to be the centroid of Li(k1): (6) xi(k):=1|Li(k1)|Li(k1)xdx,(6) where {Li(k1)}i=1n is the Laguerre diagram obtained in the previous iteration, which is generated by (x1(k1),w1(k1)),,(xn(k1),wn(k1)).

  • (2) Optimisation step. Use a numerical optimisation method to find w(k)=(w1(k),,wn(k)) that maximises the concave function(7) gk(w1,,wn)=i=1n(mi|Li|)wi+i=1nLi|xxi(k)|2dx,(7) where {Li}i=1n is the Laguerre diagram generated by (x1(k),w1),,(xn(k),wn). Initialise the optimisation method using the initial guess winit=w(k1) and terminate it using the stopping criterion |gk(w(k))|<εminjmj.

Return. Output the generators {(xi,wi)}i=1n={(xi(K),wi(K))}i=1n.

Figure 2. An example of K=100 iterations of Algorithm 2 with n=50 grains in the unit square Ω. There are 35 small grains and 15 large grains. The small grains have area x and the large grains have area 10x to within 1% error, where x=1/185. The black dots are the locations of the generators {xi}i=150. In figure (i), the generators xi are located at the centroids of their cells Li to within a distance of 0.002. (a) Iteration k=1. (b) Iteration k=2. (c) Iteration k=3. (d) Iteration k=4. (e) Iteration k=5. (f) Iteration k=10. (g) Iteration k=25. (h) Iteration k=50. (i) Iteration k=100.

Figure 2. An example of K=100 iterations of Algorithm 2 with n=50 grains in the unit square Ω. There are 35 small grains and 15 large grains. The small grains have area x and the large grains have area 10x to within 1% error, where x=1/185. The black dots are the locations of the generators {xi}i=150. In figure (i), the generators xi are located at the centroids of their cells Li to within a distance of 0.002. (a) Iteration k=1. (b) Iteration k=2. (c) Iteration k=3. (d) Iteration k=4. (e) Iteration k=5. (f) Iteration k=10. (g) Iteration k=25. (h) Iteration k=50. (i) Iteration k=100.

Example 3.2

(Example of Algorithm 2):

shows an example of Algorithm 2, using K=100 iterations, implemented in MATLAB with n=50 grains in the square domain Ω=[0,1]×[0,1]. The grains have target areas mi=x for i{1,,35} and mi=10x for i{36,,50}, where x=1/185 so that the total area of all the grains equals the area of Ω. The actual areas of the grains returned by Algorithm 2 are correct to within 1% error (ε=0.01). For the initialisation step we used exactly the same points x1(0),,xn(0) that were used for the initialisation step in Example 3.1. Observe from how the Laguerre diagram becomes more regular as the number of iterations k increases, and how it appears to be converging. The diagram already looks quite regular after just 4 or 5 iterations and the user may be happy to take far fewer than K=100 iterations. We discuss how to choose K in the following section.

3.1.1. Periodic Laguerre diagrams

Algorithms 1 and 2 can be modified to create periodic Laguerre diagrams for use as RVEs for computational homogenisation (RVEs are usually taken to be periodic to avoid artificial boundary effects). To create periodic diagrams in a rectangular box Ω of side lengths l1,l2,l3, modify Algorithms 1 and 2 as follows. Define the periodic distance between x,yΩ by(8) |xy|per=min{|xy+(il1,jl2,kl3)|:i,j,kZ}.(8) In Algorithms 1 and 2 replace the Laguerre cells Li by periodic Laguerre cells L~i, which are defined by(9) L~i=xΩ:|xxi|per2wi|xxj|per2wj  j{1,,n}.(9) In Algorithm 2 replace g by(10) gper(w1,,wn)=i=1n(mi|L~i|)wi+i=1nL~i|xxi|per2dx.(10) Replace gk in Algorithm 2 is an analogous way.

3.2. Properties of the algorithms

3.2.1. Convergence of algorithm 2: centroidal Laguerre diagrams

In the appendix we prove that, under a generic assumption, Algorithm 2 converges as K. This means that the generator locations xi(k) settle down with increasing iterations, like we see in . To be more precise, there exist x1,,xn such that limkxi(k)=xi for all i{1,,n}. By taking the limit k in equation (Equation6), we see that(11) xi=1|Li|Lixdx.(11) Therefore, the generator xi is the centroid of its own Laguerre cell Li for all i. Such a Laguerre diagram is known as a centroidal Laguerre diagram or a centroidal power diagram, a term introduced in [Citation34]; see also [Citation35,Citation36]. Centroidal Laguerre diagrams tend to be more regular than non-centroidal Laguerre diagrams, as illustrated by (i) (centroidal) and (non-centroidal).

3.2.2. Connection with Lloyd's algorithm

If we omit the optimisation step in Algorithm 2 and set the weights to be zero for all iterations, w(k)=0 for all k, then we obtain the well-known Lloyd's algorithm for computing centroidal Voronoi tessellations (Voronoi diagrams where each generator is the centroid of its own Voronoi cell) [Citation37]. Therefore, Algorithm 2 can be interpreted as a generalised Lloyd algorithm with capacity constraints where cell Li is constrained to have volume mi. An alternative method for generating centroidal Laguerre diagrams with capacity constraints is given in [Citation36, Section 4].

3.2.3. Energy-decreasing property of Algorithm 2

Algorithm 2 can also be interpreted as an energy-decreasing optimisation method. Given m1,,mn with imi=|Ω|, define(12) E(x1,,xn)=mini=1nUi|xxi|2dx:{Ui}i=1nisapartitionof|Ω|,|Ui|=mi.(12) Here, the minimum is taken over all possible partitions of Ω, not just Laguerre diagrams. This is an example of an optimal transport problem. For example, in two dimensions E could represent the minimum (squared) cost of transporting the recyclable waste generated by a population uniformly distributed over a country Ω to recycling centres located at {xi}i=1n with capacities {mi}i=1n. It can be shown [Citation27, Section 6.4.1] that(13) E(x1,,xn)=i=1nLi|xxi|2dx,(13) where {Li}i=1n is the Laguerre diagram with generators {(xi,wi)}i=1n, where (w1,,wn) is a maximum point of g (defined in (Equation3)). In other words, {Li}i=1n is the solution of the optimal transport problem and all the recyclable waste generated in region Li should be sent to the recycling centre xi.

We could further ask what are the best locations of the recycling centres by considering the optimisation problem(14) minx1,,xnE(x1,,xn).(14) This is known as the optimal location problem in the economics literature [Citation38] and the quantisation problem in the discrete geometry [Citation39], electrical engineering [Citation40] and probability literature [Citation41]. It can be shown that(15) Exi(x1,,xn)=2Li(xix)dx.(15) See, for example, [Citation36]. Therefore, E(x1,,xn)=0 if and only if {xi}i=1n generate a centroidal Laguerre diagram.

Thanks to its regularisation step, Algorithm 2 is energy-decreasing in the sense that(16) E(x1(k+1),,xn(k+1))E(x1(k),,xn(k)).(16) Moreover, under the generic assumption (EquationA5), the sequence (x1(k),,xn(k)) converges to a critical point of E (to a local minimum point or saddle point). In other words, it converges to a centroidal Laguerre diagram. We prove these statements in the appendix. In general, Algorithm 2 does not converge to a global minimum point of E since E is highly non-convex with many critical points; illustrates four different (approximate) critical points of E, corresponding to different choices of (x1(0),,xn(0)).

An alternative method for finding local minima of E is given in [Citation36, Section 4] where, instead of updating xi(k) using our regularisation step, they update it using a quasi-Newton (L-BFGS) optimisation step applied to E.

4. Implementation

In this section, we discuss different options for implementing Algorithms 1 and 2, which we did using MATLAB and Voro++ [Citation42].

4.1. Computing Laguerre diagrams

One of the main expenses of Algorithms 1 and 2 is the computation of Laguerre diagrams. This happens whenever the objective function g or gk is evaluated, which could happen many times within a single optimisation step. A Laguerre diagram of n generators can be computed in O(nlogn) flops in 2D and O(n2) flops in 3D [Citation27, p. 85]. (Note that these are worst-case optimal run times and in practice the complexity may be better, as we observed in Example 5.1. For example, the complexity can be better if each cell has only O(n) faces instead of the worst-case O(n2) [Citation27, Theorem 6.1].) In applications n could be 10,000 or more, and hundreds or thousands of Laguerre diagrams could be computed in a single run of either algorithm. Therefore, it is important to use efficient software.

For our 2D computations we used the MATLAB function power_bounded from the MATLAB File Exchange [Citation43], which implements Aurenhammer's lifting method [Citation44] and crops the diagram to a rectangular box Ω.

The function power_bounded is limited to 2D, and so for our 3D computations we used (a slightly modified version of) the C++ library Voro++ [Citation42] combined with a MEX file so that we could run Voro++ via MATLAB. In 3D, we also tried the MATLAB function powerDiagramWrapper from the MATLAB File Exchange [Citation45], combined with our own code to crop the diagram to a cuboid Ω, but we found Voro++ to be faster. Another advantage of Voro++ is that it can create periodic Laguerre diagrams.

We also used Tata Steel's own in-house Laguerre diagram code to visualise Laguerre diagrams in 2D and 3D.

4.2. Optimisation methods

The other main expense of Algorithms 1 and 2 is the optimisation step. For each algorithm this is a smooth, unconstrained, concave maximisation problem and so is very tractable. We used the MATLAB function fminunc to minimise g and gk (and hence maximise g and gk), which uses the BFGS quasi-Newton method by default [Citation31]. This requires an initial guess winit for the minimum point.

4.2.1. Choice of the initial guess

For Algorithm 1, we recommend the initial guess winit=0. For data fitting (like Example 5.3, where the seeds xi are taken from EBSD measurements), if the target grains are relatively spherical, then a better choice may be (winit)i=mi/π in 2D or (winit)i=(3mi/(4π))2/3 in 3D. In other words, (winit)i=ri2 where ri is the radius of a ball of area mi in 2D or volume mi in 3D. This is motivated by sphere-packing methods [Citation4,Citation8,Citation10,Citation18].

For Algorithm 2, the initial guess should depend on the iteration k. For the first iteration k=1, we recommend winit=0. For iterations k2, we recommend winit=w(k1), the solution of the optimisation step from the previous iteration. As the number of iterations increases and the points xi(k) converge, the initial guess winit=w(k1) becomes better and better and consequently the optimisation step becomes quicker and quicker. This is illustrated in , which shows the relative run time of each iteration for an example in which the relative sizes and relative proportions of small and large grains are the same as in Example 3.2 but the number of grains is n=500. We see that the total runtime of the algorithm is not proportional to the number of iterations K; most of the expense is in the first few iterations.

Figure 3. The relative run times for each optimisation step of Algorithm 2. In this example, the parameters are the same as those in Example 3.2, except that the number of grains is n=500. The relative proportion of small and large grains is the same as in Example 3.2 and the ratio of the size of the largest grain to the size of the smallest grain is 10. The initial seed locations are randomly distributed in the unit square. The y-axis displays tk/t1, where tk is the run time for the optimisation step of iteration k. After 12 iterations the time per iteration falls to below one-tenth the time of the first iteration, and after 18 iterations it falls to below one-twentieth. This is because the initial guess for the weights in the inner iteration is taken from the output of the previous outer iteration, and the quality of this guess improves as the number of iterations increases.

Figure 3. The relative run times for each optimisation step of Algorithm 2. In this example, the parameters are the same as those in Example 3.2, except that the number of grains is n=500. The relative proportion of small and large grains is the same as in Example 3.2 and the ratio of the size of the largest grain to the size of the smallest grain is 10. The initial seed locations are randomly distributed in the unit square. The y-axis displays tk/t1, where tk is the run time for the optimisation step of iteration k. After 12 iterations the time per iteration falls to below one-tenth the time of the first iteration, and after 18 iterations it falls to below one-twentieth. This is because the initial guess for the weights in the inner iteration is taken from the output of the previous outer iteration, and the quality of this guess improves as the number of iterations increases.

Note that for the first iteration, k=1, the initial guess winit=0 does not incorporate any information about the locations xi(0). It is possible to improve the speed of the first iteration by using a more sophisticated choice of winit, e.g. using the multilevel methods of Mérigot [Citation30] and Lévy [Citation32], which generate a good initial guess winit by solving a sequence of smaller optimisation problems with fewer grains. (For example, you can obtain a good initial guess winit for n grains by first solving a coarser problem with n/2 grains; you can obtain a good initial guess for n/2 grains by first solving a coarser problem with n/4 grains, etc.) We found that Mérigot's multilevel method [Citation30] in 2D could halve the run time of iteration k=1 when there are n=10,000 grains. It is reported that Lévy's multilevel program GEOGRAM can handle one million grains in 3D [Citation32, Table 4].

It is also possible to obtain a better initial guess winit for iterations k2 as follows. The Lloyd step (Equation6) of Algorithm 2 could be replaced with a damped Lloyd step of the form(17) xi(k):=(1λ)xi(k1)+λ1|Li(k1)|Li(k1)xdx,(17) where λ is a damping parameter between 0 and 1. The choice λ=1 corresponds to the Lloyd step (Equation6). The closer λ is to 0, the closer xi(k) is to xi(k1), and so the better the associated initial guess winit=w(k1). Therefore, the optimisation step is faster for smaller λ. On the other hand, the regularisation step has less effect for smaller λ, and it is necessary to increase the number of iterations K to achieve the same amount of regularisation. For our purposes, the full Lloyd step λ=1 was sufficiently fast and so we did not try to optimise the choice of λ.

4.2.2. Choice of the tolerance

For simplicity, we chose the tolerance ε of the optimisation step of Algorithm 2 to be fixed at each iteration k (recall that the optimisation step terminates when |gk(w(k))|<εminjmj). The algorithm could be sped up, however, by taking ε=εk to depend on k. In order for Algorithm 2 to produce a Laguerre diagram with grains of given volumes up to a relative error of ε, we only need the tolerance to be ε at the final iteration, εK=ε. For previous iterations, we could use a cruder tolerance: ε=εK<εK1<<ε2<ε1. It is tempting to think that the larger the tolerance, the faster the optimisation step. On the other hand, if εk1 is larger than εk, then the initial guess winit=w(k1) at iteration k may be worse, and the optimisation step at iteration k may be slower. So the tolerances εk must be chosen carefully. The choice of fixed tolerance εk=ε for all k is a simple, reliable option, which is why we used it.

4.2.3. Choice of the optimisation algorithm

The speed of the optimisation step depends of course not only on the choice of the initial guess winit and the tolerance ε, but also on the choice of the optimisation algorithm. For example, instead of using a quasi-Newton method as we did, one could use Newton's method. Newton's method tends to converge faster than quasi-Newton methods (quadratically rather than superlinearly), although it is harder to implement since it requires the second derivative of g (whereas quasi-Newton methods only require the first derivative) [Citation31].

It can be shown (see, e.g. [Citation35]) that(18) 2gwiwj=|Li|wj=kNiaik2|xixk|ifi=j,aij2|xixj|ifjNi,0otherwise,(18) where aij is the area of the face between cell i and cell j and Ni is the index set of the neighbours of cell i (that is jNi if and only if cell j and cell i share a face). The pseudo-inverse of this Hessian matrix is used in a damped Newton method in [Citation33, Algorithm 1], where fractions of a full Newton step are used in order to control the error reduction and the minimum volume of a cell (to stop cells disappearing). The authors prove that their damped Newton method converges globally with order 1 and locally with order 2 [Citation33, Theorem 1.5].

4.3. Initialisation: effect on the spatial distribution

In this section, we discuss the initialisation step of Algorithms 1 and 2.

4.3.1. Initialisation of the seeds

The locations of the generators x1,,xn at the termination of Algorithm 2 are a strong function of the initial choice x1(0),,xn(0). This simple observation gives us a great deal of control over the spatial distribution of the different sized grains. Examples of Algorithm 2 with different initial distributions of the generators x1(0),,xn(0) are shown in . In these examples, Ω=[0,3]×[0,2] and there are n=1000 grains. There are n1=800 grains of size x and n2=200 grains of size 20x. The tolerance is ε=0.01 and the number of iterations of Algorithm 2 is K=20. The figure shows the output of Algorithm 2. The final spatial distribution of grains has some features in common with the spatial distribution of the initial generator locations.

Figure 4. Examples of more advanced microstructures: Coupling of size and spatial distributions with Algorithm 2. This figure shows the output of Algorithm 2 after K=20 iterations with different initial distributions for the seed locations. In all cases there are n=1000 grains with n1=800 grains of size x and n2=200 grains of size 20x . (a) Random distribution of initial locations. Here the initial generator locations of the large and small grains are uniformly distributed over Ω. (b) Banded distribution of initial locations. Here, the different sized grains have initial generator locations that lie inside bands within Ω. The sizes of the bands have been chosen so that there are approximately equal numbers of small grains within each small-grain band and approximately equal numbers of large grains within each large-grain band. (c) Clustered distribution of initial locations. Here, the smaller grains have initial generator locations that lie inside non-overlapping discs. (d) A mixed distribution: the initial generators are such that the larger grains are arranged in bands and the smaller grains are a combination of the banded and random distributions.

Figure 4. Examples of more advanced microstructures: Coupling of size and spatial distributions with Algorithm 2. This figure shows the output of Algorithm 2 after K=20 iterations with different initial distributions for the seed locations. In all cases there are n=1000 grains with n1=800 grains of size x and n2=200 grains of size 20x . (a) Random distribution of initial locations. Here the initial generator locations of the large and small grains are uniformly distributed over Ω. (b) Banded distribution of initial locations. Here, the different sized grains have initial generator locations that lie inside bands within Ω. The sizes of the bands have been chosen so that there are approximately equal numbers of small grains within each small-grain band and approximately equal numbers of large grains within each large-grain band. (c) Clustered distribution of initial locations. Here, the smaller grains have initial generator locations that lie inside non-overlapping discs. (d) A mixed distribution: the initial generators are such that the larger grains are arranged in bands and the smaller grains are a combination of the banded and random distributions.

A further example of controlling the spatial distribution of grains can be seen in . In this example, n=1000 grains have areas drawn from a random distribution such that the ratio of the largest to the smallest grain size is at most 100. The Laguerre diagram in (a) has the property that the grain sizes tend to increase from left to right. A variety of spatial distributions of grain sizes can be simulated by first distributing the seed locations appropriately. (b) shows how a more complicated distribution can be produced.

Figure 5. Experiments to demonstrate a gradient in the distribution of grain sizes. Here, n=1000 grains have areas drawn from a uniform distribution such that the ratio of the largest to the smallest grain size is at most 100. The domain is Ω=[0,3]×[0,2]. The results are shown after K=20 iterations and the grains are coloured according to their area. (a) The initial seed locations x1(0),,xn(0) are distributed such that the x-coordinate increases with grain size. (b) The initial seed locations are distributed such that the larger grains are found in the middle of Ω.

Figure 5. Experiments to demonstrate a gradient in the distribution of grain sizes. Here, n=1000 grains have areas drawn from a uniform distribution such that the ratio of the largest to the smallest grain size is at most 100. The domain is Ω=[0,3]×[0,2]. The results are shown after K=20 iterations and the grains are coloured according to their area. (a) The initial seed locations x1(0),…,xn(0) are distributed such that the x-coordinate increases with grain size. (b) The initial seed locations are distributed such that the larger grains are found in the middle of Ω.

4.3.2. Initialisation of the weights

The choice of w(0) in the initialisation step of Algorithm 2 is also important. One should choose w1(0),,wn(0) so that the Laguerre diagram generated by (x1(0),w1(0)),,(xn(0),wn(0)) has no empty Laguerre cells. If there are empty cells then the regularisation step is not defined (there is division by zero in equation (Equation6) if Li(0) is empty). A good choice is w(0)=0 since then the Laguerre diagram generated by (x1(0),w1(0)),,(xn(0),wn(0)) is a Voronoi diagram and so has no empty cells, whatever the choice of x1(0),,xn(0).

4.4. Stopping criteria

In Algorithm 2, the user must specify the number of regularisation steps K. As we discussed in Section 3.1, for large values of K the Laguerre diagram resulting from Algorithm 2 is approximately a centroidal Laguerre diagram, which means that each seed xi(K) is approximately the centre of mass of its Laguerre cell Li(K). Centroidal Laguerre diagrams tend to have very regular-shaped cells, e.g. in 2D if the grains all have the same target areas, mi=1/n, and if n and K are large, then the Laguerre diagram looks locally like a regular hexagonal tiling. Indeed for steel microstructures, we found that if K is too large, then Algorithm 2 tends to produce grains that are too ‘round’ compared to EBSD measurements of grain aspect ratios.

Instead of fixing the number of steps K in advance, the user could terminate the algorithm whenever some measure of the maximum grain aspect ratio falls below a critical threshold. For example, the aspect ratio of grain can be measured using the ratio of its largest and smallest principal moments of inertia, or using the ratio of the radii of circumscribed and inscribed balls, or using its sphericity [Citation46], which is the ratio of the surface area of the volume-equivalent sphere to the surface area of the grain.

The user may also want to terminate the algorithm if the distance |xi(k)xi(k1)| moved by the seeds from one iteration to the next falls below some threshold. The Laguerre diagram {Li(k)} tends to evolve slowly with k when k is large, as illustrated in , and the evolution can slow down dramatically when there is a T1 topological transition (to borrow a term from foam dynamics). This topological transition involves a change of cell neighbour relations; in 2D this is via coalescence of two triple junctions of cell boundaries. So, in general, there is little to be gained from performing a large number of regularisation steps, especially since our aim is not to produce a centroidal Laguerre diagram, but rather to produce a physically realistic microstructure. (If on the other hand, the user's aim is to produce centroidal Laguerre diagrams, then it would be better to use the quasi-Newton method of [Citation36], which converges superlinearly as opposed to the linear convergence of Lloyd's algorithm.)

5. Examples

This section includes some large examples in 3D to illustrate the capabilities of our algorithms.

Example 5.1

(Run time tests):

gives some run times of Algorithm 2 for creating monodisperse and polydisperse periodic Laguerre diagrams in 3D. Here Algorithm 2 has been used to create n/2 grains of volume x and n/2 grains of volume rx, for r=1 and r=5, in a cube of side length 100 with error tolerance ε=0.01. We see that the run time grows roughly quadratically in the range n=2000 to n=5000, for both the monodisperse (single phase) case r=1 and the polydisperse (dual phase) case r=5. This could be expected since the cost of each iteration of the BFGS method used by fminunc is O(n2) (a matrix-vector multiplication). Also the worst-case optimal time it takes to compute a Laguerre diagram of n cells is O(n2) in 3D, although we found that in these examples the cost of computing the Laguerre diagrams was sub-quadratic (but super-linear); see also the discussion in Section 4.1. For n>5000, the run time grows a little faster than O(n2). Observe also from that it is about 50% more expensive to compute dual phase RVEs (r=5) than single phase RVEs (r=1).

Figure 6. Run times in seconds of Algorithm 2 for creating monodisperse (single phase) and polydisperse (dual phase) periodic RVEs in 3D. There are n/2 grains of volume x and n/2 grains of volume rx in a cube of side length 100 with at most 1% error (ε=0.01) in the volumes of the grains (r=1 corresponds to a single phase material, r=5 corresponds to a dual phase material, x is chosen such that the total volume of the grains equals the volume of the box). We used K=5 regularisation steps, and the initial seed locations x1(0),,xn(0) were chosen randomly from a uniform distribution. The simulations were performed on an Intel Xeon E5-1620V3 (3.5 GHz, 4 cores, 8 threads). The graph on the right has a log–log scale. The black dotted line is the graph of the function cn2, where c is a constant. It is included to illustrate how the run times grow with n.

Figure 6. Run times in seconds of Algorithm 2 for creating monodisperse (single phase) and polydisperse (dual phase) periodic RVEs in 3D. There are n/2 grains of volume x and n/2 grains of volume rx in a cube of side length 100 with at most 1% error (ε=0.01) in the volumes of the grains (r=1 corresponds to a single phase material, r=5 corresponds to a dual phase material, x is chosen such that the total volume of the grains equals the volume of the box). We used K=5 regularisation steps, and the initial seed locations x1(0),…,xn(0) were chosen randomly from a uniform distribution. The simulations were performed on an Intel Xeon E5-1620V3 (3.5 GHz, 4 cores, 8 threads). The graph on the right has a log–log scale. The black dotted line is the graph of the function cn2, where c is a constant. It is included to illustrate how the run times grow with n.

Example 5.2

(Generating a periodic RVE of an IF steel):

shows an example of a periodic Laguerre diagram created using Algorithm 2. The target volumes mi are taken from a 3D EBSD measurement of an IF (interstitial free) steel (EN 10130 grade DC06). There are n=9211 grains in a box of dimensions 670μm×80μm×480μm. We took the initial seed locations x1(0),,xn(0) to be the centres of mass of the grains from the EBSD data, and performed K=10 regularisation steps with a tolerance of 0.5% (ε=0.005). The grains in are coloured according to their lattice orientations by mapping the three Euler angles linearly to RGB values. The orientations were taken from the EBSD data. shows that the volumes of all the grains are correct to within 0.5%, and most volumes are correct to within 0.05%.

Figure 7. A periodic RVE of an IF steel with n=9211 grains, generated using Algorithm 2 (see Example 5.2). The grains are coloured according to their lattice orientations.

Figure 7. A periodic RVE of an IF steel with n=9211 grains, generated using Algorithm 2 (see Example 5.2). The grains are coloured according to their lattice orientations.

Figure 8. The complementary cumulative number distribution of the percentage error of the volumes of the grains for Example 5.2. For a percentage error x, we plot the number of grains that have a volume percentage error at least x. Most of the grain volumes have percentage error less than 0.05%, which is an order of magnitude below the tolerance of 0.5% (ε=0.005). In this example, the maximum percentage error is 0.30%.

Figure 8. The complementary cumulative number distribution of the percentage error of the volumes of the grains for Example 5.2. For a percentage error x, we plot the number of grains that have a volume percentage error at least x. Most of the grain volumes have percentage error less than 0.05%, which is an order of magnitude below the tolerance of 0.5% (ε=0.005). In this example, the maximum percentage error is 0.30%.

Example 5.3

(Fitting a Laguerre diagram to EBSD measurements):

The main aim of this paper is to create Laguerre diagrams with given volume distributions for use in computational homogenisation simulations. We briefly mention, however, how Algorithm 1 can be used to fit a Laguerre diagram to EBSD data of grain volumes and centroids. is an example of a non-periodic Laguerre diagram fitted to a 3D EBSD measurement of an IF steel (EN 10130 grade DC06) with n=9211 grains in a box of dimensions 670μm×80μm×480μm (this is the same EBSD data used in the previous example). In the initialisation step of Algorithm 1, we took x1,,xn to be the centroids of the grains from the EBSD data. The target volumes mi were also taken from the EBSD data. We used a tolerance of 1% (ε=0.01). As in the previous example, the grains in are coloured according to their lattice orientation. Observe that is less regular than , which is because Algorithm 1 is missing the regularisation steps of Algorithm 2. shows that the volumes of all the grains are correct to within 0.56%, and most volumes are correct to within 0.1%. shows the complementary cumulative number distribution of the relative errors of the centroids. The relative error for grain i is defined by(19) |xici|ri,(19) where xi is the centroid of grain i from the EBSD data, ci is the centroid of the Laguerre cell Li, and ri is the radius of a sphere of volume mi, where mi is the target volume of grain i. This definition of relative error was proposed by [Citation9]. As expected, the centroid errors are higher than the volume errors since Algorithm 1 does not directly try to fit the centroids. To be precise, the optimisation step of Algorithm 1 only minimises the fitting error of the volumes; the centroid fitting error is not minimised (the centroids do not appear in the objective function g). However, the centroid measurements are used in the initialisation step of Algorithm 1. The relative error of 79% of the grain centroids is less than 1 and the relative error of 93% of the grain centroids is less than 2.The run time for this example was 376 s on an Intel Xeon E5-1620V3 (3.5 GHz, 4 cores, 8 threads) with the initial guess (winit)i=(3mi/(4π))2/3, which was inspired by sphere-packing methods [Citation4,Citation8,Citation10,Citation18].

Figure 9. A non-periodic Laguerre diagram fitted to 3D EBSD data of an IF steel using Algorithm 1 (see Example 5.3). The grains are coloured according to their lattice orientations. The volume distribution has a fitting error of less than 1%. The texture intensity inherits the same fitting error.

Figure 9. A non-periodic Laguerre diagram fitted to 3D EBSD data of an IF steel using Algorithm 1 (see Example 5.3). The grains are coloured according to their lattice orientations. The volume distribution has a fitting error of less than 1%. The texture intensity inherits the same fitting error.

Figure 10. The complementary cumulative number distribution of the percentage error of the volumes of the grains for Example 5.3. For a percentage error x, we plot the number of grains with volume percentage error at least x. The largest percentage error is 0.56% and the second largest is 0.43%. All the other percentage errors are below 0.34%.

Figure 10. The complementary cumulative number distribution of the percentage error of the volumes of the grains for Example 5.3. For a percentage error x, we plot the number of grains with volume percentage error at least x. The largest percentage error is 0.56% and the second largest is 0.43%. All the other percentage errors are below 0.34%.

Figure 11. The complementary cumulative number distribution of the relative error of the centroids of the grains for Example 5.3. For a relative error x, we plot the number of grains with centroid relative error at least x. The maximum relative error is 11.16%, which is worse than the result given in [Citation9, Figure 9], although for most of the grains the relative errors are comparable: 7278 of the 9211 grains have a relative error less than 1, and 8596 of the 9211 grains have a relative error less than 2.

Figure 11. The complementary cumulative number distribution of the relative error of the centroids of the grains for Example 5.3. For a relative error x, we plot the number of grains with centroid relative error at least x. The maximum relative error is 11.16%, which is worse than the result given in [Citation9, Figure 9], although for most of the grains the relative errors are comparable: 7278 of the 9211 grains have a relative error less than 1, and 8596 of the 9211 grains have a relative error less than 2.

Example 5.4

(Generating a dual phase RVE with a banded microstructure):

shows an example of a periodic, dual phase Laguerre diagram with a band of small grains in the centre, generated using Algorithm 2. There are n=10,000 grains: 8000 grains of volume x and 2000 grains of volume 20x (where x was chosen so that the total volume of the grains equals the volume of the box). We used K=20 regularisation steps and a volume tolerance of 1%. The grains are coloured according to their volume. In order to obtain the banded structure, we placed the initial seeds x1(0),,xn(0) at random within bands of the correct volume. We see from that these bands were largely preserved by the regularisation steps.

Figure 12. A periodic RVE of a dual phase material with a banded microstructure (see Example 5.4).

Figure 12. A periodic RVE of a dual phase material with a banded microstructure (see Example 5.4).

Example 5.5

(Generating an RVE with a log-normal distribution of grain volumes):

shows an example of a periodic Laguerre diagram generated by Algorithm 2, in which the grains have volumes that are log-normally distributed. There are n=10,000 grains. We used K=5 regularisation steps and a volume tolerance of 1%. The grains are coloured by their volume, using a log scale. We placed the initial seeds x1(0),,xn(0) at random. The target volumes were generated by drawing 10,000 samples ri from a log-normal distribution with mean 1 and standard derivation 0.35 (these correspond to the log-normal parameters σ=(log(1+0.352))1/2=0.34 and μ=σ2/2). The target volumes were defined by(20) mi=ri3L1L2L3j=1nrj3,(20) where the Li are the side-lengths of the domain Ω=[0,L1]×[0,L2]×[0,L3]. For large n these target volumes are approximately log-normally distributed with coefficient of variation (the ratio of standard variation to mean) of(21) 13exp9σ21.(21) The algorithm took 669 s using the same machine as above. Observe from Example 5.1 that Algorithm 2 took only 147 s to produce a monodisperse RVE and 207 s to produce a dual phase RVE with the same number of grains (n=10,000) and the same number of regularisation steps (K=5). Therefore, the run time of Algorithm 2 increases as the RVE becomes more polydisperse.

Figure 13. An RVE in which the grain volumes have approximately log-normal distribution (see Example 5.5). There are n=10,000 grains in the cubic cell. The coefficient of variation of the volumes (the ratio of the standard deviation to the mean) is 1.4. Cross-sections of the cell are also shown, showing the distribution of sizes throughout the cell.

Figure 13. An RVE in which the grain volumes have approximately log-normal distribution (see Example 5.5). There are n=10,000 grains in the cubic cell. The coefficient of variation of the volumes (the ratio of the standard deviation to the mean) is 1.4. Cross-sections of the cell are also shown, showing the distribution of sizes throughout the cell.

6. Discussion

The advantages of our method are

  • it is fast;

  • it can create Laguerre diagrams with grains of exact volumes, in principle of any desired tolerance up to machine precision;

  • it gives some control over the spatial distribution of the grains;

  • it can create periodic and non-periodic Laguerre diagrams.

The disadvantages of our method are

  • it provides no direct control over the centroids of the grains or their morphology, e.g. their aspect ratio;

  • it is currently limited to Laguerre diagrams and so the grains cannot have curved boundaries or be non-convex.

We now discuss these advantages and disadvantages in more detail, give evidence in support of our claims, and compare our method with others in the literature.

6.1. Controlling grain volumes: speed and accuracy

shows that we can create Laguerre diagrams in 3D with up to 20,000 grains in around 10 min on a standard desktop PC (without using parallel computation), where the volumes of the grains are correct to within 1%. For 10,000 grains, we require as little as 2.5 min (see ), although the time depends on the regularity of the microstructure and whether the material is monodisperse or polydisperse; in Example 5.3 it took 6.25 min for 9211 grains and in Example 5.5 it took about 11 min for 10,000 grains.

In our implementation of Algorithm 2, we simply used MATLAB's all-purpose fminunc optimisation algorithm. With modern, customised optimal transport optimisation algorithms such as [Citation32,Citation33] it should be possible to use our method to generate Laguerre diagrams with given volume distributions with 100,000 grains in a few minutes [Citation32, Table 3] or even one million grains in less than an hour [Citation32, Table 4].

We now compare this with the speed of other algorithms. It is difficult to make a direct comparison in some cases since different methods fit different geometric properties.

In [Citation9], a stochastic optimisation method (the cross-entropy method) is used to solve a non-convex optimisation problem to fit a Laguerre diagram to 3D XRD measurements of grain volumes and centroids. The authors report simulation times (performed using parallel computation) of 19.2 h for 1439 grains and 122.3 h for 8063 grains. Note that it is hard to compare their run times with ours since they also fitting centroids; their method does not try to fit the volumes exactly like we do, but rather obtain a good fit for both volumes and centroids, and their method can produce empty Laguerre cells (grains with volume zero). While the main focus of our paper is to fit volumes only, we gave an example of fitting volumes and centroids in Example 5.3, where we fit a Laguerre diagram to 3D EBSD measurements of an IF steel with 9211 grains. The run time is 6.25 min and the volumes are correct to within 0.56%. The centroid errors of most of the grains are comparable to those given in [Citation9, Figure 9], although overall our method does worse than [Citation9] at centroid fitting, as expected.

Sphere-packing methods are popular for fitting Laguerre diagrams to volume distributions [Citation4,Citation8,Citation10,Citation18]. For n non-overlapping spheres S1,,Sn with centres x1,,xn and radii r1,,rn, the Laguerre diagram with seeds xi and weights wi=ri2 has the property that cell Li contains sphere Si. Therefore, the volume of Li is at least the volume of Si. The idea of sphere-packing methods is that if the spheres are close-packed, then the volumes of the Laguerre cells are approximately equal to the volumes of the solid spheres. The disadvantage of this method is that it is inexact and computationally expensive since the sphere-packing problem is NP hard [Citation47]. Nevertheless, this method provided us with inspiration for a good initial guess for the optimisation simulation in Example 5.3 (see also Section 4.2.1).

In [Citation1], a method is proposed for fitting grain measurements with generalised balanced power diagrams (GBPDs), which are a generalisation of Laguerre diagrams. GBPDs are generated by triples (xi,wi,Ai) of seeds xi, weights wi, and positive definite matrices Ai; the matrices Ai give some control over the aspect ratio of the generalised Laguerre cells; the case Ai=I for all i corresponds to a standard Laguerre diagram. The advantage of GBPDs is that they give a high degree of control over the morphology of the grains [Citation1, Figures 1–6]. The disadvantage is that they are hard to compute. In [Citation1], the authors approximate GBPDs by voxels, and they fit discretised GBPDs to grain measurements by solving a high-dimensional linear programming problem, where the number of unknowns equals the number of grains multiplied by the number of voxels. It is reported that to fit a discretised GBPD to 109 grains in 3D took around 6 h on a standard laptop (this involved solving a linear programming problem with over 77 million variables and 78 million constraints) [Citation1, Section 5.3]. Again, it is not possible to make a direct comparison of these run times with the ones presented here since grain volumes and morphology are fitted in [Citation1], not only grain volumes like here.

A heuristic method for approximately fitting GBPDs to measurements of grain volumes, centroids and aspect ratios was proposed in [Citation13]. Their method entirely avoids solving an optimisation problem; it includes explicit formulas for the generators (xi,wi,Ai) in terms of the data. It is reported in [Citation13] that the method is comparable in accuracy with the optimisation methods of [Citation1,Citation11,Citation21] but takes a small fraction of the computation time. No run times or volume errors are reported in [Citation13] precluding a more precise comparison with our method. Like the sphere-packing method, this heuristic method could be used for generating good initial guesses for optimisation methods.

6.2. Controlling grain geometry

The main goal of our method is to fit grain volumes quickly and accurately. Unlike other methods [Citation1,Citation9,Citation11–13,Citation21,Citation24], it is not specifically designed for fitting grain morphology. We now discuss to what extent we can control the geometry of Laguerre diagrams.

Our method gives some control over the spatial distribution of the grains, as shown in Figures , and , where we create microstructures with bands, clusters, and size gradients.

Several authors use grain centroids as a measure of fitting-error when fitting Laguerre diagrams to data measurements, e.g. [Citation9,Citation13]. We show how we can approximately fit grain centroids to 3D EBSD data in Example 5.3, although the accuracy is much lower than the volume accuracy.

In its current form, our method gives no direct control over the aspect ratio of the grains. Like the sphere-packing method, Algorithm 2 tends to produce grains that are too round compared to grains typically seen in metals; see Section 4.4.

Nevertheless, there are several ways how our method could be generalised to give more control over the morphology of the grains. For example, by combining our method with multilevel Voronoi diagrams [Citation5,Citation17] we could maintain control over the volume of the grains while producing more realistic RVEs with non-convex and elongated grains. The idea would be to first use Algorithm 2 to create a Laguerre diagram with N ‘micro-grains’ of equal volume for large N. Then we would glue together the micro-grains into non-convex ‘macro-grains’. By choosing which micro-grains to glue, we would control the volume and the morphology of the macro-grains. (The multilevel Voronoi method glues together two micro-grains if their generators lie in the same Voronoi cell of a ‘coarser’ Voronoi diagram with fewer generators.)

In principle, our algorithms can also be generalised very easily to produce GBPDs with grains of given volumes (up to any desired tolerance) by modifying the objective functions g and gk in Algorithms 1 and 2 (simply replace the Laguerre cells Li with generalised Laguerre cells, and replace the isotropic distances |xxi| with anisotropic distances |xxi|Ai). This would again allow us to control both the volumes and the aspect ratio of the grains. In practice, however, it is expensive to compute GBPDs to high accuracy; discretising them with voxels greatly increases the cost of the algorithm. Without developing new computational geometry algorithms for the efficient computation of GBPDs, this limits the method to a small number of grains or greatly increases the run time (cf. the run time of 6 h for 109 grains in 3D in [Citation1]).

Since our method is currently limited to Laguerre diagrams, the grains cannot have curved boundaries or be non-convex. Curved grain boundaries can be created using additively weighted Voronoi diagrams (Apollonius diagrams) [Citation27], anisotropic diagrams [Citation2], or GBPDs [Citation1,Citation12,Citation13,Citation21], although these are all more costly to compute than Laguerre diagrams. Algorithms 1 and 2 can also be modified to produce Apollonius diagrams with grains of given volumes (in the definition of the objective functions g and gk simply replace the Laguerre cells Li with Apollonius cells, and replace the squared distances |xxi|2 with non-squared distances |xxi|) but again the implementation cost is an obstacle at the present time. We plan to explore this and the above generalisations in a future paper.

7. Conclusions

In this paper, we introduced a fast optimisation method for generating Laguerre diagrams with user-defined grain size distributions. The volumes of the grains can be controlled exactly (to within any given tolerance). We produced industrially relevant examples of RVEs with up to 20,000 grains with only 1% volume error in the order of minutes on a standard desktop PC. We also demonstrated how the spatial and texture distribution of the grains can be partially controlled. Our algorithms can create both non-periodic Laguerre diagrams (for data fitting) and periodic Laguerre diagrams (for generating RVEs of polycrystalline metals or solid foams for computational homogenisation).

Acknowledgments

The authors would like to thank Carola Celada-Casero for useful discussions.

Disclosure statement

No potential conflict of interest was reported by the author(s).

Additional information

Funding

D.P.B. would like to thank the Engineering and Physical Sciences Research Council (EPSRC) for financial support via the grant EP/R013527/1, EP/R013527/2 Designer Microstructure via Optimal Transport Theory. Some of the work of D.P.B. was carried out at Durham University. The work on generating 3D EBSD data has received funding from the European Union's Horizon 2020 research and innovation programme Euratom research and training programme 2014–2018 under grant agreement No 709418 MuSTMeF.

Notes

1 Technical remark: It can be shown that evaluating the optimal transport (Wasserstein) distance W2(χΩ,imiδxi) between the Lebesgue measure and a discrete measure generates a partition of Ω into Laguerre cells of size m1,,mn.

References

Appendix. Proof that Algorithm 2 is energy-decreasing and convergent

Throughout this section, we assume that ΩRd is compact.

First, we prove that Algorithm 2 is energy-decreasing, Equation (Equation16). Recall that if U is a compact subset of Rd with centroid c(U), then(A1) minzRdU|xz|2dx=U|xc(U)|2dx.(A1) This follows from the fact that the function zU|xz|2dx is strictly convex with unique critical point c(U). By Equation (Equation13) and by the way {(xi(k),wi(k))}i=1n is constructed using Algorithm 2,(A2) E(x1(k),,xn(k))=i=1nLi(k)|xxi(k)|2dx,(A2) where {Li(k)}i=1n is the Laguerre diagram with generators {(xi(k),wi(k))}i=1n. Therefore,(A3) E(x1(k),,xn(k))(A1)i=1nLi(k)|xc(Li(k))|2dx=i=1nLi(k)|xxi(k+1)|2dx(regularisationstepofAlg.2)(12)E(x1(k+1),,xn(k+1)).(A3) This proves (Equation16). The inequalities above are strict unless xi(k)=xi(k+1) for all i, which means that (x1(k),,xn(k)) is a fixed point of Algorithm 2.

Next, we prove a weak global convergence result of the form [Citation48, Theorem 3.8], where convergence of the classical Lloyd algorithm was proved. Weak global convergence means that E(x1(k),,xn(k))0 as k and that any convergent subsequence of (x1(k),,xn(k)) converges to a critical point of E, namely to a centroidal Laguerre diagram. This convergence is called weak because it does not guarantee convergence of the whole sequence (x1(k),,xn(k)) (different subsequences could converge to different critical points).

By construction xi(k) is the centroid of the convex set Li(k1), which has volume mi. Therefore, by [Citation48, Lemma 3.2], the distance between xi(k) and Li(k1) has a lower bound of Cmi2/diam(Ω)2d1 where C=1/1024. Therefore, the closest that two generators xi(k) and xj(k) can be is 2Cm2/diam(Ω)2d1 where m=minimi. Note that this bound is independent of the iteration number k. Therefore, the iterates (x1(k),,xn(k)) lie in the compact set(A4) {(x1,,xn)Ωn:|xixj|2Cm2/diam(Ω)2d1  i,j}.(A4) Owing to this compactness and the energy-decreasing property of Algorithm 2, we have weak global convergence of (x1(k),,xn(k)); see the Global Convergence Theorem in [Citation49, p. 206] or [Citation35, proof of Theorem 3.3].

Finally, we prove a strong convergence result, namely that the whole sequence (x1(k),,xn(k)) produced by Algorithm 2 converges to a critical point of E. We are only able to prove this, however, under the following generic assumption: There are only finitely many centroidal Laguerre diagrams with the same energy E. More precisely, we assume that, for all M>0,(A5) #(x1,,xn)Ωn:E(x1,,xn)=0, E(x1,,xn)=M<.(A5) This assumption is expected to hold for ‘generic’ domains Ω and masses m1,,mn [Citation35, Remark 3.4], [Citation50, p. 107], however, there are examples where it fails. For example, if Ω is a disc, n=2 and m1=m2, then there are infinitely many critical points of E with the same energy by the rotational symmetry of Ω. Note that if E satisfies the generic condition of being a Morse function (having no degenerate critical points), then its critical points are isolated. Since they lie in the compact set (EquationA4) there are only finitely many of them, and so assumption (EquationA5) is satisfied.

The Monotone Convergence Theorem implies that the whole sequence E(x1(k),,xn(k)) converges (because Algorithm 2 is energy-decreasing and E is bounded below by zero). In addition E is continuous, and so every accumulation point of (x1(k),,xn(k)) has the same energy E. Moreover, by the global weak convergence result above, every accumulation point is a critical point of E. Therefore, assumption (EquationA5) ensures there are only finitely many accumulation points.

We now complete the proof following the idea from [Citation50, proof of Theorem 2.5]. Assume for contradiction that the sequence X(k):=(x1(k),,xn(k)) does not converge. Since it only has finitely many accumulation points, there exist distinct accumulation points Y:=(y1,,yn), Z:=(z1,,zn) and distinct subsequences X(kj):=(x1(kj),,xn(kj)), X(kl):=(x1(kl),,xn(kl)) such that X(kj)Y, X(kl)Z, and kl=kj+1, i.e. the sequence X(k) ‘jumps’ between the two subsequences infinitely many times. (Note that such subsequences may not exist if there are infinitely many accumulation points.) Let δ=|YZ|>0 and let T:ΩnΩn denote the continuous map that sends (x1,,xn) to (c(L1),,c(Ln)), where {Li} is the Laguerre diagram with seeds (x1,,xn) and cells of volume m1,,mn. In other words, X(k+1)=T(X(k)). Moreover, T(Y)=Y and T(Z)=Z. Then (A6) δ=|YZ||YX(kj)|+|X(kj)X(kl)|+|X(kl)Z|=|YX(kj)|+|X(kj)T(X(kj))|+|X(kl)Z|.(A6)(A6) By taking j,l in the right-hand side, and using the continuity of T, we find that δ=0, which is a contradiction. Therefore, the whole sequence (x1(k),,xn(k)) converges to a critical point of E. Moreover, this critical point must a local minimum point or a saddle point of E by the energy-decreasing property. This completes the proof.