1 Introduction

As one of the most effectiveness methods for structural design, topology optimization (TO) firstly proposed by Bendsoe and Kikuchi (1988) has developed into a mature technology with the tremendous endeavor of many scientific researchers (Guest et al. 2004; Maute and Allen 2004; Huang and Xie 2008; Xia et al. 2015a; Wang et al. 2018a). In the past three decades, a series of methods for TO has been put forward, including solid isotropic material with penalization (SIMP) model (Bendsøe 1989; Sigmund 2001), evolutionary approach (Xie and Steven 1993), level set method (Allaire et al. 2004; Mei and Wang 2004; Liu et al. 2014a; Liu et al. 2014b; Liu et al. 2017; Gao et al. 2019a; Xu et al. 2019a), explicit geometric primitive approach (Zhang et al. 2016; Hou et al. 2017; Zhang et al. 2017a), and feature-driven method (Norato et al. 2015; Zhou et al. 2016; Zhang et al. 2017b). However, there is always a compromise between accuracy and computational efficiency for TO. In the widely used SIMP method, to obtain high efficiency, coarse mesh should be used to discretize the design domain but will lead to low computational accuracy and non-satisfactory structural boundary. Both computational accuracy and the quality of structural boundary can be improved by using the finer mesh, but this approach will result in a huge computational burden due to the large-scale finite element analysis. Hence, it is more reasonable to adopt the strategy that the optimization process is started with a relatively coarse mesh, and the mesh is adaptively refined only when it is necessary.

Various adaptive TO methods have emerged to obtain the advanced solution and improve the computational efficiency. Maute and Ramm (1995) parameterized the design space into different design patches and adaptively justified the orientations of design patches based on an adaptive mesh refinement strategy. A two-stage TO method is proposed by Lin and Chou (1999) based on the homogenization method, where a coarse finite element mesh was employed in the first stage of TO and a finer one is used in the second stage of TO with the aim of capturing a higher quality boundary. In order to improve the quality of the material boundary and reduce the number of design variables as well as enhance the accuracy of solution, an approach integrating TO with h-adaptive finite element method was presented by Costa Jr and Alves (2003). Stainko (2006) put forward an adaptive TO method based on the adaptive multilevel techniques integrating with a multigrid approach, and two regularization techniques were introduced to eliminate the mesh dependency of solutions. Relying on two error estimators corresponding to the compliance error and topological error, Bruggi and Verani (2011) proposed an adaptive strategy that provides a mesh refinement for the boundaries and coarsening for the voids. An adaptive refinement approach for TO by Wang et al. (2013) can locally refine the density point grid with a fixed finite element model under the separated density field description. Nguyen-Xuan (2017) proposed a novel adaptive algorithm for TO with polygonal meshes, and Chau et al. (2018) extended the aforementioned framework to the TO of multi-material. Liao et al. (2019) presents a triple acceleration method for TO with the aid of multilevel mesh, preconditioned conjugate-gradient method, and local-update strategy.

Most of the work mentioned above are based on traditional finite element method (FEM) using linear Lagrange shape function, which results in low numerical accuracy and stability, and these limitations can be solved by using high order Lagrange elements (Sigmund and Petersson 1998). However, higher order elements will lead to a significant increase in computational burden. Moreover, the disconnection between analysis model and geometric model is still absent, which results in accuracy problem (Wang et al. 2018b), and it is inconvenient to generate the mesh in the most of adaptive TO methods listed above. To enhance the computational efficiency for high-order elements and establish the link between analysis model and geometric model of FEA, Hughes et al. (2005) proposed isogeometric analysis (IGA), where the CAD mathematical primitives, for instance, B-splines, NURBS, are used as the shape function to represent the field unknowns of the partial differential equation (PDE). Due to its advantages in exact geometry, high accuracy of per degree of freedom (DOF), and the high efficiency for high-order elements, IGA has been used to replace the FEM for TO by many researchers (Qian 2010; Seo et al. 2010; Kumar and Parthasarathy 2011; Wang and Benson 2016a, 2016b; Hou et al. 2017; Liu et al. 2018; Wang et al. 2018b; Wang and Poh 2018; Xie et al. 2018; Wang et al. 2019; Xie et al. 2019). Qian (2013) embedded an arbitrarily shaped design domain into a rectangular domain with tensor-product B-splines representing the density field. Based on the method of asymptotic homogenization, the design of lattice materials with either isotropic or anisotropic is obtained from IGA-based TO (ITO). Lieu and Lee (2017) solved the multi-material TO problem by multi-resolution ITO (MITO) scheme, and a new variable parameter space is introduced to perform MITO. To obtain the systematic design of auxetic metamaterials, Gao et al. (2019b) developed an ITO method and obtained the material effective properties by IGA based on an energy-based homogenization method. Xu et al. (2019b) developed an IGA-based MITO method for efficiently designing the spatially graded hierarchical structures.

Similar to traditional FEM, the compromise between accuracy and efficiency still exists in all the ITO schemes mentioned above. In addition, the hanging nodes resulting in linear dependence of system equilibrium equations are required special projection technique (de Troya and Tortorelli 2018), and the computational cost is heavy for aforementioned adaptive TO methods using high-order elements as depicted in Fig. 1a. These aforementioned conflicts can be largely alleviated by the adaptive mesh refinement of IGA illustrated in Fig. 1b. The tensor product structure of B-splines or NURBS precludes local refinement, and a global refinement is enforced. To implement the mesh adaptivity of IGA, local refinement techniques are emerged, e.g., T-splines (Scott et al. 2012), hierarchical B-splines (Kraft 1997; Vuong et al. 2011; Schillinger et al. 2012; Giannelli et al. 2014), LR-splines (Johannessen et al. 2014), and hierarchical box splines (Kanduč et al. 2017). As pointed out by Hennig et al. (2016), the most promising way of implementing the local refinement of IGA is hierarchical B-splines, of which basis functions possess the rigorous proof of the linear independence from the perspective of the mathematics. Apart from the linear independence, partition of unity is another important property, which improves the numerical properties of the hierarchical basis (Giannelli et al. 2012) and is obtained from reducing the support of basis functions on coarse level. Reducing the support of basis functions is termed as the truncated operation, and then the hierarchical B-spline is changed into truncated hierarchical B-spline (THB). Two refinement strategies are devised for THB, which are termed as greedy and safe refinements, respectively (Kanduč et al. 2017). Atri and Shojaee (2018) combined THB with reproducing kernel particle method to inherit the advantages of both IGA and meshfree methods. Carraturo et al. (2019) extended THB to the application of modeling the temperature distribution for additive manufacturing processes, with the admissible mesh configuration.

Fig. 1
figure 1

A comparison in (a and b) the number of DOFs between THB-IGA and quad-tree based adaptive FEM where quadratic elements are used with identical partition scheme of the mesh

By taking the advantage of both ITO and THB, we propose a method for topology optimization using truncated hierarchical B-spline (THB-TO) on the top of SIMP method. To determine when and where the hierarchical local refinement should be proceeded for THB-TO, a geometric mark strategy and a trigger mark strategy are used to locate the regions to be refined and determine the iterative steps when a hierarchical local refinement should be triggered, respectively. Besides, the radii of the sensitivity and density filters are accordant with the hierarchical level of each active element since a relatively coarse mesh may be used and the oversize radius of the filter may lead to too many blurring elements. With the use of these filters, the sensitivity analysis is derived for compliance and compliant mechanism. Due to the consistency of design mesh and analysis mesh, the design space is locally refined simultaneously. A density inheritance is established based on the parent–child relationship of the cells belonging to consecutive levels and used to map the original design space into the new locally refined design space.

