1 Introduction

Continuum structure topology optimization, first proposed by Bendsoe and Kikuchi [1], is an innovative structural optimization method that can quickly find the optimal material layout under specific conditions. After development, topology optimization has been increasingly used in various fields. The most commonly used topology optimization methods include Solid Isotropic Material Interpolation Penalty (SIMP) [2], homogenization method [1], level set method [3,4,5] and the Evolutionary Structural Optimization (ESO) method [6]. Aiming at the common checkerboard phenomenon, gray area problem and local optimal solution phenomenon in topology optimization [7], various scholars have proposed many effective methods, including sensitivity filtering [8], perimeter constraint [9] and continuity method [10] et al. In addition, Genetic Algorithms (GAs) [11] have also been developed and gradually applied to topology optimization [12].

The SIMP method performs a single-point optimization search according to the sensitivity, and the optimization result will show a local optimum to a certain extent. In order to expand the search range and realize multi-point search, Zhang [13] combined SIMP method with genetic algorithm to improve the optimization efficiency. ESO cannot add units during the optimization process, and deleting useful units by mistake will cause the final optimization result to not be the global optimal solution. In response to this problem, Genetic Evolutionary Structural Optimization (GESO) [14] was proposed, which greatly improved the global search ability of the ESO algorithm. But fundamentally, GESO still cannot add elements. After development, Zuo [15] proposed a topology optimization method for GAs and BESO, which realized the addition and removal of materials during the optimization process. In addition, NSGA-II was proposed and gradually developed on the basis of GAs [16] to achieve fast optimization through processes such as fast non-dominated sorting and crowded computation, competitive selection and elite strategy.

Lattice structure has become a research hotspot in the field of topology optimization because of its advantages in noise reduction, heat absorption, and light weight. With the development of additive manufacturing technology, the fabrication of lattice structures has gradually become possible. Not only that, the pursuit of high-performance materials requires parallel design between structures and materials. More and more scholars have carried out research on parallel optimization of two-scale structures. Gao [17] published Matlab code for structural optimization of 2D and 3D two-scale composites. Chen [18] proposed the isosurface threshold formula and algorithm to realize the parallel design of macrostructure and microstructure. Xia [19] provided a Matlab code for microstructure design based on the energy homogenization method. However, the design of microstructures by SIMP method is prone to grayscale and numerical instability. Huang [20] studied the two-scale optimization problem through the homogenization theory based on the BESO method. Huang [21, 22] showed that the BESO method has high efficiency in microstructure design. Most of these studies are based on two-scale optimization by SIMP or BESO methods. The shortcomings of the SIMP method have been mentioned above, and the BESO method may cause the addition and deletion of materials to fail in some aspects [14]. In order to solve these problems and improve the global search ability of classical optimization algorithms in the two-scale optimization process, this paper proposes an optimization algorithm combining NSGA-II and BESO, called BESO–NSGA-II.

The BESO–NSGA-II algorithm aims to achieve the concurrent optimization of macrostructures and microstructures through homogenization theory under the premise of satisfying volume constraints and aiming at the maximum stiffness of the structure. The multi-point global search of the algorithm is realized through NSGA-II to determine the optimal distribution of materials. A double penalty operator is proposed to ensure a "clean" topology and improve the stability and fast convergence of the algorithm.

The arrangement of this paper is as follows. Section 2 presents the optimization problem. Section 3 presents the derivation and filtering scheme of the sensitivity. Section 4 introduces the specific implementation of the BESO–NSGA-II algorithm. Section 5 verifies the effectiveness of the proposed method through a series of 2D/3D examples. Finally came to a conclusion.

2 Problem statements

In the homogenization method, the size of the microstructure is often considered to be much smaller than the size of the macrostructure. The microstructure presents a periodic distribution within the macrostructure. Figure 1 is a schematic diagram of the two-scale structure. In the linear elastic range, the displacement field of the macrostructure can be expanded as:

$${\mathbf{u}}^{\epsilon } ({\mathbf{x}}) = {\mathbf{u}}_{0} ({\mathbf{x}},{\mathbf{y}}) + \epsilon {\mathbf{u}}_{1} ({\mathbf{x}},{\mathbf{y}}) + \epsilon^{2} {\mathbf{u}}_{2} ({\mathbf{x}},{\mathbf{y}}) + \ldots ,{\mathbf{y}} = {\mathbf{x}}/\epsilon$$
(1)

x represents the global macro variable, and y represents the local micro variable. ϵ is a value much less than 1, which represents the ratio of macroscale to microscale.

Fig. 1
figure 1

Schematic diagram of the two-scale structure

When only the first-order term of the progressive expansion of Eq. (1) is considered, the macroscopic stiffness tensor can be expressed as [17]:

