1 Introduction

Cellular materials, commonly known as metamaterials, are artificial structures characterized by the presence of distributed voids in the volume. In particular, structures exhibiting a regular and periodic distribution of voids are referred to as lattice materials. The topology characterizing the Reference Volume Element (RVE), namely the unit cell that is periodically distributed, affects the macroscopic material as a whole. Indeed, different microscopic topologies endow lattices with distinct physical properties. For instance, many lattice materials try to reproduce behaviors which are commonly observed in nature (e.g., wood, sponges, bones), while other microstructural designs aim to mimic uncommon physical characteristics (e.g., auxetic materials). The proposal of newly conceived lattices is supported also by the spreading of additive manufacturing (AM) techniques, such as 3D printing Thompson et al. (2016).

Lattices are mainly designed via two approaches, either by trial-and-error paradigms to reproduce desired patterns or by setting suitable optimization problems to guide a rigorous design process. In the second case, inverse homogenization techniques are employed to architect the material distribution in the RVE guaranteeing target properties at the homogenized macroscopic scale Andreassen and Andreasen (2014); Allaire et al. (2019); and Sigmund (1994).

In some contexts, it is advisible to carry out a multiscale and/or multimaterial design strategy Rodrigues et al. (2002); Sanders et al. (2021); Arabnejad Khanoki and Pasini (2012), for instance, in the optimization of components both at a macroscopic (i.e., visible design) and at a microscopic level (i.e., infill characterization), to ensure optimal structural response with respect to some quantities of interest. In practice, multiscale optimization resorts to lattice materials for the optimal distribution of the microstructured infill and ends up with the identification of several regions inside the macroscopic domain where different materials should be included. This scenario offers two approaches. On the one hand, the designer can allocate a single-cellular material (i.e., a single topology) whose structural members are appropriately sized in different regions of the macroscopic domain. We associate this framework with functionally graded materials (FGMs) Radman et al. (2013); Panesar et al. (2018). On the other hand, it is possible to resort to lattices characterized by different RVE material distribution (i.e., different topologies), thus making the microscopic infill spatially varying in topology and characteristics. The latter approach guarantees more flexibility in the optimal design process as it localizes the use of different materials and, as a consequence, locally diversifies the structural behavior Gao et al. (2019); Coelho et al. (2008); and Xia and Breitkopf (2014).

FGMs and multiple-lattice paradigms massively differ in terms of strategies to deal with heterogeneous unit cells. FGMs exhibit infill patterns which are essentially well-connected due to homogeneity of the involved RVEs. Indeed, the size variation across the domain does not represent a strong issue with a view to manufacturing. Vice versa, when resorting to different microscopic unit cells, two adjacent RVEs are, in general, only partially matching or completely non-matching, thus leading to failing of designs, unfeasible manufacture, and to physics-related issues, such as unwanted stress concentration Du et al. (2018). These drawbacks have to be properly tackled and have been addressed in several ways in the recent literature. In Cramer et al. (2016) and Wang et al. (2017), the authors resort to an approach based on an actual interpolation between two geometries. As an alternative, in Zhou and Li (2008); Radman et al. (2013); Li et al. (2018); Zhou et al. (2019); Zobaer and Sutradhar (2020); and Liu et al. (2022), the transition between non-matching materials is tackled according to a graded framework, namely, by introducing additional unit cells that implement a progressive morphing of one cell to the other. In general, several cells are involved in such a morphing. Other viable approaches perform a concurrent multiscale topology optimization with explicit matching conditions as a constraint, thus designing at the same time both the macro- and the microscale while enforcing the requested connectivity Schumacher et al. (2015); Du et al. (2018); Garner et al. (2019); and Liu et al. (2020). This solution is effective, yet computationally heavy as it involves many iterations between the two scales.

In this paper, we propose a new methodology, named CONFLUENCE (CONnection by FLUids of differENt CElls), to join different RVEs, which relies on a SIMP-based topology optimization process for fluids Borrvall and Petersson (2003). Starting from two different adjacent unit cells, we identify a morphing region straddling the common side (see Fig. 1 for a sketch), where we solve a Stokes-based topology optimization, properly constrained by the material distribution in the RVEs to be merged. The design of the matching region is enriched by a customized selection of the computational mesh based on the algorithm SIMP with AnisoTropic mesh adaptivitY (SIMPATY) proposed in Micheletti et al. (2019) and Ferro et al. (2020c).

Fig. 1
figure 1

CONFLUENCE algorithm. Sketch of the morphing region when merging different RVEs

CONFLUENCE algorithm is characterized by two main good features. It has a very localized impact on the cell design since it acts only in a narrow neighborhood of the side separating the different lattices, in contrast to Zhou and Li (2008); Radman et al. (2013); Li et al. (2018); Zhou et al. (2019); Zobaer and Sutradhar (2020); and Liu et al. (2022). Moreover, the mesh adaptation algorithm ensures to sharply describe the density across the material/void interface, thus limiting the post-processing phase typical of standard design tools. These features do not strongly affect the original mechanical performance of the joint lattices, ensure a limited computational effort to manage the matching design, and essentially preserve the manufacturability characterizing the considered lattice materials.

The paper is organized as follows. Section 2 represents the core of the work since providing the new fluid-based methodology to connect diverse lattices, together with the corresponding algorithm. In Sect. 3, we assess CONFLUENCE algorithm on an extensive bunch of test cases, by varying the topology of the considered lattices. Moreover, we investigate the sensitivity of the procedure with respect to the parameters involved in the cell morphing. Section 4 is devoted to an investigation of the mechanical performance of the joint lattices, with a particular attention to stress distribution and localization. Some conclusions are finally drawn in the last section with a view to future perspectives.

2 CONFLUENCE algorithm

Connectivity issues among different lattices with non-matching interfaces typically arise when materials characterized by diverse topologies are alternated inside the same component. We consider two adjacent squared and periodic RVEs sharing one edge. The goal is to set a design procedure to join different lattices in a continuous and smooth fashion, by modifying the original topologies in a narrow neighborhood of the common side that we name morphing region. To this end, we solve in such an area a density-based topology optimization problem. In particular, we consider a fluid-type problem completed with appropriate boundary conditions on the velocity profile and on the density in order to be compliant with the original topologies of the matched lattices. Throughout the paper, standard notations for the function spaces are employed Ern and Guermond (2004).