The reminder of this paper is outlined as follows. The theory corresponding to the THB-based IGA is presented in Sect. 2. Then, the mathematic models for both compliance and compliant mechanism problems are elaborated based on IGA implementing by THB in Sect. 3. Subsequently, the details of implementation of adaptive refinement strategy for THB-TO are presented in Sect. 4. To verify the effectiveness of the proposed THB-TO, several benchmarks are given in Sect. 5. Finally, this paper ends with some conclusions in Sect. 6.

2 Truncated hierarchical B-spline based IGA

This section sets forth for the adaptive isogeometric method, with the truncated hierarchical B-spline (THB) by Giannelli et al. (Giannelli et al. 2012) as the basis for the analysis model. The theoretical details are mainly originated from the definitions in (Giannelli et al. 2012; Buffa and Giannelli 2017), which consist of a sound mathematical theory for truncated hierarchical B-spline–based adaptive isogeometric method.

2.1 Hierarchical space spanned by basis on different hierarchical levels

Given a sequence of knot vectors {Ξ0Ξ1,  ⋯, ΞN − 1}, where the knot vector Ξl  with  l = 1, ⋯N − 1 is obtained by bisecting l-times from Ξ0, B-spline basis functions in function spaces Bl  with  l = 0, 1, ⋯N − 1 are constructed by the Cox-de Boor formula (Boor 1972) presented in (1).