$${\mathbf{D}}^{H} = \frac{1}{{\left| {\Omega_{m} } \right|}}\int_{{\Omega_{m} }} {\mathbf{D}} \left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m} } \right)} \right)\left( {\varepsilon \left( {{\mathbf{u}}_{{\text{m}}}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m} } \right)} \right)d\Omega_{m}$$
(2)

In the formula, Ωm is the area of the microstructure (under two-dimensional conditions), D is the locally varying elastic tensor, ε(\({\mathbf{u}}_{m}^{0}\)) is the linearly independent element strain field, and ε(um) is the unknown strain field of the microstructure, which can be solved by the linear elastic equilibrium equation:

$$\int_{{\Omega_{m} }} {\mathbf{D}} \varepsilon \left( {{\mathbf{u}}_{m} } \right)\varepsilon \left( {{{\varvec{\upnu}}}_{m} } \right)d\Omega_{m} = \int_{{\Omega_{m} }} {\mathbf{D}} \varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right)\varepsilon \left( {{{\varvec{\upnu}}}_{m} } \right)d\Omega_{m} ,\quad \forall {{\varvec{\upnu}}}_{m} \in H_{per} \left( {\Omega_{m} ,{\mathbb{R}}^{d} } \right) \,$$
(3)

νm is the virtual displacement in the microstructure, and Hper is the displacement space.

The optimized mathematical model can be expressed as:

$$\left\{ {\begin{array}{*{20}l} {Find{:}\rho_{M}^{i} ,\rho_{m}^{j} \quad (i = 1,\;2, \ldots M;\;j = 1,\;2, \ldots N)} \hfill \\ {Min{:}C = \frac{1}{2}{\mathbf{F}}^{{\text{T}}} {\mathbf{U}}} \hfill \\ {S.t:\left\{ \begin{gathered} G_{M} (\rho_{M} ) = \int_{{\Omega_{M} }} {\upsilon_{0} \rho_{M} d\Omega_{M} - V_{M} \le 0} \hfill \\ G_{m} (\rho_{m} ) = \int_{{\Omega_{m} }} {\upsilon_{0} \rho_{m} d\Omega_{m} - V_{m} \le 0} \hfill \\ 0 < \rho_{M}^{\min } \le \rho_{M}^{i} \le 1 \hfill \\ 0 < \rho_{m}^{\min } \le \rho_{m}^{i} \le 1 \hfill \\ \end{gathered} \right.} \hfill \\ \end{array} } \right.$$
(4)

where \(\rho_{M}^{i}\) and \(\rho_{m}^{j}\) represent the macroscopic and microscopic design variables, respectively, and the objective C is to minimize the mean compliance of the structure. F and U represent the external force vector and node displacement vector that the macrostructure is subjected to. The macrostructure ΩM is discretized into M macroscopic units, and the microstructure Ωm is discretized into N microscopic units. GM and Gm are the volume constraints of the macro-unit and the micro-unit, respectively.

VM and Vm are the target volume fractions of macrostructure and microstructure, respectively. υ0 is the solid volume fraction for each iterative process. In order to eliminate singularities in the calculation process, \(\rho_{M}^{min}\) and \(\rho_{m}^{min}\) are treated as positive numbers sufficiently close to 0.

The static performance of a structure is generally given by the following equilibrium equation:

$${\mathbf{F}} = {\mathbf{KU}}$$
(5)

where K is the global stiffness matrix of the macrostructure, which can be assembled from the element stiffness matrix ki. The reference element in the ξ − η coordinate system shown in Fig. 2 is defined in the natural coordinate system. Through coordinate transformation, the element stiffness matrix can be expressed as:

$${\mathbf{k}}_{i} = \int_{ - 1}^{1} {\int_{ - 1}^{1} {{\mathbf{B}}^{T} {\mathbf{DB}}\det {\varvec{J}}} } d\xi d\eta$$
(6)
Fig. 2
figure 2

Quadrilateral elements in ξ−η coordinate system

B is the strain displacement matrix, and J is the Jacobian matrix.

For a 2D four-node quadrilateral element, the four shape functions can be expressed as:

$$N_{i} = \frac{1}{4}\left\{ \begin{gathered} (1 - \xi )(1 - \eta ) \hfill \\ (1 + \xi )(1 - \eta ) \hfill \\ (1 + \xi )(1 + \eta ) \hfill \\ (1 - \xi )(1 + \eta ) \hfill \\ \end{gathered} \right.\quad (i = 1,\;2,\;3,\;4)$$
(7)

The element node value can describe the element displacement field. If u = (u,ν)T represents the displacement component at point (ξ,η), d represents the element node displacement array. The specific expression is:

$$\begin{aligned} u & = N_{1} d_{1} + N_{2} d_{3} + N_{3} d_{5} + N_{4} d_{7} \\ v & = N_{1} d_{2} + N_{2} d_{4} + N_{3} d_{6} + N_{4} d_{8} \\ \end{aligned}$$
(8)

In the isoparametric transformation, based on the geometric coordinates of the nodes, the geometric coordinates of any point in the unit are interpolated using the shape function \(N_{i}\), which is expressed as:

$$\left\{ \begin{gathered} x = N_{1} x_{1} + N_{2} x_{2} + N_{3} x_{3} + N_{4} x_{4} \hfill \\ y = N_{1} y_{1} + N_{2} y_{2} + N_{3} y_{3} + N_{4} y_{4} \hfill \\ \end{gathered} \right.$$
(9)

Expressing Eq. (9) as the general expression of the function f = f (x, y), which is an implicit function of ξ and η, by the chain derivation rule we have:

$$\left\{ \begin{gathered} \frac{\partial f}{{\partial \xi }} = \frac{\partial f}{{\partial x}}\frac{\partial x}{{\partial \xi }} + \frac{\partial f}{{\partial y}}\frac{\partial y}{{\partial \xi }} \hfill \\ \frac{\partial f}{{\partial \eta }} = \frac{\partial f}{{\partial x}}\frac{\partial x}{{\partial \eta }} + \frac{\partial f}{{\partial y}}\frac{\partial y}{{\partial \eta }} \hfill \\ \end{gathered} \right.$$
(10)

can be written as:

$$\left( \begin{gathered} \frac{\partial f}{{\partial \xi }} \hfill \\ \frac{\partial f}{{\partial \eta }} \hfill \\ \end{gathered} \right) = {\varvec{J}}\left( \begin{gathered} \frac{\partial f}{{\partial x}} \hfill \\ \frac{\partial f}{{\partial y}} \hfill \\ \end{gathered} \right)$$
(11)

where J is the Jacobian matrix, which can be expressed as:

$$\varvec{J} = \left( {\begin{array}{*{20}c} {\frac{\partial x}{{\partial \xi }}} & {\frac{\partial y}{{\partial \xi }}} \\ {\frac{\partial x}{{\partial \eta }}} & {\frac{\partial y}{{\partial \eta }}} \\ \end{array} } \right) = \left( {\begin{array}{*{20}c} {J_{11} } & {J_{12} } \\ {J_{{{\varvec{21}}}} } & {J_{22} } \\ \end{array} } \right)$$
(12)

The stress–strain relationship is:

$$\varvec{\varepsilon }= \left( \begin{gathered} \varepsilon_{x} \hfill \\ \varepsilon_{y} \hfill \\ \gamma_{xy} \hfill \\ \end{gathered} \right) = \left( \begin{gathered} \quad \frac{\partial u}{{\partial x}} \hfill \\ \quad \frac{\partial v}{{\partial y}} \hfill \\ \frac{\partial u}{{\partial y}} + \frac{\partial v}{{\partial x}} \hfill \\ \end{gathered} \right)$$
(13)

Assuming that f is always equal to u, we can get:

$$\left( \begin{gathered} \frac{\partial u}{{\partial x}} \hfill \\ \frac{\partial u}{{\partial y}} \hfill \\ \end{gathered} \right) = \frac{1}{{\det {\varvec{J}}}}\left( {\begin{array}{*{20}c} {J_{22} } & { - J_{12} } \\ { - J_{21} } & {J_{11} } \\ \end{array} } \right)\left( \begin{gathered} \frac{\partial u}{{\partial \xi }} \hfill \\ \frac{\partial u}{{\partial \eta }} \hfill \\ \end{gathered} \right)$$
(14)

Similarly:

$$\left( \begin{gathered} \frac{\partial v}{{\partial x}} \hfill \\ \frac{\partial v}{{\partial y}} \hfill \\ \end{gathered} \right) = \frac{1}{{\det {\varvec{J}}}}\left( {\begin{array}{*{20}c} {J_{22} } & { - J_{12} } \\ { - J_{21} } & {J_{11} } \\ \end{array} } \right)\left( \begin{gathered} \frac{\partial v}{{\partial \xi }} \hfill \\ \frac{\partial v}{{\partial \eta }} \hfill \\ \end{gathered} \right)$$
(15)

Then the strain–displacement relationship can be written as:

$$\varepsilon = \frac{1}{{\det {\varvec{J}}}}\left( {\begin{array}{*{20}c} {J_{22} } & { - J_{12} } & 0 & 0 \\ 0 & 0 & { - J_{{{\varvec{21}}}} } & {J_{11} } \\ { - J_{{{\varvec{21}}}} } & {J_{11} } & {J_{22} } & { - J_{12} } \\ \end{array} } \right)\left( \begin{gathered} \frac{\partial u}{{\partial \xi }} \hfill \\ \frac{\partial u}{{\partial \eta }} \hfill \\ \frac{\partial v}{{\partial \xi }} \hfill \\ \frac{\partial v}{{\partial \eta }} \hfill \\ \end{gathered} \right)$$
(16)

According to the interpolation function formula of formula (8), it can be expanded and written as:

$$\left( \begin{gathered} \frac{\partial u}{{\partial \xi }} \hfill \\ \frac{\partial u}{{\partial \eta }} \hfill \\ \frac{\partial v}{{\partial \eta }} \hfill \\ \frac{\partial v}{{\partial \eta }} \hfill \\ \end{gathered} \right) = \frac{1}{4}\left( {\begin{array}{*{20}c} { - (1 - \eta )} & 0 & {(1 - \eta )} & 0 & {(1 + \eta )} & 0 & { - (1 + \eta )} & 0 \\ { - (1 - \xi )} & 0 & { - (1 + \xi )} & 0 & {(1 + \xi )} & 0 & {(1 - \xi )} & 0 \\ 0 & { - (1 - \eta )} & 0 & {(1 - \eta )} & 0 & {(1 + \eta )} & 0 & { - (1 + \eta )} \\ 0 & { - (1 - \xi )} & 0 & { - (1 + \xi )} & 0 & {(1 + \xi )} & 0 & {(1 - \xi )} \\ \end{array} } \right)d$$
(17)
$$G = \frac{1}{4}\left( {\begin{array}{*{20}c} { - (1 - \eta )} & 0 & {(1 - \eta )} & 0 & {(1 + \eta )} & 0 & { - (1 + \eta )} & 0 \\ { - (1 - \xi )} & 0 & { - (1 + \xi )} & 0 & {(1 + \xi )} & 0 & {(1 - \xi )} & 0 \\ 0 & { - (1 - \eta )} & 0 & {(1 - \eta )} & 0 & {(1 + \eta )} & 0 & { - (1 + \eta )} \\ 0 & { - (1 - \xi )} & 0 & { - (1 + \xi )} & 0 & {(1 + \xi )} & 0 & {(1 - \xi )} \\ \end{array} } \right)$$
(18)

From formula (16), (17) and (18), we can get:

$${\mathbf{B}} = \frac{1}{{\det {\varvec{J}}}}\left( {\begin{array}{*{20}c} {J_{22} } & { - J_{12} } & 0 & 0 \\ 0 & 0 & { - J_{{{\varvec{21}}}} } & {J_{11} } \\ { - J_{{{\varvec{21}}}} } & {J_{11} } & {J_{22} } & { - J_{12} } \\ \end{array} } \right)G$$
(19)

The element stiffness matrix can be obtained by substituting Eq. (19) into (6).

3 Sensitivity analysis and filtering scheme

For topology optimization, sensitivity analysis is needed to guide the search direction of the optimization algorithm. At the macroscopic scale, the mean compliance depends on the material properties of each element in the structure. Let F be the design-independent load vector, so the derivative of the average compliance of the ith element \(X_{i}\) with respect to the change in material density is [20]:

$$\frac{\partial C}{{\partial X_{i} }} = \frac{1}{2}{\mathbf{F}}^{T} \frac{{\partial {\mathbf{U}}}}{{\partial X_{i} }} = \frac{1}{2}{\mathbf{F}}^{T} {\mathbf{K}}^{ - 1} \left( {\frac{{\partial {\mathbf{F}}}}{{\partial X_{i} }} - \frac{{\partial {\mathbf{K}}}}{{\partial X_{i} }}{\mathbf{U}}} \right) = - \frac{1}{2}{\mathbf{U}}^{T} \frac{{\partial {\mathbf{K}}}}{{\partial X_{i} }}{\mathbf{U}}$$
(20)

For the proposed optimization framework, the sensitivity expression of the mean compliance to the micro-design variables is:

$$\frac{\partial C}{{\partial \rho_{m}^{j} }} = - \frac{1}{2}\sum\limits_{i = 1}^{M} {{\mathbf{u}}_{i}^{T} \frac{{\partial {\mathbf{k}}_{i} }}{{\partial \rho_{m}^{j} }}{\mathbf{u}}_{i} } = - \frac{1}{2}\sum\limits_{i = 1}^{M} {{\mathbf{u}}_{i}^{T} \int_{{\Omega_{i} }} {{\mathbf{B}}^{T} } } \frac{{\partial {\mathbf{D}}^{H} }}{{\partial \rho_{m}^{j} }}{\mathbf{B}}d\Omega_{i} {\mathbf{u}}_{i}$$
(21)

The elastic tensor of the microstructure is represented by the material interpolation scheme in the improved SIMP method [23], and the specific form is:

$${\mathbf{D}}_{m} = \left[ {c + \left( {\rho_{m} } \right)^{p} (1 - c)} \right]{\mathbf{D}}_{0}$$
(22)

In the formula, e = 1e−9, to avoid the singularity of the matrix. p is the penalty factor, and D0 is the constitutive elastic tensor of the material. For the microstructure, the homogenized elastic tensor can be expressed as:

$${\mathbf{D}}^{H} = \frac{1}{{\left| {\Omega_{m} } \right|}}\int_{{\Omega_{m} }} {{\mathbf{D}}_{m} } \left( {\rho_{m} } \right)\left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m} } \right)} \right)\left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m} } \right)} \right)d\Omega_{m}$$
(23)