2.1 Stokes flow-driven topology optimization

We consider a flow design problem which describes the distribution of porous and impermeable material in a domain Y, here coinciding with the morphing region. In more detail, the design phase is driven by a Stokes-type equation, subject to given constraints and targeting a goal functional Borrvall and Petersson (2003). Following a density-based approach, we resort to the density (or design) variable \(\rho \in L^\infty (Y, [0, 1])\), which identifies the topology under optimization. We associate \(\rho = 0\) with the impermeable material (i.e., the solid), whereas \(\rho = 1\) characterizes the fully porous regions (i.e., the fluid).

To clearly formalize the constrained optimization problem, we first introduce the weak form of the (generalized) Stokes equation for the velocity, \(\mathbf{u}\), and the pressure, p, i.e.,

Find \((\mathbf{u}, p) \in U_\mathbf{g} \times Q\) such that

$$\left\{ {\begin{array}{*{20}l} {a({\mathbf{u}},{\mathbf{v}}) + b({\mathbf{v}},p) = F({\mathbf{v}})} \hfill & {\forall {\mathbf{v}} \in U,} \hfill \\ {\mkern 1mu b({\mathbf{u}},q) = 0} \hfill & {\forall q \in Q,} \hfill \\ \end{array} } \right.$$
(1)

where

$$\begin{aligned}&a(\mathbf{w}, \mathbf{z}) = \int _{Y} \mu \nabla \mathbf{w}: \nabla \mathbf{z}dY + \int _{Y} \alpha \mathbf{w}\cdot \mathbf{z}dY, \nonumber \\&b(\mathbf{z}, r) = \int _{Y} -r \nabla \cdot \mathbf{z}dY, \quad F(\mathbf{z}) = \int _{Y} \mathbf{f} \cdot \mathbf{z}dY, \end{aligned}$$
(2)

are the Stokes bilinear (\(a(\cdot , \cdot )\) and \(b(\cdot , \cdot )\)) and linear (\(F(\cdot )\)) forms, for any \(\mathbf{w}\in U_\mathbf{g}\), \(\mathbf{z}\in U\), and for any \(r \in Q\). Here, we are assuming to close problem (1) with a Dirichlet data, \(\mathbf{u}= \mathbf{g}\), for the velocity on the boundary portion \(\Gamma _D \subset \partial Y\), so that function spaces \(U_\mathbf{g}\), U and Q can be selected as \(U_\mathbf{g} = \{ \mathbf{v}\in [H^1(Y)]^2, \mathbf{v}|_{\Gamma _D} = \mathbf{g} \}\), \(U = \{ \mathbf{v}\in [H^1(Y)]^2, \mathbf{v}|_{\Gamma _D} = \mathbf{0} \}\), and \(Q = L^2(Y)\). Moreover, \(\mathbf{f} \in [L^2(Y)]^2\) denotes an external forcing term, \(\mu \in \mathbb {R}_+\) the diffusivity of the fluid, and \(\alpha \in \mathbb {R}_+\) the inverse permeability of the considered medium.

In Borrvall and Petersson (2003), the bilinear form (2) is modified to account for the presence of the design variable. Thus, we replace the form \(a(\cdot , \cdot )\) with

$$\begin{aligned} a_\rho (\mathbf{w}, \mathbf{z}) = \int _{Y} \mu \nabla \mathbf{w}: \nabla \mathbf{z}dY + \int _{Y} \alpha _\rho \mathbf{w}\cdot \mathbf{z}dY, \end{aligned}$$

where the constant inverse permeability \(\alpha\) is now substituted by the function of \(\rho\)

$$\begin{aligned} \alpha _\rho = \alpha _\rho (\rho ) = \overline{\alpha } + (\underline{\alpha } - \overline{\alpha }) \, \rho \, \dfrac{1 + \phi }{\rho + \phi }, \end{aligned}$$
(3)

with \(\overline{\alpha }\) and \(\underline{\alpha } \in \mathbb {R}_+\) the upper and lower bound for the inverse permeability, respectively. The scalar \(\phi > 0\) is a penalization parameter, which strongly promotes a sharp alternation of porous and impermeable materials for large values. We remark that \(\alpha _\rho\) is equal to \(\overline{\alpha }\) for \(\rho = 0\) and to \(\underline{\alpha }\) for \(\rho = 1\). Thus, the regions characterized by \(\rho = 0\) have high inverse permeability (i.e., low permeability) and correspond to solid material; vice versa regions where \(\rho =1\) are associated with the fluid.

The topology optimization problem for the allocation of solid and fluid regions reads

$$\min _{{\rho \in L^{\infty } (Y)}} {}{\mathcal{J}}({\mathbf{u}},p,\rho ):\left\{ {\begin{array}{*{20}l} {a_{\rho } ({\mathbf{u}},{\mathbf{v}}) + b({\mathbf{v}},p)} \hfill & { = F({\mathbf{v}})} \hfill \\ {} \hfill & {\forall {\mathbf{v}} \in U} \hfill \\ {b({\mathbf{u}},q) = 0} \hfill & {\forall q \in Q} \hfill \\ {\displaystyle \int\limits_{Y} \rho dY \le \beta |Y|} \hfill & {} \hfill \\ {0 \le \rho \le 1,} \hfill & {} \hfill \\ \end{array} } \right.$$
(4)

where \(\mathcal {J}(\mathbf{u}, p, \rho )\) is the selected objective functional to be minimized; the two equations enforce the Stokes regime, with \(\mathbf{u}\in U_\mathbf{g}\) and \(p \in Q\); the first inequality prescribes the maximum fraction \(\beta |Y |\) of fluid phase to be allocated in the domain Y, with \(\beta \in (0, 1)\) and \(|Y |\) the domain measure; the last box constraint keeps trace of the range prescribed to the design variable \(\rho\). In the sequel, we adopt the total potential energy of the fluid

$$\begin{aligned} \mathcal {J}(\mathbf{u}, p, \rho ) = \dfrac{1}{2} a_\rho (\mathbf{u}, \mathbf{u}) - F(\mathbf{u}), \end{aligned}$$
(5)

as objective functional. We observe that problem (4) does not suffer from uniqueness issues Borrvall and Petersson (2003) (as well as from drawbacks related to the numerical approximation), differently from the case when the optimization process is constrained by the linear elasticity equation Bendsøe and Sigmund (2004).

2.2 A fluid-based approach to connect non-matching lattices

We exploit the topology optimization problem presented in the previous section to design the transition area from one lattice material to an adjacent one. As a reference setting, we consider two design domains, \(Y_L\) and \(Y_R\), which share the common vertical (entire) side \(\mathcal E = \{(x_{\mathcal {E}}, y): y_l \le y \le y_u\}\), with \(x_{\mathcal {E}}\), \(y_l\), and \(y_u \in \mathbb {R}\) (notice that \(\mathcal E\) can be aligned with any axis, either x or y). The optimization process takes place in the rectangular morphing region \(Y = ( x_{\mathcal {E}} + s - \delta /2, x_{\mathcal {E}} + s + \delta /2 ) \times (y_l, y_u)\), with \(s \in \mathbb {R}\) the shift and \(\delta \in \mathbb {R}_+\) the width of the morphing region (see Fig. 2).

Fig. 2
figure 2

Morphing region. Definition of the main geometric parameters

In order to merge the two lattices associated with \(Y_L\) and \(Y_R\), problem (4) is solved in the morphing region, after prescribing ad hoc boundary conditions on \(\mathbf{u}\) and \(\rho\). We label the two vertical sides of the morphing region boundary \(\partial Y\) by \(\Gamma _L = \partial Y \cap Y_L\) and \(\Gamma _R = \partial Y \cap Y_R\), which are instrumental to set the minimization in problem (4).

The proposed procedure can be itemized as follows:

  1. (i)

    We read as an input the densities \(\rho _L \in L^\infty (Y_L, [0, 1])\) and \(\rho _R \in L^\infty (Y_R, [0, 1])\) identifying the original unit cell topologies to be merged;

  2. (ii)

    We solve the generalized Stokes problems. Find \((\mathbf{u}_i, p_i) \in U_i \times Q_i\) such that

    $$\left\{ {\begin{array}{*{20}l} {a_{{\rho _{i} }} ({\mathbf{u}}_{i} ,{\mathbf{v}}) + b({\mathbf{v}},p_{i} ) = F_{i} ({\mathbf{v}})} & {\forall {\mathbf{v}} \in U_{i}, } \\{\,b({\mathbf{u}}_{i} ,q) = 0} & {\forall q \in Q_{i} ,} \\ \end{array} } \right.{\text{ }}$$
    (6)

    where \(i = L, R\), \(U_i = \{ \mathbf{v}\in [H^1(Y_i)]^2\}\), \(Q_i = \{q \in L^2(Y_i)\}\), and \(F_i(\mathbf{v}) = \int _{Y_i} \mathbf{f}_i \cdot \mathbf{v}dY_i\), with \(\mathbf{f}_i\) a forcing term orthogonal to the side \(\mathcal E\);

  3. (iii)

    We define the boundary conditions to the optimization problem (4) by defining the two Dirichlet data \(\mathbf{g}_{in} = \mathbf{u}_L |_{\Gamma _L}\) and \(\mathbf{g}_{out} = \mathbf{u}_R |_{\Gamma _R}\);

  4. (iv)

    We solve in the morphing region the topology optimization problem

    $$\begin{aligned} \min _{\rho \in L^\infty (Y)} \mathcal {J}(\mathbf{u}, p, \rho ) : \left\{ \begin{array}{l} \begin{array}{lll} &{} a_\rho (\mathbf{u},\mathbf{v}) + b(\mathbf{v}, p)&{} = F(\mathbf{v}) \\ &{} &{} \forall \mathbf{v}\in W \\ &{} b(\mathbf{u}, q) = 0 &{} \forall q \in Q \end{array} \\ \rho |_{\Gamma _L} = \rho _L |_{\Gamma _L} \\ \rho |_{\Gamma _R} = \rho _R |_{\Gamma _R} \\ \displaystyle \int _Y \rho dY \le \beta |Y |\\ 0 \le \rho \le 1, \end{array} \right. \end{aligned}$$
    (7)

    where \(W = \{ \mathbf{w}\in [H^1_\#(Y)]^2 : \mathbf{w}|_{\Gamma _L \cup \Gamma _R} = \mathbf{0} \},\) with \(\mathbf{u}\in W_\mathbf{g} = \{ \mathbf{w}\in [H^1_\#(Y)]^2 : \mathbf{w}|_{\Gamma _L} = \mathbf{g}_{in}, \mathbf{w}|_{\Gamma _R} = \mathbf{g}_{out} \}\) and where \(H^1_\#(Y)\) is the space of the \(H^1(Y)\)-functions which are periodic along \(\partial Y \setminus (\Gamma _L \cup \Gamma _R)\).

We remark that the data assigned to the density on \(\Gamma _L\) and \(\Gamma _R\) and the essential boundary conditions characterizing the space \(W_\mathbf{g}\) have a different, albeit complementary, role in the design of the transition topology. In particular, the former enforce the density continuity along the vertical sides of the morphing region, acting as a gluing expedient; the latter impose a smooth morphing between the original and the transition topologies, so that no sharp features characterize the junction. As confirmed by the numerical assessment, these boundary assignments have to be simultaneously imposed in order to guarantee a seamless transition design.

2.3 Numerical discretization

The numerical implementation of problem (7) is tackled in a continuous finite element setting Ern and Guermond (2004). For this purpose, we introduce the computational mesh \(\mathcal {T}_h(\Omega ) = \{K\}\), a conforming triangular tessellation associated with the generic domain \(\Omega\), and the corresponding discrete space of continuous piecewise polynomials of degree \(s \in \mathbb {N}_+\),

$$\begin{aligned} X_h^s(\Omega ) = \big \{ v \in C^0(\overline{\Omega }) : v |_K \in \mathbb {P}_s(K) \ \forall K \in \mathcal {T}_h(\Omega ) \big \}. \end{aligned}$$

Within this framework, we approximate problems (6) to discretize \(\mathbf{u}_{L}\) and \(\mathbf{u}_{R}\) instrumental to assign the boundary data in the discrete counterpart of problem (7). Thus, we solve

Find \((\mathbf{u}_{h,i}, p_{h,i}) \in U_{h,i} \times Q_{h,i}\) such that

$$\begin{aligned} \left\{ \begin{array}{lll} &{} a_{\rho _{h,i}}(\mathbf{u}_{h,i},\mathbf{v}_h) + b(\mathbf{v}_h, p_{h,i}) = F_i(\mathbf{v}_h) \, &{} \forall \mathbf{v}_h \in U_{h,i}, \\ &{} b(\mathbf{u}_{h,i}, q_h) = 0 \, &{} \forall q_h \in Q_{h,i}, \end{array} \right. \end{aligned}$$
(8)

with \(U_{h,i} = [X_h^2(Y_i)]^2\) and \(Q_{h,i} = X_h^1(Y_i)\) and with \(\rho _{h,i}\) the discrete density in \(X_h^1(Y_i)\), for \(i = L, R\). The spaces \(U_{h,i}\) and \(Q_{h,i}\) ensure the inf–sup condition, i.e., the well posedness of problems (8) and the absence of spurious oscillations in the discrete solutions \((\mathbf{u}_{h,i}, p_{h,i})\) Boffi et al. (2013).

Successively, problem (7) is tackled by resorting to a gradient-based optimizer for the minimization of the functional and to a finite element scheme to approximate the state equations. The discrete counterpart of the topology optimization problem (7) reads

$$\begin{aligned} \min _{\rho _h\in V_h} \mathcal {J}(\mathbf{u}_h, p_h, \rho _h): \left\{ \begin{array}{l} \begin{array}{lll} &{} a_{\rho _h}(\mathbf{u}_h,\mathbf{v}_h) + &{} b(\mathbf{v}_h, p_h) \\ &{} = F(\mathbf{v}_h) &{} \forall \mathbf{v}_h \in W_h \\ &{} b(\mathbf{u}_h, q_h) = 0 &{} \forall q_h \in Q_h \end{array} \\ \rho _h |_{\Gamma _L} = \rho _{h,L} |_{\Gamma _L} \\ \rho _h |_{\Gamma _R} = \rho _{h,R} |_{\Gamma _R} \\ \displaystyle \int _Y \rho _h dY \le \beta |Y |\\ 0 \le \rho _h \le 1, \end{array} \right. \end{aligned}$$
(9)

with \(V_h = X_{\#, h}^1(Y)\), \(Q_h = X_h^1(Y)\), and \(W_h = \{\mathbf{w}_h \in [X_{\#, h}^2(Y)]^2, \, \mathbf{w}|_{\Gamma _i} = \mathbf{0}, \, i = L, R \}\), where \(\mathbf{u}_h \in W_{\mathbf{g}, h} = \{\mathbf{w}_h \in [X_{\#, h}^2(Y)]^2, \, \mathbf{w}_h |_{\Gamma _L} = \mathbf{g}_{in, h}, \mathbf{w}_h |_{\Gamma _R} = \mathbf{g}_{out, h}\}\), with \(\mathbf{g}_{in, h}\) and \(\mathbf{g}_{out, h}\) suitable finite element approximations in \([X_h^2(Y)]^2\) of the data \(\mathbf{g}_{in}\) and \(\mathbf{g}_{out}\) and where symbol \(\#\) refers to the periodicity of the functions along \(\partial Y \setminus (\Gamma _L \cup \Gamma _R)\).

We solve problem (9) by means of a variant of the SIMPATY (SIMP with Anisotropic adaptiviTY) algorithm introduced in Micheletti et al. (2019) and successfully validated in different application settings Ferro et al. (2020a, b, c, 2022); di Cristofaro et al. (2020); and Ferro et al. (2019). SIMPATY algorithm efficiently combines the well-established SIMP method for topology optimization Bendsøe and Sigmund (2004) with an advanced mesh adaptation technique. An a posteriori estimator for the discretization error associated with the density variable is exploited to drive a metric-based mesh adaptation process Frey and George (2008). In particular, the authors resort to an anisotropic counterpart [formulated in Micheletti and Perotto (2010)] of the well-known recovery-based error analysis proposed by Zienkiewicz and Zhu (1987, 1992). The employment of anisotropic meshes allows to strike a balance between accuracy and efficiency as it is consolidated in the literature Dompierre et al. (2002); Perotto and Formaggia (2015); and Sevilla et al. (2022).

As a matter of fact, SIMPATY algorithm ensures to design high-quality optimized layouts, characterized by smooth boundaries and free-form features, while healing some drawbacks typical of density-based topology optimization approaches Lazarov and Sigmund (2011) and Sigmund and Petersson (1998), such as the staircase effect and the presence of too thin details, unpractical for manufacturing. Successively, in order to make mechanical analysis free from any bias induced by stretched elements, a hybrid version of SIMPATY algorithm has been proposed in Ferro et al. (2020a). Here, the idea is to prescribe sufficiently small isotropic elements in correspondence with the internal portion of the structures (\(\rho \simeq 1\)), while preserving deformed triangles in order to sharply detect the layout boundary.

Although topology optimization based on a Stokes flow exhibits, in general, few drawbacks related to the selected grid, we solve problem (9) on a sequence of anisotropic adapted meshes to benefit of the computational advantages led by such a technique. The whole procedure is listed in the algorithm below.

figure a

The first phase which occurs is a pre-processing step (lines 2–6). In particular, the left and right RVEs are read by function \(\mathtt{import}\) in terms of density function and design domain (lines 2–3). Successively, the auxiliary problems in (8) are solved to compute the approximations \(\mathbf{u}_{h,L}\) and \(\mathbf{u}_{h,R}\) (lines 4–5), which, together with the associated densities, \(\rho _{h,L}\) and \(\rho _{h,R}\), are employed to assemble the matching conditions, \(\mathtt{mc}\), on \(\Gamma _L\) and \(\Gamma _R\) through the function \(\mathtt{assign}\) (line 6).

The main optimization loop consists of lines 7–12. At each iteration \(\mathtt k\), \(\mathtt{optimize}\) performs the topology optimization in (9) in a \(\xi _\mathtt{k}\) number of iterations. Such routine is fed with the goal functional, \(\mathcal J\), the associated gradient with respect to the density, \(\nabla _\rho \mathcal {J}\), the volume fraction \(\beta\), the matching conditions \(\mathtt {mc}\) on \(\Gamma _L\) and \(\Gamma _R\), the distribution of the density at the previous iteration, \(\rho _{h}^\mathtt{k}\), and the tolerance \(\mathtt{TOPT}\) to break the optimization (line 8). In particular, with reference to the gradient of the functional \(\nabla _\rho \mathcal {J}\), we employ a standard Lagrangian approach Lions (1971). As an alternative, one may resort to automatic differentiation Margossian (2019).

Finally, the optimized density is employed to drive an anisotropic mesh adaptation (line 9). In particular, function \(\mathtt{adapt}\) minimizes the number of the mesh elements for a fixed accuracy \(\mathtt {TOL}\) on the discretization error for the density. To this aim, the size, shape, and orientation of the triangles are properly tuned, jointly with an error equidistribution criterion (we refer the interested reader to Micheletti and Perotto (2006); Micheletti et al. (2010) for all the details). Two criteria constrain the while loop, the first one in order to control the stagnation of the mesh cardinality and the second one to ensure a termination within a \(\mathtt {kmax}\) number of iterations.

The algorithm eventually delivers the final layout \(\rho _Y\) that describes the optimized topology in the morphing region Y; the whole design domain \(\Omega ^\circ\), with \(\Omega = \overline{Y}_L \cup \overline{Y}_R\) and where \(^\circ\) denotes the internal part of the associated set; the distribution of the density on \(\Omega ^\circ\), given by

$$\begin{aligned} \rho _{LYR}(\mathbf{x} ) = \left\{ \begin{array}{lll} \rho _{h, L} (\mathbf{x} ) &{} \quad &{} \mathbf{x} \in Y_L \setminus Y \\ \rho (\mathbf{x} ) &{} &{} \mathbf{x} \in \overline{Y} \\ \rho _{h, R} (\mathbf{x} ) &{} &{} \mathbf{x} \in Y_R \setminus Y. \end{array} \right. \end{aligned}$$

The global density, \(\rho _{LYR}\), and domain, \(\Omega ^\circ\), are assembled by function \(\mathtt {join}\) in line 14.

3 Results

The effectiveness of CONFLUENCE algorithm for connecting non-matching lattice materials is here investigated, with emphasis on the role played by the main parameters involved in the design strategy in (9). As a benchmark scenario, we join two RVEs, starting from the simplified configuration in Fig. 2 where the common edge \(\mathcal E\) is vertical and the morphing region does coincide with a Cartesian domain. As different geometries to be connected, we consider the four topologies in Fig. 3 associated with the square \((0,1)^2\). These unit cells are selected according to a twofold goal. Indeed, we assess CONFLUENCE on topologies available in the literature (geometries A and D), as well as on free-form layouts (geometries B and C) drawn from scratch by the extension of the SIMPATY algorithm to the design of lattice materials Ferro et al. (2020c). Such design tool, named microSIMPATY algorithm, relies on SIMPATY procedure and on a standard inverse homogenization approach to propose new unit cells which confer prescribed (homogenized) physical properties at the macroscale. For instance, geometries B and C have been designed in a thermo-elastic multiobjective context, to ensure a high shear stiffness while exhibiting an isotropic (geometry B) or an anisotropic (geometry C) thermal and stiffness behavior Gavazzoni et al. (2022).

The unit cells in Fig. 3 are characterized by poor one-to-one connectivity and do not show any trivial matching. This allows us to verify the performances and the ductility of CONFLUENCE algorithm on unit cells which share a portion of material along the common interface or which are completely disconnected.

Fig. 3
figure 3

Geometries used to assess the effectiveness of CONFLUENCE algorithm

For all the test configurations in this section, we preserve the same choices for some of the quantities tuning CONFLUENCE morphing. We start the optimization problem on an initial unstructured grid, \(\mathcal {T}_h^0\), characterized by a uniform spacing \(h \simeq 1/60\) and selecting an initial constant \(\rho _h^\mathtt{0} = 0.5\); we set the penalization parameter \(\phi\) to 0.6, the diffusivity \(\mu\) to 1, the lower bound for the inverse permeability \(\underline{\alpha }\) to \(2.5 \, \mu \cdot 10^{-4}\), \(\mathbf{f}\) to \([1, 0]^T\), \(\mathtt{CTOL}\) to \(1.5 \cdot 10^{-2}\), \(\mathtt{TOL}\) to \(2.5\cdot 10^{-6}\), \(\mathtt{TOPT}\) to \(10^{-3}\), and \(\mathtt {kmax}\) to 50. Moreover, to perform the connection between two heterogeneous cells, we identify \(Y_L\) with the unit square \((-1, 0) \times (0, 1)\) and \(Y_R\) with the unit square \((0, 1)^2\). Then, the volume fraction \(\beta\) in (7) is chosen as

$$\begin{aligned} \beta = \displaystyle \frac{1}{|Y |} \left( \int _{Y_L \cap Y} \rho _{h, L} dY + \int _{Y_R \cap Y} \rho _{h, R} dY \right) \end{aligned},$$

in order to preserve the quantity of material in Y during the morphing process. Finally, concerning function \(\mathtt {optimize}\) in Algorithm 1, we select the gradient-based optimizer package IPOPT Wächter and Biegler (2006), while function \(\mathtt {adapt}\) resorts to the metric-based mesh generator BAMG (Bidimensional Anisotropic Mesh Generator). Both these computational tools are embedded in \(\mathtt {FreeFEM}\) Hecht (2012) which is the solver we adopt.

Matching geometries A and B

The first scenario used to assess CONFLUENCE morphing involves geometries A (on the left) and B (on the right). As shown in Fig. 4 (top), the cells to be joined have a null intersection along the common interface \(\mathcal E\). This feature challenges the proposed procedure to identify the new topology in the morphing region. We select Y so that \(s = 0\) (i.e., the region is centered at \(\mathcal E\)) and \(\delta = 0.5\) (see Fig. 2). Finally, for this configuration, we set \(\overline{\alpha } = 2.5 \, \mu \cdot 10^5\).

Figure 4 (bottom) displays the output of CONFLUENCE algorithm. In region Y we can still recognize the initial topology of both the geometries, despite the complete absence of connectivity before morphing.

Fig. 4
figure 4

Matching A–B. Initial (top) and final (bottom) density distribution provided by CONFLUENCE in \(\Omega ^\circ\)

Figure 5 (left) shows the \(4\times 4\) two-material ensemble. The panel on the right highlights the smoothness characterizing the distribution of \(\rho _Y\) together with the sharpness of the solid/void interface. This is the result of the anisotropic mesh adaptation process which selects the elements in an optimal way, in order to match the directional features of the design. We remark that an isotropic mesh is employed to discretize the internal part of the junction, according to the hybrid mesh generation paradigm described in Sect. 2.3.

Fig. 5
figure 5

Matching A–B. \(4 \times 4\) two-material ensemble (left); detail of the density distribution \(\rho _Y\) and corresponding anisotropic adapted mesh (right) in Y

We exploit this case study first to investigate the sensitivity of \(\rho _Y\) to the value selected for \(\delta\). To this goal, we make two different choices for such parameter, namely \(\delta = 0.3\) and \(\delta = 0.7\), while preserving \(s = 0\). In Fig. 6, we provide the corresponding results. A cross-comparison among the three layouts in Figs. 4 (bottom) and 6 reveals that, for increasing values of the morphing region width, the designs miss the features characterizing the original geometries. Thus, for a too small value for \(\delta\), we can lose some structural property of interest. For instance, in the specific case of the top panel in Fig. 6, the right diagonal strut of geometry B is not modified by the morphing process so that the junction lacks horizontal connectivity. On the other hand, the connection along the vertical direction is reached only through the periodic replication of the density \(\rho _{LYR}\). On the contrary, the choice \(\delta = 0.7\) leads to ignore the upward strut in cell B (bottom panel in Fig. 6) and to drastically change the original structural properties characterizing the two RVEs.

Fig. 6
figure 6

Matching A–B. Sensitivity of \(\rho _{Y}\) to \(\delta\): \(\delta = 0.3\) (top) and \(\delta = 0.7\) (bottom)

Fig. 7
figure 7

Matching A–B. Sensitivity of \(\rho _Y\) to the matching conditions on the density and velocity: reference configuration (enlarged view on the left); \(\rho _Y\) distribution when removing the matching of the density (center enlarged view) and of the velocity (enlarged view on the right)

On the same cell configuration, we analyze the different roles played by the matching conditions on the density and on the velocity along \(\Gamma _L\) and \(\Gamma _R\). The enlarged view on the left in Fig. 7 provides the reference layout when both the matching conditions are applied. It is evident that such constraints ensure continuity as well as smoothness to the final density. On the contrary, when we neglect the requirements (9)\(_3\) - (9)\(_4\) on the final topology, spurious values for \(\rho _Y\) arise, compromising the global continuity of \(\rho _{LYR}\) (see the center enlarged view). On the other hand, the removal of the matching condition on the velocity characterizing space \(W_{\mathbf{g}, h}\) may yield sharp corners at the junction, thus degrading the global smoothness of the material in a neighborhood of \(\Gamma _L \cup \Gamma _R\). For instance, in the enlarged view on the right in Fig. 7, we only impose the matching of the x-component of the velocities \(\mathbf{u}_h\) along \(\Gamma _L\) and \(\Gamma _R\).

Fig. 8
figure 8

Matching A–B. Velocity fields \(\mathbf{u}_{h, L}\) in \(Y_L\) (left) and \(\mathbf{u}_{h, R}\) in \(Y_R\) (right), where \(\Gamma _L\) and \(\Gamma _R\) are red-highlighted

This generates a small kink, which can be ascribed to the unconstrained behavior allowed to the design procedure along the vertical direction (Fig. 8 highlights the relevance of both the components of fields \(\mathbf{u}_{h, L}\) and \(\mathbf{u}_{h, R}\) along \(\Gamma _L\) and \(\Gamma _R\)).

Matching geometries B and D

We address the morphing from geometry B to geometry D in order to tackle the non-matching material at the common interface. The outcome of CONFLUENCE algorithm, for \(\overline{\alpha } = 2.5 \, \mu \cdot 10^5\), \(\delta = 0.43\), and \(s = 0\), is shown in Fig. 9. The effect of the morphing is to horizontally bend the diagonal struts of cell D in order to join the straight trusses in cell B.

Fig. 9
figure 9

Matching B–D. Initial (top) and final (bottom) density distribution provided by CONFLUENCE in \(\Omega ^\circ\)

In this scenario, we focus on the performance of the optimization and on the evolution of the mesh elements throughout the adaptation process. To this aim, we plot the trend of \(\mathcal {J}\) in (5) and of the constraint \(\mathcal {C} = |Y |^{-1} \int _Y \rho _h dY\) in (9), as a function of the cumulative number \(\sum _\mathtt{k} \xi _\mathtt{k}\) of IPOPT iterations [see Fig. 10 (top)]. Both the functional and the constraint quickly converge, except for mild oscillations. A different behavior characterizes the cardinality, \(\# \mathcal {T}_h\), of the computational mesh as a function of index \(\mathtt k\). Figure 10 (bottom) exhibits the evolution typical of a mesh adaptation process, which includes an initial abrupt increment of the cardinality, followed by a gradual reduction of the number of triangles until stagnation. The plots in Fig. 10 highlight the twofold control performed by the tolerances \(\mathtt {TOPT}\) and \(\mathtt {CTOL}\). Indeed, the tolerance \(\mathtt {TOPT}\) is guaranteed already on the first adapted mesh. On the contrary, the stagnation of the relative mesh cardinality within tolerance \(\mathtt {CTOL}\) is ensured only after 5 adaptation steps (i.e., 5 complete while loops). The outcome of this coupled check guarantees an optimized solution both from a structural and a computational viewpoint.

Fig. 10
figure 10

Matching B–D. Convergence history of the goal functional \(\mathcal J\) and of the constraint \(\mathcal C\) as a function of the cumulative IPOPT iterations (top); mesh cardinality evolution across the adaptation process (bottom). The vertical-dashed segments align the two panels in terms of the iteration index \(\mathtt k\)

On this configuration, we carry out a sensitivity analysis of the CONFLUENCE output with respect to the value for \(\overline{\alpha }\) in (3). In particular, we adopt a larger and a smaller value for \(\overline{\alpha }\) with respect to the one considered in Fig. 9. In Fig. 11, we provide the distribution of \(\rho _{LYR}\) for \(\overline{\alpha } = 2.5 \, \mu \cdot 10^4\) (top) and \(\overline{\alpha } = 2.5 \, \mu \cdot 10^6\) (bottom).

We do not detect a strong dependence of the final topology on parameter \(\overline{\alpha }\). However, a reduced permeability (i.e., a larger value for \(\overline{\alpha }\)) seems to hinder the Stokes flow-driven topology design, as confirmed by the wavy contour of the optimized density in the junction area (compare top and bottom panels in Fig. 11).

Fig. 11
figure 11

Matching B–D. Sensitivity of \(\rho _Y\) to the upper bound \(\overline{\alpha }\) for the inverse permeability \(\alpha\): \(\overline{\alpha } = 2.5 \, \mu \cdot 10^4\) (top) and \(\overline{\alpha } = 2.5 \, \mu \cdot 10^6\) (bottom)

Finally, we exploit this case study to investigate the computational performances of CONFLUENCEFootnote 1. Table 1 collects the results of such an analysis. In particular, we provide the running CPU time for the overall CONFLUENCE process, together with the partial contributions necessary to (i) pre-process the geometry, solve the auxiliary problems in (8), and plot the results (routines \(\mathtt {import}\), \(\mathtt {solve\_flux}\), and \(\mathtt {assign}\)); (ii) run the optimization in (9) (routine \(\mathtt {optimize}\)); and (iii) adapt the mesh (routine \(\mathtt {adapt}\)).

We highlight that the algorithm takes approximately 3 minutes to converge to the solution in Fig. 9. The pre-processing is a cheap phase which lasts around 17s, corresponding to about 9% of the overall CPU time. The most expensive code block is represented by the optimization, which approximately takes 90% of the total running time (173.7s). It is interesting to observe that the algorithm spends almost 90s (about 50% of the total time) for optimizing the geometry on the first non-adapted mesh (\(\mathtt{k} = 0\)). Vice versa, the time is drastically reduced up to 28s when the optimization is carried out on an adapted grid (\(\mathtt{k} > 0\)). This remark emphasizes the benefits led by mesh adaptation in terms of efficiency of the algorithm. The computational gain is further confirmed by the cheapness of the anisotropic mesh adaptation module, which amounts only to 1% of the total CPU time.

Table 1 Matching B–D - CONFLUENCE computational performances: overall, pre-processing, optimization, and mesh adaptation times

Matching geometries B and C

The last matching that we consider combines two unit cells, which share a portion of material along the common interface \(\mathcal E\), namely geometry B (on the left) and geometry C (on the right). For this purpose, we set \(\overline{\alpha } = 2.5 \, \mu \cdot 10^5\), \(s = 0\), and \(\delta = 0.4\). We show the result of the morphing associated with such configuration in Fig. 12. The topology identified in \(\Omega ^\circ\) is characterized by long, hanging, and horizontal struts, which can be sub-optimal in view of a mechanical analysis.

Fig. 12
figure 12

Matching B–C. Initial (top) and final (bottom) density distribution provided by CONFLUENCE in \(\Omega ^\circ\)

These two geometries are adopted to evaluate the impact of the shift parameter s onto the output of CONFLUENCE algorithm. This investigation is performed by setting in the previous configuration the values \(s = -0.12\) and \(s = 0.12\). Figure 13 collects the results of this analysis. The position of the interfaces \(\Gamma _L\) and \(\Gamma _R\) turns out to be crucial in order to guarantee the generation of topologies suited for practical applications. As a matter of fact, the choice \(s = -0.12\) [see Fig. 13 (top)] suffers from the similar drawbacks as the design in Fig. 12 (i.e., the presence of vertically unsupported trusses). Conversely, for \(s = 0.12\) [Fig. 13 (bottom)], the two cells are well connected, without any artifacts which may deteriorate the mechanical performance. These considerations support the choice of this last scenario as the best configuration for the mechanical analysis in Sect. 4.

Fig. 13
figure 13

Matching B–C. Sensitivity of \(\rho _Y\) to s: \(s = -0.12\) (top) and \(s = 0.12\) (bottom)

3.1 Generalization to a non-Cartesian morphing region

Practical applications often demand to join different cellular materials along an interface which is not vertical. In this section, we consider a possible generalization of Algorithm 1 in order to tackle settings such as the one in Fig. 14. Here, the morphing region Y coincides with a parallelogram which is overlapped to the lattices associated with different unit cells. In particular, Y is characterized by an inclination \(\theta\) with respect to the x-axis and by the width \(\delta\). The main change to be done in CONFLUENCE algorithm consists in replacing the periodic boundary conditions along \(\partial Y \setminus (\Gamma _L \cup \Gamma _R)\) with a homogeneous Neumann data.

Fig. 14
figure 14

Non-Cartesian morphing region. Definition of the main geometric parameters

As benchmark configurations, we perform two matchings by morphing the \(4\times 3\)-lattice materials associated with geometries A (left) and B (right) and with geometries D (left) and C (right). For both these choices, we set \(\overline{\alpha } = 2.5 \, \mu \cdot 10^6\) and \(\delta = 0.4\), while the inclination \(\theta\) is equal to \(\pi /4\) for the first case (A–B) and to \(\pi /3\) for the second case (D–C).

Figure 15 gathers the resulting materials. In particular, we remark the extremely localized effect of the morphing, together with the absence of unsupported struts along both the x- and y-directions.

Fig. 15
figure 15

Non-Cartesian morphing region. Matching A–B for \(\theta = \pi /4\) (top); matching D–C for \(\theta = \pi /3\) (bottom)

This preliminary assessment confirms the high flexibility of CONFLUENCE algorithm to tackle configurations which are still rarely addressed in the reference literature.

4 Structural analysis

The mechanical performance of the morphing geometry B–C in Fig. 13 (bottom) is assessed by means of a dedicated finite element mechanical analysis. To this aim, we investigate the global response of the heterogeneous structure to a given load and we quantify possible stress localizations induced by the change of topology in the morphing region. Moreover, to further validate the effectiveness of CONFLUENCE algorithm, we carry out a comparison of the geometry B–C after morphing with the case of a straightforward side-by-side connection between cells B and C [see Fig. 16 (top)] and with a connection represented by a solid wall of thickness 0.1 separating the two materials [see Fig. 16 (bottom)]. We remark that while the side-by-side solution is not always necessarily pursuable [see Figs. 4 and 9 (top), where the cells do not share portions of material along the interface \(\mathcal E\)], the solid wall approach unavoidably increases the global mass of the multicellular specimen.

Fig. 16
figure 16

Structural analysis. Side-by-side (top) and solid wall (bottom) connections between cells B and C

Fig. 17
figure 17

Structural analysis. Composite structures B–C for three matching strategies under a compressive displacement: CONFLUENCE algorithm (left), side-by-side connection (center), and solid wall connection (right). Layouts and case study setting (top), and von Mises stress distribution on the deformed structures with enlarged views (bottom)

The structural analysis is performed using the commercial finite element software AbaqusFootnote 2. In Fig. 17 (top), we provide the three settings to be compared, which consist of a heterogeneous volume composed by a \(4 \times 4\)-block of unit cells B joint with a \(4 \times 4\)-block of unit cells C. We apply a uniform vertical compressive displacement on the top of the multilattice material; we constrain the bottom along the y-direction while allowing for lateral expansion. Concerning the boundary configuration, two solid layers with thickness 0.1 are introduced at the top and at the bottom in order to mimic a sandwich structure. Finally, the displacement along the vertical border is left free. The considered base material is characterized by a linear elastic behavior with unitary Young’s modulus and a Poisson’s ratio equal to 0.3.

A quadratic finite element approximation is used to discretize the structural displacement.

The response of the composite structures to the applied displacement is investigated in Fig. 17 (bottom), where we show the distribution of the von Mises stress \(\sigma _{\text {VM}}\) on the deformed multilattice specimen, together with enlarged views in correspondence with the junction. The deformation and the von Mises stress distribution of the three materials are essentially identical far from the morphing region. On the contrary, the choice adopted to join the different lattices leads to a significant difference, in particular on the stress, in correspondence with the area around the interface \(\mathcal E\). We observe an overall increment for the stress in both the non-optimized configurations (compare the three detailed views), together with a significant stress localization for the solid wall solution.

We compare the three different scenarios in Fig. 17 also in terms of the pressure measured along the x-direction at the top border where the displacement is applied. As expected, CONFLUENCE algorithm and the side-by-side strategy exhibit a global similar trend, whereas the solid wall solution leads to a high pressure peak in correspondence with the connection. This anomalous feature might represent an issue, in particular when a smooth transition of the mechanical properties among the different materials is demanded.

We replicate the analysis above by changing the case study setting. A tensile displacement is now applied along the left side, while the composite material is clamped along the right border. The top and the bottom of the specimen are not subject to any imposed displacement.

Figure 19 collects the results of this new framework by providing the same information as in Fig. 17. It turns out that this setting is in general more challenging with respect to the compressive case, as the von Mises distribution highlights. CONFLUENCE algorithm delivers the most effective solution when compared with the side-by-side and the solid wall connections. In particular, we notice that the stress localization is much more severe when resorting to the solid wall approach.

Fig. 18
figure 18

Structural analysis. Trend of the pressure as a function of x along the top border of the specimen

Fig. 19
figure 19

Structural analysis. Composite structures B–C for three matching strategies under a tensile displacement: CONFLUENCE algorithm (left), side-by-side connection (center), and solid wall connection (right). Layouts and case study setting (top), and von Mises stress distribution on the deformed structures with enlarged views (bottom)

As a final check, we consider a specimen, \(\mathcal H\), of the same global extension as the three composite structures in Fig. 19, characterized by discontinuous mechanical features. In particular, as sketched in Fig. 20, the left and the right halves of the material share the homogenized properties associated with cell B and C, respectively. We compute the compliance, \(C^* = \int _{\gamma _P} \mathbf{P} \cdot \mathbf{d}\, ds\), associated with the load \(\mathbf{P}\) applied to the boundary portion \({\gamma _P}\subset \partial \mathcal H\) and inducing the displacement \(\mathbf{d}\) (see Fig. 20). The same mechanical configuration is enforced on the multilattice materials in Fig. 19, for comparison purposes.

Table 2 gathers the results of such an analysis in terms of compliance and percentage error with respect to the homogenized configuration \(\mathcal H\). As expected, the solid wall connection provides the smallest compliance error while representing a non-viable strategy in practice (see Figs. 17, 18, and 19). CONFLUENCE connection turns out to better perform with respect to the side-by-side solution, leading to a lower compliance and to half of the percentage error, approximately.

Fig. 20
figure 20

Structural analysis. Sketch of the homogenized specimen \(\mathcal H\): material and mechanical setting

Table 2 Structural analysis - Quantitative comparison in terms of compliance and percentage error between the homogenized specimen \(\mathcal H\) and CONFLUENCE, side-by-side, and solid wall connections

5 Conclusion

We propose the new algorithm CONFLUENCE (CONnection by FLUids of differENt CElls) to design the junction between heterogeneous lattice materials. To this end, we exploit a Stokes-type topology optimization setting which is used to locally modify the matching between different RVEs.

CONFLUENCE guarantees a cost-effective and local re-design of the materials, thus inducing a very mild modification to the original behavior of the matched materials.

The new morphing process is assessed by investigating the sensitivity of the final optimized layout to different geometric and physics parameters in order to validate the robustness of the algorithm. Additionally, CONFLUENCE algorithm is compared with two basic approaches (side-by-side and solid wall connections) used to join different materials, in terms of displacement and von Mises stress. As far as the configuration here considered (composite structure B–C), the matching optimized through CONFLUENCE exhibits good properties. The morphing acts on a very small area so that the mechanical performance of the joint RVEs is slightly affected. Moreover, the solution offered by the CONFLUENCE avoids undesired stress concentration and limits any pressure peak in correspondence with the morphing region.

Finally, the new algorithm is challenged with a non-Cartesian-aligned transition region to mimic practical configurations where the morphing between two consecutive heterogeneous lattices takes place along a generic curve. Results in Fig. 15, yet preliminary, confirm the robustness of CONFLUENCE also in such a context.

The present work opens some relevant issues for future investigations, such as

  • The extension of the presented algorithm to a 3D setting with a view to engineering applications;

  • The inclusion of additional structural constraints (e.g., stiffness, stress, buckling) in the optimization problem (7) to take into account, for instance, the conclusions drawn in Sect. 4;

  • The scaling-up of the proposed methodology to the connection along a generic curve and to the management of multiple cells;

  • The selection of a driver for the topology optimization in the morphing region different from the Stokes problem in Sect. 2 [see, e.g., Li et al. (2016)];

  • The generalization of the present setting to a parametric framework in order to exploit consolidated model order reduction techniques to solve parametric problems.