$$ {\displaystyle \begin{array}{c}{B}_{i,\kern0.33em 0}^{\mathrm{l}}=\left\{\begin{array}{c}\kern0.33em 1,\kern1.32em if\kern0.99em {\xi}_i^l\le \xi <{\xi}_{i+p+1}^l\\ {}\kern0.33em 0,\kern1.32em otherwise\end{array}\right.\\ {}{B}_{i,p}^l\left(\xi \right)=\frac{\xi -{\xi}_i^l}{\xi_{i+p}^l-{\xi}_i^l}{B}_{i,p-1}^l\left(\xi \right)+\frac{\xi_{i+p+1}^l-\xi }{\xi_{i+p+1}^l-{\xi}_{i+1}^l}{B}_{i+1,p-1}^l\left(\xi \right)\end{array}} $$
(1)

where the \( {B}_{i,p}^l\left(\xi \right) \) is the i-th basis for a knot vector \( {\varXi}^{\mathrm{l}}=\left\{{\xi}_1^l,\kern0.33em {\xi}_2^l,\kern0.33em \cdots \cdots, \kern0.33em {\xi}_{n+p+1}^l\right\} \) and p and n denote the degree of basis and number of control points, respectively.

A nested sequence B-spline function spaces V0 ⊂ ⋯ ⊂ VN − 1 are defined on the initial domain \( {\hat{\varOmega}}^0 \), with Vl spanned by the bases of Bl. Then, let \( {\hat{\varOmega}}^0\supseteq \cdots \supseteq {\hat{\varOmega}}^{N-1} \) be a sequence of nested parametric domains, with \( {\hat{\varOmega}}^l \) representing the parametric domain of level l. Moreover, \( {\hat{\varOmega}}^l \) is assumed to be the union of the marked cells on the previous level l-1. To construct a linear independent hierarchical function space \( \mathcal{H} \) from Bl and \( {\hat{\varOmega}}^l \), a definition by Giannelli et al. (Giannelli et al. 2012) is demonstrated as follows:

  • Initialization: \( {\mathcal{H}}^0=\left\{\beta \in {B}^0:\kern0.33em \mathit{\operatorname{supp}}\kern0.33em \beta \ne \varnothing \right\} \);

  • A recursive formula: \( {\mathcal{H}}^{l+1}={\mathcal{H}}_A^{l+1}\cup {\mathcal{H}}_B^{l+1}\kern0.66em l=0,1,\cdots N-2 \), where \( {\mathcal{H}}_A^{l+1}=\left\{\beta \in {\mathcal{H}}^l:\kern0.33em \mathit{\operatorname{supp}}\kern0.33em \beta \not\subset {\hat{\varOmega}}^{l+1}\right\} \) and \( {\mathcal{H}}_B^{l+1}=\left\{\beta \in {B}^{l+1}:\kern0.33em \mathit{\operatorname{supp}}\kern0.33em \beta \subseteq {\hat{\varOmega}}^{l+1}\right\} \), with \( \mathit{\operatorname{supp}}\kern0.33em \beta =\left\{x:\kern0.33em \beta (x)\ne 0\wedge x\in {\hat{\varOmega}}^0\right\} \);

$$ \mathcal{H}={\mathcal{H}}^{N-1}. $$

An illustrative example of constructing a hierarchical function space is presented in Fig. 2, with the active functions plotted with colored solid lines and the gray solid lines representing the inactive functions.

Fig. 2
figure 2

An illustration example for constructing a hierarchical basis function space \( \mathcal{H} \) from a sequence of nested function spaces and a sequence of nested parametric domains: V0 ⊂ V1\( {V}^2\left( with\kern0.33em {V}^l spanned\kern0.33em by\kern0.33em {B}^l\kern0.33em for\kern0.33em \mathrm{l}=0,1,2\right)\kern0.33em and\kern0.33em {\hat{\varOmega}}^0=\left[0,4\right]\supseteq {\hat{\varOmega}}^1=\left[2,4\right]\supseteq {\hat{\varOmega}}^2=\left[\mathrm{2.5,4}\right] \). The original knot vector is Ξ0 = [0  0  0  1  2  3  4  4  4]. Active functions of level 0, 1, and 2 are plotted with black, blue, and magenta solid lines, respectively

2.2 Truncated operation of hierarchical B-spline basis

Partition of unity is one of the most important properties of B-splines, which is dissatisfied by the hierarchical B-splines due to the overlapping basis functions on different levels. To recover the property of partition of unity, a truncated operation is added into the B-spline representations. An efficient refinement rule is offered for the representation of s ∈ Vl in terms of the tensor-product basis Bl + 1 and formulated as follows:

$$ \mathrm{s}=\sum \limits_{\beta \in {B}^{l+1}}{\mathrm{c}}_{\beta}^{l+1}(s)\beta $$
(2)

and then the truncation of function s with respect to level l + 1 is defined as follows:

$$ {\mathrm{trunc}}^{l+1}\mathrm{s}:= \sum \limits_{\beta \in {B}^{l+1},\kern0.33em \operatorname{supp}\beta \not\subset {\hat{\varOmega}}^{l+1}\kern0.33em }{\mathrm{c}}_{\beta}^{l+1}(s)\beta $$
(3)

where \( {\mathrm{c}}_{\beta}^{l+1}(s) \) represents the coefficient used to express s by the basis function β of level l + 1. Hence, a truncated hierarchical B-spline function space \( \mathcal{TH} \) can be generated by performing the truncated operation recursively on the hierarchical basis functions in \( \mathcal{H} \) as (4). We can obtain the truncated basis as the procedure shown in Fig. 3.

$$ {\mathrm{Trunc}}^{l+1}\left(\mathrm{s}\right):= {\mathrm{trunc}}^N\Big({\mathrm{trunc}}^{N-1}\left(\cdots \left({\mathrm{trunc}}^{\mathrm{l}+1}\left(\mathrm{s}\right)\cdots \right)\right). $$
(4)
Fig. 3
figure 3

A truncated hierarchical basis function space \( \mathcal{TH} \) is obtained from performing the truncated operation on \( {B}_4^0\kern0.33em and\kern0.33em {B}_7^1 \) belonging to the hierarchical basis function space \( \mathcal{H} \) presented in Fig. 2

2.3 Numerical discretization of truncated hierarchical B-spline–based IGA

In the truncated hierarchical B-spline–based IGA, the THB basis functions in \( \mathcal{TH} \) are firstly used to map the parametric domain \( \hat{\varOmega} \) into the physical domain Ω, and then the hierarchical function space \( \mathcal{TH} \) is used to approximate the unknown field. Thereafter, the solution space is approximated by the linear combination of hierarchical basis functions with the structural response on the hierarchical active control points. A consistency in mathematical expression is kept for the geometry and field approximation, except that the coefficient varies from the coordinate to the nodal response of the hierarchical active control points, and it is formulated as follows:

$$ \Big\{{\displaystyle \begin{array}{c} geometric\; map:S\left(\xi, \eta \right)=\sum \limits_{l=0}^{N-1}\sum \limits_{{\tilde{R}}_{i,j}^l\in \mathcal{TH}}{\tilde{R}}_{i,j}^l\left(\xi, \eta \right){P}_{i,j}^l\\ {} field\ approximation:u\left(\xi, \eta \right)=\sum \limits_{l=0}^{N-1}\sum \limits_{{\tilde{R}}_{i,j}^l\in \mathcal{TH}}{\tilde{R}}_{i,j}^l\left(\xi, \eta \right){u}_{i,j}^l\end{array}}\kern0.5em with\;{\tilde{R}}_{i,j}^l\left(\xi, \eta \right)= Trunc\left({R}_{i,j}^l\left(\xi, \eta \right)\right) $$
(5)

where S(ξ, η) denotes a physical surface, \( {P}_{i,j}^l \) represents the control point associated with the THB basis function \( {\overset{\sim }{R}}_{i,j}^l \) of level l in \( \mathcal{TH} \)function space, and u(ξ, η) is the field of structural response approximated by the nodal response \( {u}_{i,j}^l \) of the associated control point of level l. It is noted that \( {\overset{\sim }{R}}_{i,j}^l \) is a truncated duplication of a bivariate NURBS basis function \( {R}_{i,j}^l\left(\xi, \eta \right) \) in the form of

$$ {R}_{i,j}^l\left(\xi, \eta \right)=\frac{B_{i,p}^l\left(\xi \right){B}_{\mathrm{j},q}^l\left(\eta \right){\omega}_{ij}^l}{\sum_{\hat{i}=1}^{n^l}{\sum}_{\hat{j}=1}^{m^l}{B}_{\hat{i},p}^l\left(\xi \right){B}_{\mathrm{j}\hat{\mkern6mu}, q}^l\left(\eta \right){\omega}_{\hat{i}\hat{j}}^l} $$
(6)

In (6), \( {\omega}_{ij}^l \) is the positive weight for the control point \( {P}_{i,j}^l \), \( {B}_{i,p}^l\left(\xi \right) \) and \( {B}_{\mathrm{j},q}^l\left(\eta \right) \) represent the univariate B-spline basis functions in two parametric directions of level l, with p and q denoting the degree of the univariate B-spline basis functions. nl and ml are the number of control points for the parametric ξ and η directions, respectively. Due to the tensor product structure of bivariate and trivariate NURBS basis function, the truncated operation for univariate B-spline basis elaborated in Sect. 2.2 is a straightforward extension to the bivariate and trivariate NURBS cases.

Taking two-dimensional linear elasticity problem into account in the context of THB-based IGA, the system stiffness matrix is obtained from accumulating the submatrices of all hierarchical levels (Hennig et al. 2016; Garau and Vázquez 2018) as follows:

$$ K={\sum}_{\mathrm{l}=0}^{N-1}\left({C}^l\right){K}^l{C}^l $$
(7)

where K is the global stiffness matrix, the stiffness submatrix of level l is represented by Kl, and Cl denotes the transformation matrix used to map the hierarchical basis functions up to level l into the basis functions of Bl. Besides, the stiffness submatricesis formulated as follows:

$$ {K}^l=\sum \limits_{e=1}^{N_e^l}{K}_e^l\kern0.66em with\kern0.33em {K}_e^l=\sum \limits_{i=1}^3\sum \limits_{j=1}^3\left\{{B}^T\left({\xi}_i,{\eta}_j\right) DB\Big({\xi}_i,{\eta}_j\Big)\left|{J}_1\left({\xi}_i,{\eta}_j\right)\right|\left|{J}_2\left({\xi}_i,{\eta}_j\right)\right|{\omega}_i{\omega}_j\right\} $$
(8)

where \( {K}_e^l \) is elemental stiffness matrix of the e-th active element of level l, \( {N}_e^l \) denotes the number of active elements of level l, B is the strain–displacement matrix, D represents the stress-strain matrix, and J1 and J2 represent the Jacobi matrices of the mapping from physical domain to parametric domain and the transformation from parametric space to the bi-unit parent element, respectively. All Gaussian points for all active elements of a hierarchical IGA mesh and 3 × 3 G quadrature points for the yellow active element of level 2 are illustrated in Fig. 4.ωi and ωj are the quadrature weights associated with the parametric coordinate (ξi, ηj) of (i, j)th Gauss quadrature point. For the red hierarchical control points indexed by I and J in Fig. 4, the corresponding basis functions of level 0 are non-vanishing on the yellow active element of level 2. Therefore, the stiffness indexed by I and J with respect to the yellow active element is calculated by (9).

$$ {K}_{I,J\mid {\varOmega}_{\mathrm{e}}}={\int}_{\varOmega_{\mathrm{e}}}{\left({B}_I\right)}^TD{B}_J\mathrm{d}{\varOmega}_{\mathrm{e}}={\int}_{\varOmega_{\mathrm{e}}}\left[\begin{array}{c}{\overset{\sim }{R}}_{I,\mathrm{x}}^0\kern0.99em 0\kern1.32em {\overset{\sim }{R}}_{I,\mathrm{x}}^0\\ {}\kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{I,\mathrm{y}}^0\kern0.66em {\overset{\sim }{R}}_{I,\mathrm{y}}^0\end{array}\right]\kern0.33em \cdotp \kern0.33em D\cdotp \left[\begin{array}{c}{\overset{\sim }{R}}_{J,\mathrm{x}}^0\kern0.99em 0\kern1.32em {\overset{\sim }{R}}_{J,\mathrm{x}}^0\\ {}\kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{J,\mathrm{y}}^0\kern0.66em {\overset{\sim }{R}}_{J,\mathrm{y}}^0\end{array}\right]\mathrm{d}{\varOmega}_{\mathrm{e}} $$
(9)
Fig. 4
figure 4

A hierarchical mesh with three different hierarchical levels using \( \mathcal{TH} \) basis function space depicted in Fig. 3 for each parametric direction, where the red and magenta points are active control points and the black points are Gaussian points for active elements. The magenta points represent the active basis functions non-vanishing on the yellow active element of level 2, and the corresponding control points of the yellow active element are in blue

By exploiting both the mathematics expressions shown in Fig. 4 for \( {\tilde{R}}_I^0 \) and \( {\tilde{R}}_J^0 \), the partial derivatives of \( {\tilde{R}}_I^0 \) and \( {\tilde{R}}_J^0 \) with respect to physical coordinates are written as follows:

$$ {\displaystyle \begin{array}{l}\left[\begin{array}{c}{\overset{\sim }{R}}_{I,\mathrm{x}}^0\kern0.99em 0\kern1.32em {\overset{\sim }{R}}_{I,\mathrm{x}}^0\\ {}\kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{I,\mathrm{y}}^0\kern0.66em {\overset{\sim }{R}}_{I,\mathrm{y}}^0\end{array}\right]=\kern0.5em \left[\begin{array}{c}{C}_I^2\kern0.66em 0\\ {}\kern0.33em 0\kern0.66em {C}_I^2\end{array}\right]\kern0.5em {\left[\begin{array}{c}{\overset{\sim }{R}}_{1,\mathrm{x}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{x}}^2\kern0.66em 0\kern0.99em \cdots \kern0.66em 0\\ {}\kern0.33em 0\kern0.99em \cdots \kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{1,\mathrm{y}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{y}}^2\\ {}{\overset{\sim }{R}}_{1,\mathrm{x}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{x}}^2\kern0.33em {\overset{\sim }{R}}_{1,\mathrm{y}}^2\cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{y}}^2\end{array}\right]}^T\\ {}{C}_I^2=\left[0.0352\kern0.66em 0.0117\kern0.66em 0\kern0.66em 0.0117\kern0.66em 0.0039\kern0.66em 0\kern0.66em 0\kern0.66em 0\kern0.66em 0\right]\\ {}\begin{array}{l}\left[\begin{array}{c}{\overset{\sim }{R}}_{J,\mathrm{x}}^0\kern0.99em 0\kern1.32em {\overset{\sim }{R}}_{J,\mathrm{x}}^0\\ {}\kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{J,\mathrm{y}}^0\kern0.66em {\overset{\sim }{R}}_{J,\mathrm{y}}^0\end{array}\right]=\kern0.5em \left[\begin{array}{c}{\overset{\sim }{R}}_{1,\mathrm{x}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{x}}^2\kern0.66em 0\kern0.99em \cdots \kern0.66em 0\\ {}\kern0.33em 0\kern0.99em \cdots \kern0.66em 0\kern0.99em {\overset{\sim }{R}}_{1,\mathrm{y}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{y}}^2\\ {}{\overset{\sim }{R}}_{1,\mathrm{x}}^2\kern0.33em \cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{x}}^2\kern0.33em {\overset{\sim }{R}}_{1,\mathrm{y}}^2\cdots \kern0.33em {\overset{\sim }{R}}_{9,\mathrm{y}}^2\end{array}\right]\kern0.5em {\left[\begin{array}{c}{C}_J^2\kern0.66em 0\\ {}\kern0.33em 0\kern0.66em {C}_J^2\end{array}\right]}^T\\ {}{C}_J^2=\left[0.1406\kern0.66em 0.0469\kern0.66em 0\kern0.66em 0.1406\kern0.66em 0.0469\kern0.66em 0\kern0.66em 0.1172\kern0.66em 0.0391\kern0.66em 0\right]\end{array}\end{array}} $$
(10)

Substituting (10) into (9), (9) is reformulated as:

$$ {K}_{I,J\mid {\varOmega}_{\mathrm{e}}}=\left[\begin{array}{c}{C}_I^2\kern0.66em 0\\ {}\kern0.33em 0\kern0.66em {C}_I^2\end{array}\right]{K}_{\mathrm{e}}^2{\left[\begin{array}{c}{C}_J^2\kern0.66em 0\\ {}\kern0.33em 0\kern0.66em {C}_J^2\end{array}\right]}^T $$
(11)

where \( {K}_{\mathrm{e}}^2 \)represents the yellow active elemental stiffness matrix.

3 Topology optimization using truncated hierarchical B-spline–based IGA (THB-TO)

The mathematics models for two different types of TO problem are firstly demonstrated integrating the truncated hierarchical B-spline–based IGA (THB-IGA). Afterwards, the sensitivity analysis is derived for these optimization models in terms of the refinement matrix between hierarchical bases, where an adaptively adjusted sensitivity and density filter are incorporated into sensitivity analysis to avoid checkboard pattern (Sigmund and Petersson 1998; Sigmund 2001; Andreassen et al. 2011) and narrow down the gray transitional region.

3.1 TO problems based on THB-IGA using SIMP model (THB-TO)

The minimization structural compliance and maximizing the output port displacement of a compliant mechanism are the objectives of TO problems; the associated mathematics models are formulated based on THB-IGA, where the SIMP model is used to determine the elastic modulus of each active element.

3.1.1 Minimum compliance

Seeking the optimal layout of material density \( \overline{x} \) is the goal of the minimum compliance problem, where a minimizing structural deformation is obtained under the specified support and loading condition within a prescribed design domain. The structural deformation is measured by the structural compliance, which is defined as the load multiplying the associated displacement and formulated as follows:

$$ \mathrm{c}\left(\overline{x}\right)={f}^T\cdot u\left(\overline{x}\right) $$
(12)

where f is termed as the vector of nodal forces and \( u\left(\overline{x}\right) \) represents the corresponding vector of nodal displacements. For the hierarchical mesh presented in Fig. 5, the mathematics model for compliance minimization problem can be stated as (13), with a volume constraint incorporated.

$$ {\displaystyle \begin{array}{ll}& find\;\overline{x}={\left({x}_1^1,\cdots {x}_{N^1}^1,\cdots, {x}_1^{N^1},\cdots {x}_{N^{N-1}}^{N-1}\right)}^T\left(l=0,1,\cdots N-1\right)\\ {}& \mathit{\operatorname{minimize}}\;c\left(\overline{x}\right)={f}^T\cdot u\left(\overline{x}\right)=\sum \limits_{l=0}^{N_0-1}\sum \limits_{e=1}^{N^l}{E}_e^l\left({x}_e^l\right){\left({u}_e^l\left(\overline{x}\right)\right)}^T{K}_e^l{u}_e^l\left(\overline{x}\right)\\ {}s.t.& \\ {}& K\left(\overline{x}\right)\cdot u\left(\overline{x}\right)=f\\ {}& with\kern0.48em K=\left(\sum \limits_{l=0}^{N_0-1}{\left({C}^l\right)}^T{K}^l{C}^l\right)\kern0.50em \ where\kern0.66em {K}^l=\sum \limits_{e=1}^{N_e^l}{E}_e^l\left({x}_e^l\right){K}_e^l\\ {}& \sum \limits_{l=0}^{N-1}\sum \limits_{e=1}^{N^l}{x}_e^l{V}_e^l\le \overline{V},\\ {}& \overline{x}\subset \mathcal{X},\kern0.45em \mathcal{X}=\left\{\overline{x}\in {\mathbb{R}}^n:0\le \overline{x}\le 1\right\}\end{array}} $$
(13)
Fig. 5
figure 5

An illustration for the design variables corresponding to the active elements in a hierarchical mesh

In (13), \( \overline{x} \) is the union of material densities of all active elements of the hierarchical mesh, N-1isthe maximum hierarchical levels of the hierarchical mesh, Nl denotes the number of active elements of level l, \( c\left(\overline{x}\right) \) represents the structural compliance, \( {\mathrm{x}}_e^l \) and \( {E}_e^l\left({x}_e^l\right) \) are termed as the material density of the e-th active element of level l and the associated elastic modulus defined by SIMP model presented in (14). \( {u}_e^l\left(\overline{x}\right) \) and \( {K}_e^l \) denote the vector of displacements and the stiffness matrix of the e-th active NURBS element on level l, respectively. A transformation matrix Cl is used to project the stiffness sub-matrix Kl onto the global stiffness matrix \( K\left(\overline{x}\right) \). \( {V}_e^l \) is the volume of the e-th active NURBS element, \( \overline{V} \) denotes the upper bound of the volume fraction of solid material, \( \mathcal{X} \) is termed as the admissible design space where \( \overline{x} \) belongs.

$$ {E}_e^l\left({x}_e^l\right)={E}_{min}+{\left({x}_e^l\right)}^p\left({E}_0-{E}_{min}\right),\kern1.32em {x}_e^l\in \left[0,1\right] $$
(14)

where Emin represents the non-zero elastic modulus for the void material to avoid the singularity of the stiffness matrix and E0 denotes the elastic modulus of the solid material, p (p = 3) is the penalty factor.

3.1.2 Compliant mechanism synthesis

Taking the role of transforming force, displacement, or energy, a morphing structure undergoing elastic deformation is referred to as the compliant mechanism (Bruns and Tortorelli 2001; Liu and Tovar 2014). For sake of simplicity, the objective of a compliant mechanism design is the output port displacement. Therefore, the optimization problems under the framework of THB-TO can be stated as follows:

$$ {\displaystyle \begin{array}{ll}& find\;\hat{x}={\left(\hat{x},\cdots {\hat{x}}_{N^1}^1,\cdots, {\hat{x}}_1^{N^1},\cdots {\hat{x}}_{N^{N-1}}^{N-1}\right)}^T\left(l=0,1,\cdots N-1\right)\\ {}& \mathit{\operatorname{minimize}}\;c\left(\hat{x}\right)=-{u}_{out}\left(\hat{x}\right)=-{L}^Tu\left(\hat{x}\right)={u}_d{\left(\hat{x}\right)}^TK\left(\hat{x}\right)u\left(\hat{x}\right)=\sum \limits_{l=0}^{N_0-1}\sum \limits_{e=1}^{N^l}{E}_e^l\left({\hat{x}}_e^l\right){\left({u}_e^l\left(\hat{x}\right)\right)}^T{K}_e^l{u}_e^l\left(\hat{x}\right)\\ {}s.t.& \\ {}& K\left(\hat{x}\right)\cdot u\left(\hat{x}\right)=f\\ {}& with\kern0.48em K=\left(\sum \limits_{l=0}^{N_0-1}{\left({C}^l\right)}^T{K}^l{C}^l\right)\kern0.50em \ where\kern0.43em K=\sum \limits_{e=1}^{N_e^l}{E}_e^l\left({\hat{x}}_e^l\right){K}_e^l\\ {}& \sum \limits_{l=0}^{N-1}\sum \limits_{e=1}^{N^l}{\hat{x}}_e^l{V}_e^l\le \overline{V},\\ {}& \overline{x}\subset \mathcal{X},\kern0.45em \mathcal{X}=\left\{\overline{x}\in {\mathbb{R}}^n:0\le \overline{x}\le 1\right\}\end{array}} $$
(15)

where \( {u}_{out}\left(\hat{x}\right) \) is the output port displacement, L is a unit vector with one at the degree of freedom (DOF) of the output point, \( {u}_d\left(\hat{x}\right) \) denotes a global adjoint vector as the solution of an adjoint problem formulated as (16), \( {u}_{e,d}^l\left(\hat{x}\right) \) represents the vector of displacements of the control points with respect to the e-th active NURBS element of level l.

$$ K\left(\hat{x}\right)\cdot {u}_d\left(\hat{x}\right)=-L $$
(16)

3.2 Sensitivity analysis

A key ingredient of the sensitivity analysis for the proposed THB-TO is transforming the global displacement vector \( u\left(\overline{x}\right)\kern0.33em \left(u\left(\hat{x}\right)\right) \) of the hierarchical active control points (the red and magenta points shown in Fig. 4) into the local displacement vector \( {u}_e^l\left(\overline{x}\right)\kern0.33em \left({u}_e^l\left(\hat{x}\right)\right) \) of control points (the blue points depicted in Fig. 3) of each active element. The refinement matrix Cl between hierarchical bases (Hennig et al. 2016; Garau and Vázquez 2018) presented as (17) can be used to obtain \( {u}_e^l\left(\overline{x}\right)\kern0.33em \left({u}_e^l\left(\hat{x}\right)\right) \) from \( u\left(\overline{x}\right)\kern0.33em \left(u\left(\hat{x}\right)\right) \).

$$ {\displaystyle \begin{array}{c}{u}^l\left(\overline{x}\right)={C}^lu\left(\overline{x}\right)\kern0.66em \mathrm{l}=0,\cdots, \mathrm{N}-1\\ {}{u}_e^l\left(\overline{x}\right)=\Big({}_{u^l}={C}_{\mathrm{e}}^lu\left(\overline{x}\right)\end{array}} $$
(17)

where \( {C}_{\mathrm{e}}^l \) is the sub-matrix of Cl corresponding to the basis functions non-vanishing on the e-th active element of level l.

Then, the sensitivity of the objective function of minimum compliance and compliant mechanism are reformulated as (18) and (19), respectively.

$$ \frac{\partial c\left(\overline{x}\right)}{\partial {x}_e^l}=-p{\left({x}_e^l\right)}^{p-1}\left({E}_0-{E}_{min}\right){\left({C}_e^lu\left(\overline{x}\right)\right)}^T{K}_e^l\left({C}_e^lu\left(\overline{x}\right)\right) $$
(18)
$$ \frac{\partial c\left(\hat{x}\right)}{\partial {\hat{x}}_e^l}=p{\left({\hat{x}}_e^l\right)}^{p-1}\left({E}_0-{E}_{min}\right){\left({C}_e^l{u}_d\left(\hat{x}\right)\right)}^T{K}_e^l\left({C}_e^lu\left(\hat{x}\right)\right)\kern0.33em with\kern0.33em {u}_{e,d}^l\left(\hat{x}\right)={C}_e^l{u}_d\left(\hat{x}\right) $$
(19)

To ensure the existence of the solution and avoid the checkboard pattern, mesh-independence filter (MIF) firstly proposed by Sigmund (Sigmund 2001; Sigmund and Maute 2013) is used, where the design sensitivity of an element is modified and depended on a weighted average over its neighboring elements inside the filter area. For adaptive topology optimization using triangular elements, Stainko (Stainko 2006) devised two filters termed as MIF and regularized intermediate density control filter, which are used to restrict the design space. Bruggi and Verani (Bruggi and Verani 2011) used a MIF with the same filter radius for all refinement steps, which results in a checkerboard phenomenon, since the filter radius is shorter than the distance between the centers of the adjacent elements of coarse mesh. Nguyen (Nguyen-Xuan 2017) applied the same filter radius rmin to all refinement loops, which is accordant with the initial mesh. However, filter radius rmin accordant with the initial mesh leads to a larger the gray transitional region in the optimal design because a relatively coarse mesh may be used. To narrow down the gray transitional region and avoid the checkboard pattern, the filter radius \( {\mathrm{r}}_{min}^l \) is adaptively adjusted for the hierarchical mesh of THB-TO with a lower bound (see Fig. 6) and formulated as follows:

$$ {\mathrm{r}}_{min}^{\mathrm{l}}=\max \left(\lambda {h}^{\mathrm{l}},{\mathrm{r}}_{lower}\right)\kern0.99em \mathrm{l}=0,\cdots \mathrm{N}-1 $$
(20)

where hl is the element size of the active elements of level l, λis a constant parameter with λ > 1, rlower is the lower bound for the filter radius to avoid the checkboard pattern for active elements on the finer mesh with very small element size.

Fig. 6
figure 6

An illustration of the adaptively adjusted sensitivity or density filter for a hierarchical mesh with three different hierarchical levels

On the top of (20), a sensitivity filter is added into (18) for minimum compliance problem, and it is rewritten as follows:

$$ \frac{\partial \hat{c}\left(\overline{x}\right)}{\partial {x}_e^l}=\frac{1}{x_e^l\sum \limits_{k=0}^{N_0-1}\sum \limits_{f=1}^{N^l}{H}_f^k}\sum \limits_{k=0}^{N_0-1}\sum \limits_{f=1}^{N^l}{H}_f^k{x}_f^k\frac{\partial \hat{c}\left(\overline{x}\right)}{\partial {x}_f^k} $$
(21)

where \( {H}_f^k \) is the weight factor corresponding to the f-th active element of level k and formulated as follows:

$$ {H}_f^k=\max \left(0,{r}_{min}^l- dist\left(e,f\right)\right) $$
(22)

with dist(e, f) representing the centroid distance between the e-th active element of level l and the f-th active element of level k.

For compliant mechanism problem, a density filter is incorporated in (Liu and Tovar 2014) to remove checkerboard phenomenon. Similar to the sensitivity filter presented for compliance problem, an adaptively changed density filter is used in compliant problem and written as follows:

$$ {\hat{x}}_e^l=\frac{\sum \limits_{k=0}^{N_0-1}\sum \limits_{f=1}^{N^l}{H}_f^k{x}_f^k}{\sum \limits_{k=0}^{N_0-1}\sum \limits_{f=1}^{N^l}{H}_f^k} $$
(23)

with \( {H}_f^k \) defined in (22). Then, the sensitivity of compliant problem with respect to an arbitrary design variable \( {x}_e^l \) can be obtained by the chain rule and stated as follows:

$$ \frac{\partial c\left(\hat{x}\right)}{\partial {x}_e^l}=\sum \limits_{k=0}^{N_0-1}\sum \limits_{f=1}^{N^l}\frac{\partial c\left(\hat{x}\right)}{\partial {\hat{x}}_k^f}\frac{\partial {\hat{x}}_k^f}{\partial {x}_e^l} $$
(24)

where \( \partial c\left(\hat{x}\right)/\partial {\hat{x}}_k^f \) and \( \partial {\hat{x}}_k^f/\partial {x}_e^l \) are obtained from (19) and (23), respectively.

4 Implementation of hierarchical local refinement algorithm for THB-TO

This section firstly presents the mark strategy to implement the hierarchical local refinement for THB-TO. Then, the locally refined design space with respect to the adaptively refined hierarchical mesh is constructed and initialized by the design space of the original hierarchical mesh by means of a density field inheritance.

4.1 Mark strategy for THB-TO

For the proposed THB-TO, the mark strategy plays an important role in implementing the hierarchical local refinement for the associated analysis and design models. The mark strategy incorporates two parts: the first one is the step criterion Mstep and the other one is geometric mark criteria Mgeometric, where Mstep is used as a trigger of hierarchical local refinement for each iterative step during the course of THB-TO, and Mgeometric determines the active elements of the hierarchical mesh marked to be refined or not.

To determine the iterative steps with a hierarchical local refinement performed on the hierarchical mesh of THB-TO, the step criterion Mstep is put forward similar to the strategy used in (de Troya and Tortorelli 2018) and formulated as follows:

$$ {M}_{step,k}=\left\{\begin{array}{c}\kern0.99em 1,\kern1.98em if\kern0.33em \max \left( abs\left({\overline{x}}_k-{\overline{x}}_{k-1}\right)\right)\le to{l}_{AMR}\kern0.33em \left(k\ge 2\right)\\ {}\kern0.99em 0,\kern6.599999em otherwise\end{array}\right. $$
(25)

where Mstep, k represents the logical value of hierarchical local refinement at the k-th iterative step (1 represents the hierarchical local refinement to be triggered and 0 for not). With a given initial value, tolAMR is the tolerance for the largest variation over design variables of two consecutive iterative step and updated by halving its value once a hierarchical local refinement is performed.

The geometric mark strategy Mgeometric used for THB-TO similar to the strategies in (Wang et al. 2013; Nguyen-Xuan 2017) is based on an error indicator \( {\varTheta}_{\rho }=\left\{{\varTheta}_{\rho}^{\mathrm{e},l}\right\} \) and formulated as (26). Θρ is used to locate the regions with the largest variation of density material, which is usually close to the structural interface due to the active element either having material or not at interface regions.

$$ {M}_{geometric,\mathrm{e}}^l=\left\{\begin{array}{c}\kern0.66em 1,\kern0.99em if\kern0.33em {\varTheta}_{\rho}^{\mathrm{e},l}\le \theta \max \left({\varTheta}_{\rho}\right)\kern0.99em for\kern0.33em some\kern0.66em \theta \in \left(0,1\right)\\ {}\kern0.66em 0,\kern6.27em otherwise\end{array}\right.\kern0.33em $$
(26)

In (26),\( {\varTheta}_{\rho}^{\mathrm{e},l} \) is the variation of material density between the e-th active elements of level l and its adjacent active elements, which is computed as follows:

$$ {\left.{\varTheta}_{\rho}^{\mathrm{e},l}\right|}_{\varOmega_e^l\in \varOmega }={\sum}_{\mathrm{i}=1}^{n_{edge}^{e,l}}{\left({\left.{\mathrm{x}}_e^l-{\mathrm{x}}_j^k\right|}_{\varOmega_j^k\in \varOmega}\right)}_{\varGamma_i^{e,l}}^2\kern0.99em $$
(27)

where \( {n}_{edge}^{e,l} \) represents the number of edges of the e-th active elements of level l and \( {\left.{\mathrm{x}}_j^k\right|}_{\varOmega_j^k\in \varOmega } \) is the elemental density of the j-th active elements of level k, which shares a common edge \( {\varGamma}_i^{e,l} \) with \( {\mathrm{x}}_e^l \).

Illustrations for the geometric mark strategy and the calculation of the variation of material density \( {\varTheta}_{\rho}^{\mathrm{e},l} \) defined in (26) are depicted in Figs. 7 and 8, respectively.

Fig. 7
figure 7

An illustration for the geometric mark strategy Mgeometric used for THB-TO

Fig. 8
figure 8

An illustrative example for computing the variation of material density \( {\varTheta}_{\rho}^{\mathrm{e},l} \)

4.2 A locally refined design space

It is noted that the design variables for THB-TO consist of the material densities of all active elements and the material density is chosen as a constant for each active element. Due to the consistency between analysis model and design model in THB-TO, the design space for THB-TO is refined locally along with the locally refined computational hierarchical mesh. Once an active element marked to be refined, the associated design variable is removed from the design space and the densities of its four children are added into the design space for two-dimensional TO problems. Based on the parent–child relationship between marked elements and the newly activated elements in the adaptively refined hierarchical mesh, a density field inheritance depicted in Fig. 9 is used to initialize the new added design variables by the design variables associated with their parent elements. Besides, the design variables of the active elements not marked to be refined remain unchanged. The construction of a locally refined design space from an initial design space is demonstrated in Fig. 9.

Fig. 9
figure 9

A refined design space by the density inheritance from the initial design space for THB-TO

5 Numerical examples

To validate the effectiveness and efficiency of the proposed THB-TO, five benchmarks are taken into consideration, which consist of three minimum compliance and two compliant mechanism problems. All the physical and geometric parameters for these benchmarks are chosen as the dimensionless constants since numerical performance is mainly concerned. The elastic modulus of solid and void material are E0 = 1  and  Emin = 1e − 9, the Poisson’s ratio of solid and void material are chosen as ν = 0.3. Optimality criteria (OC) is used as the optimizer for THB-TO without special explanation, and mathematical programming methods, such as MMA (Svanberg 1987), could be used as the optimizer for the proposed method according to our numerical experience. The operating environment for the benchmarks is a workstation where the intel core is Xeon(R) Gold 5120 CPU @ 2.20 GHz 2.19 GHz, the RAM is 64 GB, the OS is Windows 10, and the software environment is MATLAB 2016a. Besides, the number of the max iterations is set to 300, and the convergence criteria are \( {\varsigma}_{\mathrm{k}}=\max \left( abs\left({\overline{x}}_k-{\overline{x}}_{k-1}\right)\right)\le 0.01 \) for all examples. The parameter θ for geometric mark strategy is initialized to 0.001 in all cases.

5.1 Minimum compliance problems

Three benchmarks including two-dimensional (2D) Michell structure, 2D quarter annulus, and three-dimensional (3D) cantilever are presented in this section. The parameters of the radius of the sensitivity filter defined in (20) are chosen as λ = 1.2  ,  rlower = 0.05for both 2D and 3D TO problems. As for the mark strategy presented for THB-TO, the parameter tolAMR is initialized to 0.05 and 0.04 for 2D and 3D TO problems, respectively.

5.1.1 2D Michell structure

The well-known 2D Michell structure is used to examine the effectiveness of the THB-TO approach. The associated design domain and boundary condition as well as the volume constraint are illustrated in Fig. 10, where the load f is applied to the middle point of the bottom edge, the right-bottom corner is subjected to a simply supported constraint, the left-bottom corner is fixed, and the prescribed volume fraction is set to 0.5. Besides, the ratio of the width versus to the height of the design domain is equaling to 2. To discretize the design domain, a uniform NURBS mesh with the size of 26 × 13 is used and termed as the initial hierarchical mesh. The elemental design variables corresponding to the initial hierarchical mesh are initialized by the prescribed volume fraction \( \overline{V}=0.5 \).

Fig. 10
figure 10

The 2D Michell structure problem setting

By means of the proposed THB-TO for compliance problem, several intermediate designs and the converged design of Michell structure are presented in Fig. 11, where the intermediate designs are selected in terms of the iterative steps with a local hierarchical refinement performed. From the results shown in Fig. 11, it is easy to find that the resolution of the optimized design is improved along with the increase of the maximum hierarchical level of the hierarchical mesh. Four different hierarchical meshes with different maximum hierarchical levels are illustrated in Fig. 12, where the elements located in the neighborhood of the structural boundaries are refined. According to the results presented in both Figs. 11 and 12, the proposed mark strategy is effective to conduct the hierarchical local refinement, and the proposed adaptively adjusted MIF can avoid the checkboard pattern for the Michell structure. Figure 13 depicts the convergence history for describing the variations of objective function and volume fraction of solid material. It is observed that the curve of objective function is smooth, except that a small mutation of objective function occurs at the iterative steps labeled by dashed lines in Fig. 13. The aforementioned phenomenon is resulted from the fact that the transmission path of the external load is changed abruptly once the computational mesh is locally refined. Moreover, the comparisons of the degree of freedoms (DOFs) and the number of design variables (abbreviated by numvariables in this paper) between hierarchical local and global refinement are shown in Fig. 14, and the associated improvements of replacing the global refinement by hierarchical local refinement are presented in Table 1. The results illustrated in Fig. 14 and Table 1 reveal that both DOFs and numvariables are increasingly reduced with the increase of the hierarchical levels of the hierarchical mesh, which will lead to the increasingly reduced computational burden associated to FEA and sensitivity analysis compared with global refinement. Furthermore, Table 2 compares THB-TO with traditional SIMP method working on the finest uniform NURBS mesh with the size of 208 × 104, where the computing time is reduced by 79.0%. Hence, the proposed THB-TO can improve the structural boundary accuracy with an affordable computational cost than global refinement.

Fig. 11
figure 11

Illustration of the initial and some intermediate as well as the converged designs, with c representing the value of objective function and N denoting the number of hierarchical levels of the hierarchical mesh associated to the design

Fig. 12
figure 12

Four different hierarchical meshes along with the optimization process of Michell structure by THB-TO, corresponding to four different iterative step intervals presented on the top of each hierarchical mesh

Fig. 13
figure 13

The convergence history for Michell structure loaded on the middle of the bottom edge

Fig. 14
figure 14

The comparisons of both DOFs and numvariables between local refinement using THB and global refinement

Table 1 Improvements in DOFs and numvariables by replacing global with hierarchical local refinement.0
Table 2 Computing time of the overall optimization process

5.1.2 2D quarter annulus

To verify the validity of the proposed THB-TO for the curved design domain, a 2D quarter annulus is used as a benchmark, whose geometry and boundary condition as well as the physical parameters is illustrated in Fig. 15. A concentrated load is applied to the left-top corner, the bottom edge is fixed, and the volume fraction \( \overline{V} \) is set to 0.5.

Fig. 15
figure 15

The problem setting for a 2D quarter annulus

Figure 16 a presents the initial design of the structural topology with all design variables equaling to the prescribed volume fraction \( \overline{V}=0.5 \). Besides, Fig. 16 makes an illustration for some intermediate designs at the iterative steps performing a hierarchical local refinement and the converged topology. Then, the computational hierarchical meshes are depicted in Fig. 17 corresponding to four different iterative step intervals, where a uniform mesh with the size of 10 × 30 is used as the initial hierarchical mesh. Based on the results shown in Figs. 16 and 17, it arrives at a conclusion that the mark strategy is valid for current benchmark, and the resolution of optimized result is largely improved once a hierarchical mesh with a larger maximum hierarchical level is used (for instance N = 4), as well as the MIF proposed in this work is effective to this example. Figure 18 presents several topologies for initial design and three intermediate designs where a global refinement is performed for the corresponding iterative steps of ITO, as well as the final converged design. It is noted that the strategy triggering the global refinement and the initial computational mesh are identical to those used in THB-TO. From the results presented in Figs. 16 and 18, it finds that the converged design by THB-TO is same to the result obtained from ITO under continuous global refinement and the iterations of THB-TO is reduced by 56.8% compared with ITO with continuous global refinement. Table 3 makes a comparison between hierarchical local refinement and global refinement in DOFs and numvariables, and it finds that the hierarchical local refinement outperforms the global refinement in terms of the computational efficiency since the decrease of DOFs and numvariables are respectively up to 64.1% and 55.6% when the number of refinements equals to 3. Figures 19 and 20 present the convergence histories for the benchmark of 2D quarter annulus optimized by THB-TO and ITO with continuous global refinement, respectively. Therefore, the proposed THB-TO outperforms ITO with continuous global refinement in terms of numerical efficiency and is valid for TO problems within a given curved design domain.

Fig. 16
figure 16

Several topologies for the 2D quarter annulus optimized with THB-TO: a for initial design; b for the iterative step where the first hierarchical local refinement is performed; b for the iterative step with the second hierarchical local refinement conducted; c for the iterative step with the third hierarchical local refinement performed; and d for the converged design

Fig. 17
figure 17

Illustration for four different hierarchical computational meshes: a for 1 ≤ Iteraions ≤ 20; b for 21 ≤ Iteraions ≤ 57; c for 58 ≤ Iteraions ≤ 114; and d for 115 ≤ Iteraions ≤ 124

Fig. 18
figure 18

Several topologies for the 2D quarter annulus optimized with ITO under continuous global refinement: a for initial design with an identical mesh presented in Fig. 17a; b for the iterative step where the first global refinement is performed; b for the iterative step with the second global refinement conducted; c for the iterative step with the third global refinement performed; and d for the converged design

Table 3 The comparisons between hierarchical local and global refinement in DOFs and numvariables
Fig. 19
figure 19

Convergence history for 2D quarter annulus by THB-TO

Fig. 20
figure 20

Convergence history for 2D quarter annulus by ITO under continuous global refinement

5.1.3 3D cantilever

A 3D cantilever benchmark is used to validate the effectiveness of the proposed THB-TO in solving the 3D minimization compliance problems. The associated problem configurations are presented in Fig. 21, where the dimensions and the boundary condition of the design domain are prescribed. Moreover, the volume fraction of the solid material \( \overline{V} \) is specified to 0.4. An initial relatively coarse NURBS mesh with the size of 20 × 20 × 2 is used to discretize the design domain. Besides, the design variables associated to the initial NURBS computational mesh are initialized to 0.4.

Fig. 21
figure 21

Illustration of the problem setting for a 3D cantilever

Figure 22 presents the initial design and two intermediate designs as well as the final optimized structure. The structural boundaries of these four results are becoming smooth along with the increasing iterations of THB-TO, and the corresponding transition gray elements on structural boundary are reduced as well. Thus, the proposed THB-TO can effectively obtain a finer resolution for the 3D structural boundary in the way of refining the elements in the neighborhood of the structural boundary locally. Besides, the convergence history and the evolution of hierarchical mesh are depicted in Fig. 23. It is shown that the proposed mark strategy is effective to capture the 3D structural boundary and implement the hierarchical local refinement of THB-TO; the extension of THB-TO to 3D TO problem is valid and stable in terms of the variation curves of both objective function and volume fraction. The DOFs and numvariables are compared between hierarchical local and global refinement in Table 4. It is found that DOFs and numvariables are respectively reduced by 68.8 and 58.2% by replacing global refinement with hierarchical local refinement, when the number of refinements equals to 2. Also, these improvements are increased with the increase of the number of refinements. Due to the improved structural quality at a comparable reduced computational burden than global refinement, it is concluded that the proposed THB-TO is a very effective tool to solve the 3D TO problems of minimization compliance.

Fig. 22
figure 22

Four designs for the 3D cantilever: a for initial design; b for Iterations = 14; cIterations = 26; d for the converged design with Iterations = 34

Fig. 23
figure 23

Convergence history and evolution of hierarchical mesh used in THB-TO for the 3D cantilever benchmark

Table 4 Comparisons between hierarchical local and global refinement in DOFs and numvariables

5.2 Compliant mechanism problems

This section presents the optimal designs of 2D and 3D compliant mechanism by the proposed THB-TO method. The parameters of the radius of the density filter defined in (20) takeλ = 1.2  ,  rlower = 0.05for both 2D and 3D TO problems. As for the mark strategy presented for THB-TO, the parameter tolAMR is initialized to 0.05 and 0.04 for 2D and 3D TO problems, respectively.

5.2.1 2D compliant mechanism

This example is the optimal topology design of a 2D compliant mechanism within a rectangular design domain, whose geometric dimension and boundary condition are plotted in Fig. 24. The volume fraction of solid material for this example is prescribed to 0.4, and an initial uniform NURBS mesh with the size of 40 × 20 is used to discretized the design domain, as well as all the design variables are initialized to the prescribed volume fraction 0.4.

Fig. 24
figure 24

Geometry and boundary conditions for a 2D compliant mechanism

The initial structural topology and two intermediate designs as well as the converged design are presented in Fig. 25a–d, where two intermediate designs are chosen as the results at the iterative steps when the first and second hierarchical local refinement are performed. From these results, it is concluded that the resolution of the optimized structural boundary of a 2D compliant mechanism is largely improved and the zigzag boundary is smoothed during the course of THB-TO. Figure 26 depicts the convergence history. Besides, the evolution of the hierarchical mesh used in analysis and design models is illustrated in Fig. 26 as well. On the basis of the results shown in Fig. 26, the proposed mark strategy is effective to detect the elements to be refined, which are close to the structural boundary, and the design space is locally refined since the design variable of a marked element of level l is replaced by four design variables associated to its four children of level l + 1, as well as the convergence history is smooth except at the steps labeled by the black dotted lines. Moreover, the hierarchical local refinement is superior to global refinement in terms of DOFs and numvariables, which are compared in Table 5, and the improvements by hierarchical local refinement are up to 68.3% and 60.8 in DOFs and numvariables, when the number of refinements is 2. According to the aforementioned remarks, it finds that the proposed THB-TO is an effective optimization tool for designing a compliant mechanism.

Fig. 25
figure 25

An illustrative presentation for several structural topologies: a for the initial design; b for the iterative step performing the first hierarchical local refinement; c for the iterative step carrying out the second hierarchical local refinement; d for the converged design

Fig. 26
figure 26

Illustration of both convergence history and evolution of hierarchical computational mesh used in THB-TO

Table 5 The improvements of hierarchical local refinement in DOFs and numvariables compared with global refinement

5.2.2 3D compliant mechanism

The extension for the proposed THB-TO to 3D compliant mechanism is straightforward, and a 3D compliant mechanism is used to examine the validity of the THB-TO in obtaining the compliant inverter design within a given 3D design domain. Figure 27 illustrates the dimensions and boundary condition as well as the volume constraint of a 3D compliant mechanism problem. The design domain is initially discretized into a relatively coarse mesh with the size of 20 × 10 × 2, and the design variables corresponding to the initial uniform mesh are initialized to 0.3, which equals to the prescribed volume fraction of solid material \( \overline{V}=0.3 \).

Fig. 27
figure 27

The design domain and boundary condition for the 3D compliant mechanism example

The initial distribution of material is illustrated in Fig. 28a, and two intermediate material layouts are presented in Fig. 28b–c with respect to the iterative steps when a hierarchical local refinement is performed, and the final optimized structural topology is depicted in Fig. 28d. According to the aforementioned results, it reveals that the proposed THB-TO can successfully be applied to the 3D compliant inverter design and the structural boundary is gradually smoothed with the increasing hierarchical levels of the hierarchical mesh. The convergence history is shown in Fig. 29, and three different hierarchical meshes are used in the whole optimization process. Based on these hierarchical meshes, it is easy to see that the elements close to the structural boundary are chosen to be refined and the elements away from the structural boundary keep unchanged. Therefore, the proposed mark strategy for THB-TO is effective to perform the hierarchical local refinement for 3D compliant mechanism problems. Table 6 compares the hierarchical local and global refinement in DOFs and numvariables, and it is concluded that the hierarchical local refinement is superior to global refinement since the DOFs and numvariables are respectively decreased by 64.5 and 55.4%, when the number of refinements equals to 2. Thus, THB-TO is a very promising way of designing the 3D compliant mechanism than the conventional schemes using a dense uniform mesh.

Fig. 28
figure 28

Presentation of the initial design, two intermediate optimized results at the steps where a hierarchical local refinement is performed, and the converged design for the 3D compliant mechanism

Fig. 29
figure 29

Illustration of convergence history and evolution of computational hierarchical mesh for 3D compliant mechanism optimized by THB-TO

Table 6 Comparisons of DOFs and numvariables between hierarchical local and global refinement

6 Conclusions

By exploiting the truncated hierarchical B-spline (THB), we propose a THB-TO method based on SIMP ersatz material model. In order to carry out the hierarchical local refinement for the proposed THB-TO, a mark strategy is put forward, which is built on the top of the maximum variation of design variables on two consecutive iterative steps and the density differences of adjacent active elements. Then, the adaptively adjusted sensitivity and density filters are used for the sensitivity analysis of minimization compliance and compliant mechanism TO problems, respectively. With the aid of the parent-child relationship of the cells on consecutive levels, a density inheritance is developed for constructing a locally refined design space associated to the locally refined hierarchical computational mesh.

Based on the numerical results presented in Sect. 5, the proposed THB-TO is valid for both 2D and 3D TO problems, and the mark strategy satisfies the demand of performing the hierarchical local refinement for THB-TO. Compared with continuous global refinement, the hierarchical local refinement can largely reduce the number of DOFs and design variables, which is more significant for 3D TO problems. The improvements in the number of DOFs and design variables are respectively in a range of 47.3–74.6% and 37.4–60.8%, when the level of refinement is not less than 2. With the same accuracy in the geometric description of the converged design, the computational scale is largely reduced by the proposed THB-TO than classical optimization methods working on dense uniform mesh. Therefore, the THB-TO is a very effective approach for optimizing 2D and 3D TO problems.

Due to the hierarchical structure of THB-TO, the GPU parallel algorithm (Wang et al. 2015; Xia et al. 2015b; Xia et al. 2017) can be added into THB-TO to improve the computational efficiency. The proposed THB-TO has the ability of tracking the structural boundary and it may solve the TO problems with a complicated geometric constraint efficiently. All the above will be taken into consideration in our future research.