Substituting Eq. (22) into (23) and derivation of the microstructure design variables can be obtained:

$$\frac{{\partial {\mathbf{D}}^{H} \left( {\rho_{m}^{j} } \right)}}{{\partial \rho_{m}^{j} }} = \frac{1}{{\left| {\Omega_{m} } \right|}}\int_{{\Omega_{m}^{j} }} p \left( {\rho_{m}^{j} } \right)^{p - 1} (1 - c){\mathbf{D}}_{0} \left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m}^{j} } \right)} \right)\left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m}^{j} } \right)} \right)d\Omega_{m}^{j} \,$$
(24)

Substituting Eq. (24) into (21), the sensitivity of the average compliance can be obtained as:

$$\frac{\partial C}{{\partial \rho_{m}^{j} }} = - \frac{{p\left( {\rho_{m}^{j} } \right)^{p - 1} }}{{2\left| {\Omega_{m} } \right|}}\sum\limits_{i = 1}^{M} {{\mathbf{u}}_{i}^{T} \int_{{\Omega_{i} }} {{\mathbf{B}}^{T} } } \left[ {\int_{{\Omega_{m}^{j} }} {(1 - c){\mathbf{D}}_{0} \left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m}^{j} } \right)} \right)\left( {\varepsilon \left( {{\mathbf{u}}_{m}^{0} } \right) - \varepsilon \left( {{\mathbf{u}}_{m}^{j} } \right)} \right)d\Omega_{m}^{j} } } \right]{\mathbf{B}}d\Omega_{i} {\mathbf{u}}_{i}$$
(25)

In the BESO method, the sensitivity of the jth element can be defined as:

$$\alpha_{j} = - \frac{1}{p}\frac{\partial C}{{\partial \rho_{m}^{j} }}$$
(26)

Sensitivity is corrected by a sensitivity filtering strategy. This not only effectively reduces the checkerboard phenomenon, but also enables the addition and deletion of cells by deriving the sensitivity of empty cells by filtering the sensitivity values of physical cells within the radius [24]. The filtering strategy used in this paper is as follows:

$$\alpha_{j}^{\prime } = \frac{{\sum\nolimits_{k = 1}^{N} {w(r_{jk} )} \alpha_{k}^{n} }}{{\sum\nolimits_{k = 1}^{N} {w(r_{jk} )} }}$$
(27)

In the formula, w(rjk) is the weight factor, rjk represents the distance from the center of node j to the center of node k, and the weight factor can be expressed as:

$$w(r_{jk} ){ = }\left\{ \begin{gathered} r_{\min } - r_{jk\quad \quad } for\;r_{jk} < r_{\min } \hfill \\ 0\quad \quad \quad \;\;for\;r_{jk} \ge r_{\min } \hfill \\ \end{gathered} \right.$$
(28)

The sensitivity value is corrected by a convergence strategy considering historical iteration information. The specific operation is to calculate the average value of the sensitivity of the current iteration and the previous iteration as the update value of the sensitivity [24].

$$\overline{{\alpha_{j} }} = \frac{1}{2}\left( {\alpha_{j,g}^{\prime } + \alpha_{j,g - 1}^{\prime } } \right)$$
(29)

In the formula, \(\alpha_{j,g}^{\prime }\) and \(\alpha_{j,g - 1}^{\prime }\) are the sensitivity values of the gth and g−1th iteration steps of the jth unit, respectively. Finally, the effect of each unit on the structural properties is measured according to this sensitivity value.

During the optimization process, the material redistribution and the update calculation of the objective function are continuously carried out. When the optimization reaches the specified target mass fraction and the following convergence conditions are met, the optimization process is terminated. The convergence error is mainly calculated from the objective function value.

$$error = \frac{{\left| {\sum\nolimits_{j = 1}^{E} {\left( {C_{q - j + 1} - C_{q - E - j + 1} } \right)} } \right|}}{{\sum\nolimits_{j = 1}^{E} {C_{q - j + 1} } }} \le \tau$$
(30)

In the formula, C represents the objective function value, q is the current number of iterations, and E is 5, indicating that the optimization results of five consecutive iterations have certain stability. τ is the allowable convergence error.

4 Implementation of BESO–NSGA-II

In the BESO–NSGA-II algorithm, each macroscopic element is analyzed as an independent individual. The number of populations remains unchanged during the iterative process, ensuring that the number of individuals in the entire population is always equal to the number of elements in the design domain. Each individual is represented by a binary string of a certain length. The initial string is defined in this article as an array of all 1 s, representing that all units are solid materials, and an array of all 0 s means the units to be deleted in this iteration. After the optimization model is initialized, the sensitivity value is used as the basis for fast non-dominated sorting. Comparing the sensitivity of each element to establish the dominant and non-dominant relationship, and rank order. For individuals of the same level, the crowding degree is calculated, and the expression is:

$${\mathbf{R}}{ = }\left\{ {\begin{array}{*{20}l} \infty \hfill & {\alpha^{\max } = \alpha^{\min } } \hfill \\ {\frac{{\alpha_{{{\text{i + }}1}} - \alpha_{i - 1} }}{{\alpha^{\max } - \alpha^{\min } }}} \hfill & {\alpha^{\max } \ne \alpha^{\min } } \hfill \\ \end{array} } \right.$$
(31)

αmax and αmin represent the maximum and minimum values of sensitivity in this iteration cycle, respectively. αi+1 represents the sensitivity value calculated by the i + 1th element, and αi−1 represents the sensitivity value calculated by the i−1th element.

The crossover mutation operator plays an extremely important role in NSGA-II, which enriches the population diversity. The crossover mutation operator proposed in this paper adopts a semi-random method, which avoids the checkerboard phenomenon and non-convergence under the fully random operator to a certain extent. The cross- mutation operator only has the transformation between 0 and 1.

The double penalty operator is mainly used in the crossover mutation operator. First based on the sensitivity threshold calculated for each generation. Divide the population into high-sensitivity regions and low-sensitivity regions. Two individuals were randomly selected as parents within the design domain. Two crossover bits are randomly selected, and the crossover operation is performed on the parents. In order to accelerate the convergence, the algorithm in this paper gradually penalizes the crossover rate to a certain maximum value as the number of iterations increases during the optimization process. The mutation operator is to mutate the binary code of each individual according to a certain mutation rate. A double penalty operator for the mutation rate is proposed here. In the iterative loop of the optimization algorithm, with the increase of the number of iterations, the crossover rate and the mutation rate are gradually penalized to a certain maximum value, and the maximum value is limited to 1, such as Eqs. (32) and (33). Among them, pc is the crossover rate, pc, min are the set minimum crossover rates, and pc,max are the set minimum crossover rates. pm is the mutation rate, pm, min are the set minimum mutation rate, pm, max are the set minimum mutation rate, and prg is the index to control the crossover mutation rate.

$$p_{c} = p_{c,\min } + \left( {p_{c,\max } - p_{c,\min } } \right)prg^{p}$$
(32)
$$p_{m} = p_{m,\min } + \left( {p_{m,\max } - p_{m,\min } } \right)prg^{p}$$
(33)

In each iteration step, for the high-sensitivity region, as shown in Eq. (34), the mutation rate (the probability that the binary code is mutated to 1) is gradually penalized to a certain minimum value as the sensitivity value increases from high to low. Individuals with higher sensitivity values have a greater probability of having more 1 s, which are easier to retain in the optimization process. For low-sensitivity regions, as shown in Eq. (35), the mutation rate (probability of binary code mutation to 0) is gradually penalized to a certain maximum value as the sensitivity increases from high to low. At this time, individuals with low sensitivity values have Larger probabilities have more 0 s and are easier to remove during optimization. It is worth noting that individuals of the same rank have the same rate of variation. Through the double penalty mechanism, the fast convergence of the optimization process and a clearer and more stable topology are ensured.

$$p_{high,m} = p_{high,m} - \frac{{p_{m,\max } - p_{m,\min } }}{{r_{high,\max } - r_{high,\min } + 1}}$$
(34)
$$p_{low,m} = p_{low,m} + \frac{{p_{m,\max } - p_{m,\min } }}{{r_{low,\max } - r_{low,\min } + 1}}$$
(35)

In the formula, phigh,m is the variation rate of high-sensitivity individuals, and plow,m is the variation rate of low-sensitivity individuals. rhigh,max is the maximum value of the individual level of the high-sensitivity area, and rhigh,min is the minimum value of the individual level of the high-sensitivity area. rlow,max and rlow,min are the maximum and minimum values of individual levels in the low-sensitivity area. The initial value of phigh,m is pm,max, and the initial value of plow,m is pm.

Figure 3 is a flowchart of the algorithm implementation:

Fig. 3
figure 3

Flowchart of algorithm implementation

4.1 Numerical examples

Introduce some two-scale optimization examples. The elastic modulus of the filled material is set to 1 Mpa, the Poisson's ratio is 0.3, the volume evolution ratio ER = 0.02, and the crossover rate and mutation rate are both 0.6.

4.2 Cantilever beam

Widely used in many different engineering projects, cantilever beam can be fixed at one end and hang freely at the other end, allowing structures with large spans to be achieved without the need for columns or supports. Cantilever beams are often used in the design and construction of bridges, especially in shorter span bridges. Cantilever bridges are typically supported at one end and suspended at the other to span rivers, canyons, roads, or other obstacles. Cantilever beams are also widely used in aerospace engineering, for example in structures such as wings and rudder surfaces of aircraft and spacecraft. In summary, cantilever beams have a wide range of applications in engineering, and their light weight, high stiffness, and large spans make them a common structural design choice in many engineering projects.

This example considers a two-scale design of a cantilever beam. Figure 4 shows the initial design of the macrostructure and microstructure. The macro design domain has a length of 80 mm and a height of 40 mm, and a downward concentrated force is applied at the lower right corner of its bottom with a magnitude of 1 N. The micro-units are discretized into 50 × 50 four-node units, the density values of the four elements in the center of the micro-unit are set to 1e−6, and the remaining elements are filled with solid materials. The volume fraction of macrostructure and microstructure retained is 40%, the macroscopic filtering radius is Rmin = 3, and the microscopic filtering radius is rmin = 2.

Fig. 4
figure 4

Cantilever beam problem

In order to verify the effectiveness of the double penalty operator proposed in this paper, the algorithm with the double penalty operator added and the algorithm without the double penalty operator are compared. As shown in Fig. 5, before the 50th generation, the optimization efficiency of the two is basically the same, and after the 50th generation, the algorithm with the double penalty operator added converges in the 165th generation, reaching the target optimal value, while the algorithm without the double penalty operator is added. The convergence rate tends to be flat, and finally converges to the optimal result in 255 generations. Figure 6 shows the microstructure evolution process corresponding to the two algorithms. All the examples in this paper introduce a double penalty operator to ensure the fast convergence of the results. It is worth noting that the double penalty operator only affects the optimization efficiency and does not affect the material layout of the macrostructures and microstructures.

Fig. 5
figure 5

Algorithm comparison results

Fig. 6
figure 6

Microstructure evolution process

To verify the stability of the proposed algorithm, Fig. 7 shows the results of 6 runs under the same parameters. Similar optimization results can be obtained in terms of macroscopic and microscopic material layouts, elastic stiffness matrices, and objective functions. The average value of the objective function is 128.2632, and the maximum deviation value of the six runs from the average value is only 0.89%, which is very close to the objective function value. This algorithm eliminates the random effect brought by the genetic algorithm and has some stability. Figure 8 shows the evolution of the two-scale optimization, which proves that the proposed method has a stable convergence effect on the objective function and structure layout after 160 generations.

Fig. 7
figure 7

Two-scale optimization of evolutionary processes

Fig. 8
figure 8

Two-scale optimization of evolutionary processes

Figure 9 shows the optimization results of the cantilever beam using the classical BESO method combined with the homogenization theory with an objective function value of 135.7421. By comparing the objective function values, it can be concluded that the algorithm proposed in this paper is smaller than classical BESO in terms of the objective function (mean compliance), implying an increase in structural stiffness. Since the purpose of this algorithm is to study the optimization effect of the optimization algorithm on the value of the objective function (i.e., to improve the maximum stiffness of the structure), the cost of time is ignored.

Fig. 9
figure 9

Classical BESO optimization results

Figure 10 presents the results of the two-scale optimization and the elastic stiffness matrix for three different sizes of macrostructures. The macroscopic dimensions of a are 80 × 60 mm, the macroscopic dimensions of b are 80 × 40 mm, and the macroscopic dimensions of c are 40 × 40 mm. The dimensions of the macroscopic structure greatly affect the material layout of the microscopic structure. For the slender cantilever beam, its x-direction is filled by the material with higher stiffness, and when the dimensions of the macrostructure x-direction and y-direction are the same, the material stiffness in these two directions is also relatively the same. These conclusions are in accordance with the common sense of structural analysis. Chen [18] also discussed cantilever beam structures with different macroscopic sizes, and the results showed that the macroscopic size has a great influence on both the macrostructure and the microstructure, which is consistent with the conclusions obtained in this paper and verifies the correctness of the algorithm.

Fig. 10
figure 10

Optimization results for different macroscopic scales

4.3 L-bracket

An L-bracket is a common structural section, usually made of steel or other metallic material, with an L-shaped cross-section. In engineering, L-bracket can usually be used to support the weight of buildings or other structures. In steel structure buildings, L-bracket are often used to construct floors, roofs, and cantilever structures. In the construction of bridges, L-bracket can be used as the main load-bearing members of bridge structures, and are used to construct the main beams or beams of bridges. In addition, L-bracket can also be used in other engineering projects, such as power transmission towers, elevated roads, railway tracks, etc. Its simple structure, convenient installation, stable performance and other characteristics make it have a wide range of application value in engineering.

This example considers the two-scale design of L-bracket. The initial design macrostructure and microstructure are shown in Fig. 11. The design domain length is 60 mm, height is 60 mm, and the load size is 1N. The retained volume fraction of the macrostructure is 40% and the retained volume fraction of the microstructure is 50%, the macro-filter radius Rmin = 2, the microfilter radius rmin = 3, and the crossover rate and variation rate are 0.6. Similarly, six replicate experiments were performed for the model under the same parameters. As shown in Fig. 12, the results of the six runs showed some similarity in terms of macroscopic and microscopic material layout, elastic stiffness matrix, and objective function. The average value of the objective function is 146.8795. Figure 13 shows the two-scale optimization evolution process, and it can be seen that after 70 generations, the optimization results tend to converge and stable results are obtained. Figure 14 shows the optimization results of the classical BESO algorithm under the same model with the corresponding objective function of 154.5804. Under this model the results obtained by this algorithm outperform the results obtained by the classical BESO method.

Fig. 11
figure 11

L-bracket

Fig. 12
figure 12

Two-scale optimization of evolutionary processes

Fig. 13
figure 13

Two-scale optimization of evolutionary processes

Fig. 14
figure 14

Classical BESO optimization results

The results of the two-scale optimization with three different initial microstructures and the elastic stiffness matrix are presented in Fig. 15. It can be found that the different initial microstructures affect the configuration of the microstructure to a certain extent, but do not have a large effect on the material layout of the macrostructure.

Fig. 15
figure 15

Two-scale optimization of different initial microstructures

4.4 3D support structure

The 3D support structure considered in this example. The macroscopic structure and microscopic structure of the initial design are shown in Fig. 16. The macroscopic structure and microscopic structure of the initial design are shown in Fig. 16. The volume fraction retained by the macroscopic structure is 20%, the volume fraction retained by the microscopic structure is 30%, the macroscopic filter radius Rmin = 2, the microscopic filter radius rmin = 2, and the crossover rate and mutation rate are 0.6. Figure 17 shows the macroscopic and microscopic models optimized by using this algorithm. Based on the SIMP method, Gao [17] also realized the two-scale optimization of the 3D support structure by using the homogenization theory, but the grayscale phenomenon appeared in the result. The algorithm proposed in this paper can effectively improve the structural stiffness while suppressing this numerical instability.

$${\mathbf{D}}^{H} = \left\{ {\begin{array}{*{20}l} {0.1031} \hfill & {0.0596} \hfill & {0.0970} \hfill & { - 1.6168{\text{e}} - {5}} \hfill & { - 9.4004{\text{e}} - 6} \hfill & { - 2.8555{\text{e}} - 5} \hfill \\ {0.0596} \hfill & {0.3321} \hfill & {0.0611} \hfill & { - 4.5553{\text{e}} - 5} \hfill & {1.7457{\text{e}} - 5} \hfill & { - 7.2870{\text{e}} - 5} \hfill \\ {0.0970} \hfill & {0.0611} \hfill & {0.1080} \hfill & { - 2.7319{\text{e}} - 5} \hfill & {3.1321{\text{e}} - 5} \hfill & { - 3.9190{\text{e}} - 5} \hfill \\ { - 1.6168{\text{e}} - 5} \hfill & { - 4.5553{\text{e}} - 5} \hfill & { - 2.7319{\text{e}} - 5} \hfill & {0.0650} \hfill & { - 2.2578{\text{e}} - 5} \hfill & { - 6.4895{\text{e}} - 7} \hfill \\ { - 9.4004{\text{e}} - 6} \hfill & {1.7457{\text{e}} - 5} \hfill & {3.1321{\text{e}} - 5} \hfill & { - 2.2578{\text{e}} - 5} \hfill & {0.0680} \hfill & { - 1.3615{\text{e}} - 5} \hfill \\ { - 2.8555{\text{e}} - 5} \hfill & { - 7.2870{\text{e}} - 5} \hfill & { - 3.9190{\text{e}} - 5} \hfill & { - 6.4895{\text{e}} - 7} \hfill & { - 1.3615{\text{e}} - 5} \hfill & {0.0711} \hfill \\ \end{array} } \right.$$
Fig. 16
figure 16

3D support structure

Fig. 17
figure 17

3D support structure two-scale optimization results

According to different application requirements, different initial structural designs can be carried out for the 3D support structure. In the field of architecture, an optimally designed three-dimensional support structure can achieve larger spans and more complex spatial forms by using the support elements in space, thus bringing more design possibilities to buildings. In addition, in the aerospace field, 3D support structures can also be used in spacecraft and satellites to support loads and instruments to maintain the stability and reliability of the structure.

5 Conclusion

In this paper, a topology optimization method integrating BESO and NSGA-II is proposed for the two-scale optimization problem to achieve the design of maximum structural stiffness. The homogenization theory and the target sensitivity are derived. Due to the influence of NSGA-II, the present algorithm has a certain degree of randomness. Six iterations of the design for each arithmetic case yielded highly similar results, which proved the stability of the algorithm. The implementation of the double penalty operator allows the present algorithm to obtain an absolutely convergent and clean topology. In comparison with the classical BESO method, the proposed algorithm can effectively improve the stiffness of the structure. It is worth noting that the present algorithm aims to improve the optimization of the objective function and does not consider the effect of optimization time. Finally, the extension of the algorithm to the 3D model is implemented to verify the effectiveness and generalizability of the algorithm.