1 Introduction

Topology optimization has found multiple applications ranging from micro- and macro-scale problems to multiphysics problems such as fluid flow, heat transfer, and nanophotonics. Non-linearities are nothing new to topology optimization, and geometrical and material non-linearity for large strain topology optimization has been applied successfully in the design of structures with large deformations [2, 3, 5, 8, 12, 16, 23]. When subjected to large deformations, such structures may engage in contact, and including such contact in the topology optimization process extends the solution space, making more advanced designs possible. This may be of special interest in the design of compliant mechanisms or soft robotics, where human-made designs already utilize contact. However, until recently, there has been no viable approach to include internal contact in topology optimization due to the seeming paradox: How to assign contact forces when the boundaries are not defined?

Some approaches exist to include internal contact in topology optimization. One such approach [11] has been applied successfully in the design of shape-morphing compliant mechanisms. This approach employs an explicit treatment of contact surfaces—solid and void phases are determined based on a negative mask scheme, a smooth boundary is then determined by a boundary resolution and smoothing scheme. Contact between these surfaces is modeled by a Lagrange multiplier approach. A related approach, which is based on frame-structures and includes contact between different members, also exists [18].

Another approach, which also includes internal contact, is the level set based approach for sliding contact interfaces proposed by [13]. This approach is based on the distribution of two separate materials sharing an interface. A level set method is used to define the interface, along which the contacting bodies may slide or separate. Tractions along these interfaces are modeled through a Lagrange multiplier approach. Lawry & Maute illustrate the approach on the design of anchors embedded in a host material. It should be noted that the method is developed based on small displacement gradients and that there are no gaps in this approach, i.e. there is no void region between the contacting surfaces, which has to be passed before contact is established.

A promising new approach to include internal self-contact in topology optimization has recently been proposed [1]. This approach is very appealing to topology optimization since it: (1) utilizes the already present void region as a contact medium, i.e. requires no additional regions or surfaces to be defined, and (2) implies a differentiable contact formulation. Specifically, the method incorporates the third medium contact method [25] into density-based topology optimization by exploiting the void region as a contact medium. Third medium contact is an implicit contact established by the stiffening of a highly compliant medium compressed between the contacting bodies. The method is differentiable since the third medium has a finite stiffness, albeit very low, at any level of compression with non-zero volume. This results in the contact being included in the sensitivities during optimization, thus making the third medium contact method very attractive for gradient-based topology optimization.

The works by [1, 11, 13, 18] are at present the only approaches known to the authors which include internal contact in topology optimization with the aforementioned limitations. In addition to these, a range of different approaches to include external contact interfaces exist. A good overview may be found in [9], where the authors themselves introduce an approach to include frictional contact between members of the design domain and some external boundary. An overview of earlier work is given in a review paper by Hilding, Klarbring, and Petersson [7]. The authors of [11] also have prior work with a very similar approach, however, without contact between different members in the design domain, i.e. contact is limited to masks specified in the method [10].

Usually, in fictitious domain methods, the void region will tend to invert and introduce numerical instabilities when severely deformed. This issue can be alleviated in various ways. Common approaches include (1) convergence criterion relaxation [17], (2) void element removal [4], and (3) void element linearization [24]. However, none of these approaches are well suited for topology optimization with third medium contact. Convergence criterion relaxation relaxes the convergence criterion for void regions; however, for third medium contact, the void region is vital as it serves as a contact medium and thus should not be compromised. Void element removal is not a viable option since the void elements are needed as a contact medium. Void element linearization is not a suitable option either, as shear locking in the contact, where elements are highly compressed, will add non-physical stiffness to the contact. An approach more suitable when considering third medium contact has recently been introduced [1]. This method introduces a void regularization term that adds strain energy to bending and warping deformations in the void elements. The effect of void regularization on the physical behavior of the structure without contact is negligible, since a very low degree of regularization provides sufficient stabilization.

A challenging design problem is that of a stiff coupling subjected to large deformations. For such problems, maximization of reaction forces can lead to designs at the very limit of their stability, where small displacement perturbations may cause the coupling to disengage. The present work addresses this issue by adding tangent stiffness terms to the design objective for couplings subject to large deformations; i.e. if an objective function maximizes a given point on a curve, then the slope of the curve at this point is also included in the objective function. A topology optimization approach that includes a dilated and an eroded density field is applied together with a staggered solution approach employing the widely used Method of Moving Asymptotes (MMA) [22]. Third medium contact is included through the applied material law and Solid Isotropic Material Interpolation with Penalization (SIMP) [20].

Section 2 outlines the modeling approach by (a) defining the material model including void regularization, (b) defining the material interpolation scheme including the filtering and projection method employed, and (c) stating the minimization problem and the solution algorithm employed to solve the problem. Section 3 applies the modeling approach to three problems: (A) a lifting mechanism, (B) a stiff coupling problem resulting in the formation of hooks, and (C) a bending problem inspired by an endoscope bending section. Conclusions are included in Sect. 4 and the general notation employed throughout the present work is summarized in Table 1.

2 Modeling approach

2.1 Material model

The hyperelastic material model including void regularization presented by [1] is adopted. The model is restated below with a minor change to the scaling of the regularization term.

Material strain energy density is expressed by an isotropic neo-Hookean law

$$\begin{aligned} \overline{\Psi }(u) = \dfrac{K}{2}(\ln |F|)^2 + \dfrac{G}{2} \left( |F|^{-2/3} ||F||^2-3\right) \end{aligned}$$
(1)

where \(F=I+\nabla u\) is the deformation gradient tensor, and K and G are bulk and shear modulus respectively, which are \(K=5/3\) MPa and \(G=5/14\) MPa for all examples treated in the present work.

Table 1 Notation conventions

An augmented strain energy density expression is obtained by adding a void regularization term to the material strain energy density

$$\begin{aligned} \Psi (u) = \overline{\Psi }(u) + k_r\, \dfrac{1}{2} {\mathbb {H}}u \, \vdots \, {\mathbb {H}}u \end{aligned}$$
(2)

where \({\mathbb {H}}u\) is the Hessian of the displacement field u, and \(k_r\) is a scaling constant given by

$$\begin{aligned} k_r = \bar{k_r} L^2 K, \end{aligned}$$
(3)

where L is a characteristic length scale of the structure. In the original form presented in [1], the regularization term in Eq. (2), was scaled by the factor \(\text {exp}(-5|F|)\), such that regularization diminishes in regions under tension. This term has been omitted in the present work to have a homogeneous regularization throughout the domain. Additionally, the void indicator function from [1] which ensured that regularization was only applied in void regions has been removed. With an adequately small value of \(\bar{k_r}\) the contribution of the regularization to the strain energy density in solid regions is negligible. The constant \(\bar{k_r}\) is set to \(\bar{k_r}=10^{-6}\) for consistency with [1]. Lower values reduce possible stiffening of the void region, whereas higher values stabilize the problem.

The regularization term effectively stabilizes void regions by penalizing higher order deformations, i.e. warping and bending deformations. A value of \(\bar{k_r}\) should be chosen as small as possible to reduce the effect of regularization on the physical behavior of the problem, yet sufficiently large to effectively stabilize void regions.

Mechanical equilibrium can be expressed in a general weak form

$$\begin{aligned} {\mathcal {V}}(u,q; \delta u, \delta q) = 0 \quad \forall \,\, \delta u, \delta q \end{aligned}$$
(4)

where

$$\begin{aligned} {\mathcal {V}}(u,q; \delta u, \delta q)&= \int _\Omega \Psi _{,u}(u;\delta u) \, d\, \Omega \nonumber \\&\quad + \int _{\Gamma _D} \left\{ q\cdot \delta u + (u-u_D) \cdot \delta q \right\} \, d\, \Gamma _D. \end{aligned}$$
(5)

Here, \(\Omega \) is the modeling domain, \(\Psi _{,u}(u;\delta u)\) is the first variation of the strain energy density with respect to u, \(\Gamma _D\) is a boundary on the domain where a displacement \(u_D\) may be prescribed, and q is a vector field representing the reaction traction on the boundary \(\Gamma _D\) as a result of the enforced displacement \(u_D\).

2.2 Contact through material interpolation

In topology optimization, the stiffness of the material at any given point should depend on the material density such that solid regions represent the material model and void regions represent the absence of material. Values in between these two extremes are interpolated. In this case, the material interpolation may be introduced by multiplying the strain energy density from Eq. (1) with a material interpolation function, here denoted by \(\gamma (\tilde{\rho })\). By introducing this material interpolation, the mechanical equilibrium, as introduced in the previous section, takes the form

$$\begin{aligned}&{\mathcal {R}}(\tilde{\rho },u,q; \delta u, \delta q) \nonumber \\&\quad = \int _\Omega \left\{ \gamma (\tilde{\rho }) \, \overline{\Psi }_{,u}(u;\delta u) + k_r\, {\mathbb {H}}u \, \vdots \, {\mathbb {H}}\delta u \right\} \, d\, \Omega \nonumber \\&\qquad + \int _{\Gamma _D} \left\{ q\cdot \delta u + (u-u_D) \cdot \delta q \right\} \, d\, \Gamma _D = 0 \end{aligned}$$
(6)

where \(\tilde{\rho }\) is a density field.

The material interpolation \(\gamma (\tilde{\rho })\) is obtained by combining the SIMP scheme [20] and a smooth Heaviside projection function \(\bar{\tilde{\rho }}(\tilde{\rho })\), resulting in

$$\begin{aligned} \gamma (\tilde{\rho }) = \gamma _0 + (1-\gamma _0) \bar{\tilde{\rho }} (\tilde{\rho })^{\,p}, \end{aligned}$$
(7)

where p is a penalization parameter and \(\gamma _0\) is a minimum stiffness value of \(\gamma (\tilde{\rho })\). The projection function \(\bar{\tilde{\rho }}(\tilde{\rho })\), which yields the physical material density, projects values of \(\tilde{\rho }\) towards 0 and 1. It is described in the following section. A penalization of \(p=3\) is applied throughout the present work. In solid regions \(\gamma (1)=1\) and in void regions \(\gamma (0)=\gamma _0\). Thus, \(\gamma _0\) expresses the difference in magnitude of the strain energy density expression from Eq. (1) between solid and void regions. In the undeformed configuration, this corresponds to the stiffness ratio between solid and void regions.

It should be emphasized that the material interpolation, i.e. the scaling of the strain energy density, naturally introduces third medium contact to the mechanical model. If the parameter \(\gamma _0\) is chosen sufficiently low, the void may be deformed with close to no resistance. However, when void regions are compressed towards zero volume, the neo-Hookean material model stiffens the region and thus enables it to transfer loads. If the parameter \(\gamma _0\) is chosen too high, parasitic forces will affect the design obtained as a result of the optimization. This has been a point of critique of the third medium contact method [26]. However, choosing a sufficiently low value alleviates this issue. Figure 1 shows the contact problem from [1] which serves as an example. The effect of \(\gamma _0\) is shown in Fig. 2 for three different displacements imposed on the problem. From Fig. 2 it is evident that high values of \(\gamma _0\) 1) transfer forces between non-contacting members through the void and 2) do not establish proper contact when contact is expected. A value of \(\gamma _0=10^{-6}\) yields results with an acceptably low level of parasitic forces for the neo-Hookean material from Eq. (1). Thus \(\gamma _0=10^{-6}\) is used throughout the present work. This stiffness contrast value is also common in structural topology optimization in general.

Fig. 1
figure 1

C-shape problem with void region \(\Omega _{\textrm{v}}\) and solid region \(\Omega _s\). Thickness \(t=0.1L\)

Fig. 2
figure 2

C-shape structure deformed by \(u_{Dy}=0.5L\), \(u_{Dy}=-0.3L\), \(u_{Dy}=-0.4L\) for three different values of \(\gamma _0\)

An evaluation of the total strain energy in a given finite element for the case of \(u_{D_y}=-0.4L\) and \(\gamma _0=10^{-6}\), reveals that the ratio between energy from the regularization term and the Neo-Hookean material is \(1.25\cdot 10^{-3}\), when evaluated in the element with the highest level of regularization energy in the void region. This emphasises that the physics are dominated by the material law and not void regularization. The corresponding ratio in the solid region is \(0.67\cdot 10^{-3}\), which supports the argument from Sect. 2.1 stating that the void indicator function may be neglected.

2.3 Parametrization of the physical material density field

A well-established method in topology optimization is to work with a smooth density field \(\tilde{\rho }\), obtained through a filtering step applied to an underlying design field \(\rho \), discretized either as elementwise constant or with linear finite elements [21, 23].

Helmholtz filtering, proposed in [14], is a rather simple and universal approach which finds a smooth field \(\tilde{\rho }\) by solving a linear PDE

$$\begin{aligned} \int _{\Omega } (\tilde{\rho }-\rho ) \, \delta \tilde{\rho } + r^2 \nabla \tilde{\rho } \cdot \nabla \delta \tilde{\rho } ~ d\Omega = 0 \end{aligned}$$
(8)

with natural boundary conditions on \(\partial \Omega \). In general, \(\rho \) and \(\tilde{\rho }\) can be approximated in distinct discrete finite element spaces. After discretization, Eq. (8) is equivalent to

$$\begin{aligned} \textbf{M}_1 \cdot \tilde{\varvec{\rho }} + \textbf{M}_0 \cdot \varvec{\rho } = 0 \quad \Rightarrow \quad \tilde{\varvec{\rho }} = - \textbf{M}_1^{-1} \textbf{M}_0 \cdot \varvec{\rho } \end{aligned}$$
(9)

where \(\varvec{\rho }\) and \(\tilde{\varvec{\rho }}\) are the corresponding discretized vectors, and \(\textbf{M}_0\) and \(\textbf{M}_1\) are the assembled tangent matrices from Eq. (8), for the coupling between the two variables. Linearity with respect to \(\tilde{\rho }\) allows for a factorization of the system, as done in [14]. Here, an LU factorization is applied to \(\textbf{M}_1\) and its transpose.

The filtering step outlined above yields a smooth density field \(\tilde{\rho }\) characterized by intermediate densities. In order to 1) obtain a design dominated by solid and void regions and 2) enable sharper transitions between solid and void, the filtered density \(\tilde{\rho }\) is projected through the function

$$\begin{aligned} \bar{\tilde{\rho }}(\tilde{\rho }) = \dfrac{\tanh (\beta \eta ) + \tanh (\beta (\tilde{\rho }-\eta ))}{\tanh (\beta \eta ) + \tanh (\beta (1-\eta ))} \end{aligned}$$
(10)

where \(\beta \) is a projection parameter and \(\eta \) is a threshold parameter. Values of \(\tilde{\rho }\) above \(\eta \) are projected towards 1, and values below \(\eta \) are projected towards 0. The intensity of this projection is controlled by \(\beta \). Two thresholds are applied, \(\eta _e\) and \(\eta _d\) with \(\eta _e>\eta _d\). The application of the thresholds, which respectively yield an eroded design \(\bar{\tilde{\rho _e}}\) and a dilated design \(\bar{\tilde{\rho _d}}\), is outlined in Sect. 2.4 [23]. Here, the aim is to penalize small features in the design, and not to control the length scale directly. Thus the choice of the thresholds is not vital, they are set to \(\eta _e=0.50\) and \(\eta _d=0.40\) throughout the present work. Subscripts e and d are added to \(\tilde{\rho }\) to indicate whether the filtered design \(\tilde{\rho }\) shall be eroded or dilated if passed through the projection function of Eq. (10).

2.4 Minimization problem

A general formulation of the design problem is the minimization of an objective function \(C(\bar{\tilde{\rho }},u,q)\) subject to the constraint of mechanical equilibrium, an upper bound on the total material volume in the design domain, and a box constraint on the design variable

$$\begin{aligned} \begin{array}{rl} \min _\rho &{} \ C(\tilde{\rho }_e,u,q) \\ s.t.: &{} \ {\mathcal {R}}(\tilde{\rho }_e, u,q; \delta u, \delta q) = 0 \quad \forall \,\, \delta u, \delta q \\ &{} \ \int _\Omega \bar{\tilde{\rho }}(\tilde{\rho }_d) \, d\Omega \le V^* \\ &{} \ 0 \le \rho \le 1. \end{array} \end{aligned}$$
(11)

The utilization of two different design fields \(\tilde{\rho }_e\) and \(\tilde{\rho }_d\) is adapted from the robust formulation in topology optimization [23], where an eroded, an intermediate, and a dilated design are used to enforce a length scale on the final design. The full robust formulation relies on a min-max formulation including all three designs. This is costly, and not strictly needed in this case as no specific length scale has to be enforced. Thus, a different approach is applied where the objective and the mechanical equilibrium are both defined on an eroded design, while the volume constraint is defined on a dilated design. Letting the volume constraint be defined on a dilated design and the mechanical equilibrium be defined on an eroded design, essentially serves as a penalization of thin features, i.e. thin features will add little stiffness and be very costly in terms of the material volume they require. By increasing the difference between \(\eta _e\) and \(\eta _d\) in Eq. (10) or by increasing the filter radius r in Eq. (8) small features become increasingly uneconomical. This approach is distinct from the robust formulation, as it neither directly controls the length scale nor necessarily eliminates all gray-scale. Rather, it only serves as a penalization for thin features. It should be noted that since the volume constraint is defined on the dilated design only, the eroded design will always use less material volume as specified on the dilated design.

Following the approach in [1] the mechanical equilibrium constraint can be eliminated by minimizing the augmented objective function

$$\begin{aligned} C^*(\tilde{\rho }_e,u,q) = C(\tilde{\rho }_e,u,q) +{\mathcal {R}}(\tilde{\rho }_e, u,q; \lambda _u, \lambda _q), \end{aligned}$$
(12)

where \(\lambda _u\) and \(\lambda _q\) are Lagrange multipliers in the spaces of \(\delta u\) and \(\delta q\) respectively. Assuming an additive split of the objective function

$$\begin{aligned} C(\tilde{\rho }_e,u,q) = C_{\tilde{\rho }}(\tilde{\rho }_e) + C_u(u) + C_q(q) \end{aligned}$$
(13)

allows for a direct application of the adjoint method. The additive split results in the total variation of the objective function

$$\begin{aligned} \delta C^*&= C_{\tilde{\rho },\tilde{\rho }}(\tilde{\rho }_e; \delta \tilde{\rho }) + {\mathcal {R}}_{,\tilde{\rho }} (\tilde{\rho }_e, u,q; \lambda _u, \lambda _q ; \delta \tilde{\rho }) \nonumber \\&\quad + C_{u,u}(u; \delta u) + {\mathcal {R}}_{,u}(\tilde{\rho }_e, u,q; \lambda _u, \lambda _q ; \delta u) \nonumber \\&\quad + C_{q,q}(q; \delta q) + {\mathcal {R}}_{,q} (\tilde{\rho }_e, u,q; \lambda _u, \lambda _q ; \delta q), \end{aligned}$$
(14)

which is simplified by determining the multipliers \(\lambda _u\) and \(\lambda _q\) satisfying the adjoint equations

$$\begin{aligned} 0&= C_{u,u}(u; \widehat{\delta u}) \nonumber \\&\quad + {\mathcal {R}}_{,u}(\tilde{\rho }_e, u,q; \lambda _u, \lambda _q ; \widehat{\delta u}) = 0 \quad \forall \,\, \widehat{\delta u} \end{aligned}$$
(15)

and

$$\begin{aligned} 0&= C_{q,q}(q; \widehat{\delta q}) \nonumber \\&\quad + {\mathcal {R}}_{,q}(\tilde{\rho }_e, u,q; \lambda _u, \lambda _q ; \widehat{\delta q}) = 0 \quad \forall \,\, \widehat{\delta q}, \end{aligned}$$
(16)

where \(\,\widehat{}\,\) is used to distinguish the variations in the adjoint Eqs. (15) and (16), from the variations in the mechanical equilibrium Eq. (2.2). The solution of the adjoint system eliminates the variations in \(\delta u\) and \(\delta q\) from the variation of the objective function, thus reducing it to

$$\begin{aligned} \delta C^* = C_{\tilde{\rho },\tilde{\rho }} (\tilde{\rho }_e; \delta \tilde{\rho }) + {\mathcal {R}}_{,\tilde{\rho }}(\tilde{\rho }, u,q; \lambda _u, \lambda _q ; \delta \tilde{\rho }). \end{aligned}$$
(17)

This variation is stationary, i.e. \(\delta C^* = 0\) at optimum. However, in the approach outlined in the following section, this stationary condition is not solved explicitly. Rather, Eq. (17) is used to determine the sensitivities of the objective function.

In the above, variations in the design are with respect to the field \(\tilde{\rho }\), however, \(\tilde{\rho }\) depends on the field \(\rho \), which in this case represents the design variable. The two fields \(\tilde{\rho }\) and \(\rho \) are related through the filtering outlined in Sect. 2.2. Since the system for the filtering in Sect. 2.2 is factorized, the transition from \(\tilde{\rho }\) to \(\rho \) may be done efficiently after discretization. This is relevant when computing the sensitivities of the augmented objective function (12) and the volume constraint (11) with respect to the design variable. These sensitivities are needed in order to apply MMA for the design update. To clarify this, consider the example of \({\mathcal {R}}_{,\tilde{\rho }}(\tilde{\rho }, u,q; \lambda _u, \lambda _q; \delta \tilde{\rho })\) which may be written as \(\partial {\mathcal {R}}/\partial \tilde{\varvec{\rho }} \cdot \delta \varvec{\rho }\) in its discrete form. Then the discrete form of \({\mathcal {R}}_{,\rho }(\tilde{\rho }, u,q; \lambda _u, \lambda _q; \delta \rho )\) can be obtained as

$$\begin{aligned} \dfrac{\partial {\mathcal {R}}}{\partial \varvec{\rho } } \cdot \delta \varvec{\rho }&= \left( \dfrac{\partial \tilde{\varvec{\rho }} }{\partial \varvec{\rho }}\right) ^T \dfrac{\partial {\mathcal {R}}}{\partial \tilde{\varvec{\rho }} } \cdot \delta \varvec{\rho } \nonumber \\&= -\textbf{M}_0^{T} \textbf{M}_1^{-T} \dfrac{\partial {\mathcal {R}}}{\partial \tilde{\varvec{\rho }} } \cdot \delta \varvec{\rho }, \end{aligned}$$
(18)

where, rather than computing the inverse of \(\textbf{M}_1\), the factorized system is solved. The same procedure is applied when calculating the volume constraint sensitivities.

2.5 Solution algorithm

In contrast to [1] where a monolithic approach is used, here we apply a staggered solution approach where the mechanical equilibrium Eq. (2.2), the adjoint problem Eqs. (15, 16), and the design update are solved in a consecutive order. The procedure is illustrated in Fig. 3.

Fig. 3
figure 3

Staggered solution approach

Optimization is only considered in the deformed configuration, which initially is reached by ramping up the displacement on the initial guess. Since reaching the deformed configuration by ramping up the displacement is costly, this is only done once. All following updates to the deformed configuration are based on the deformed configuration from the previous design iteration.

After an update of the mechanical equilibrium (2.2), the adjoint variables \(\lambda _u\) and \(\lambda _q\) are determined by solving Eqs. (15) and (16). The adjoint variables are used to determine the value of the augmented objective function from Eq. (12) and its sensitivity with respect to the design variable given in Eq. (17). These are needed for the MMA design update.

Each design iteration is followed by an evaluation of a criterion for the increase of \(\beta \). This is according to the standard robust formulation [23] where the \(\beta \)-continuation yields increasingly sharp transitions between solid and void regions. The upper limit \(\beta _{max}\) is chosen such that the transition between solid and void regions is sharp, yet sufficiently smooth for the contact not to depend directly on the discretization. Convergence is evaluated based on the change in the design variable \(\rho \), where \((\Delta \rho )_{max}\) is the limit for the maximum change in any value of \(\rho \) when the design has converged. It should be noted that \(\beta \) is increased by a factor of 1.2 when the threshold is progressed in Fig. 3. This is a rather low value for the progression parameter, however, this level is chosen in order to retain stability when the threshold is progressed.

The approach outlined above is implemented in Python where all tangent matrices and residual vectors are computed through the library GetFEM [19] which performs all underlying computations in C++. Design updates are based on a Python implementation [6] of MMA [22].

3 Results and discussion

3.1 Push-lift mechanism

To illustrate how the method may be applied, we use the example shown in Fig. 4 with periodic boundaries on the left and right side of the domain. In general, four horizontal translations:

$$\begin{aligned}&(a^+)\quad u_D= u_{max} , \qquad (a^-)\quad u_D=-u_{max} \\&(b^+)\quad u_D= u_{min} , \qquad (b^-)\quad u_D=-u_{min} \end{aligned}$$

are enforced on the top boundary \(\Gamma _D\). As a first example, an objective function is considered that utilizes only the first two cases \((a^+)\) and \((a^-)\). This objective function maximizes the sum of the vertical reaction forces on \(\Gamma _D\) in the two deformed configurations. It has the form

$$\begin{aligned} C_0(\tilde{\rho }_e,u,q) = k_q \left( -(Q_{a^+}\cdot n) - (Q_{a^-}\cdot n) \right) \end{aligned}$$
(19)

where

$$\begin{aligned} Q_i = \int _{\Gamma _D} q_i\, d \Gamma _D \end{aligned}$$
(20)

are the reaction forces in configuration \((a^+)\) and \((a^-)\) respectively. The factor \(k_q\) is a scaling constant and n is the upward unit normal vector shown in Fig. 4.

Fig. 4
figure 4

Periodic design domain \(L\times L\) for push-lift with indicated initial guess on \(\rho \) for \(t=0.5L\)

Numerical parameters for the problem are specified in Table 2. The initial guess is as indicated by \(\rho \) in Fig. 4, where the lower density in the \(t\times t\)-area serves to break symmetry. The displacement field u is discretized by Q2 elements and the density fields \(\rho \) and \(\tilde{\rho }\) are discretized by Q1 elements. Surface traction q is discretized identically to u on the boundary \(\Gamma _D\). Gauss quadrature with nine Gauss points is applied for the numerical integration of all elements. Results without volume constraint, i.e. \(V^*=1.0\), are shown in Fig. 5.

Table 2 Parameters for push-lift mechanism
Fig. 5
figure 5

Grey-scale image reference design and results for physical design (\(\bar{\tilde{\rho }}(\tilde{\rho }_e)\)) optimized for objective function \(C_0\) without volume constraint \(V^*=1.0\). Red dots track displacements from undeformed to deformed configuration. Results are shown for 2 periods of the periodic domain

Despite having no volume constraint, the design shown in Fig. 5 has a clear gap separating the structure into an upper and a lower part. The maximum threshold value \(\beta _{max}\) from Table 2 ensures a fast transition from solid to void, this is in order to have a physically sound contact interface.

The gap width is indirectly controlled by changing the filter radius. However, the curved interfaces of the gap in the optimized design are not intuitive. An intuitive alternative to the optimized design could be a narrow gap at a 45\(^\circ \) angle as shown in Fig. 5 as a reference design. A better understanding of the optimized design can be obtained by comparing the force-displacement curves for the two designs, shown in Fig. 6. In the deformed configuration \(u_D=u_{max}\) the optimized design (blue curve) has a higher vertical load, thus also performing better with respect to the objective function \(C_0\). Two red dots have been added to Fig. 5 to motivate why this is the case. The dots are initially at the same height, with equal spacing for the optimized and the reference design. In the deformed configuration, the vertical distance between the points is higher for the optimized design than for the reference design, this indicates a higher level of compression at this point, and thus a higher reaction force in the vertical direction. Thus, the wave-like shape appears to provide an adaption of the contact surfaces that provides a larger force at large horizontal translation.

Fig. 6
figure 6

Force-displacement curves for lifting mechanism designs. \(C_0\) optimized design and reference design

In order to gain greater control over the contact as well as the point at which contact is established, the two additional control points \((b^+)\) and \((b^-)\) may be added to the objective function

$$\begin{aligned} C_1(\tilde{\rho }_e,u,q)&= k_q \big ( -(Q_{a^+}\cdot n) -(Q_{a^-}\cdot n) \nonumber \\&\quad + k_s\,||Q_{b^+}||^2 + k_s\,||Q_{b^-}||^2 \big ), \end{aligned}$$
(21)

where \(k_s\) is a new scaling constant. The additional terms penalize any resulting force on \(\Gamma _D\) at the displacement \(\pm u_{min}\), thus discouraging contact for \(-u_{min}<u_D<u_{min}\). Results using the objective function \(C_1\) are shown in Fig. 7.

The force-displacement curves obtained by these cases are shown in Fig. 8. For the \(C_1\) objective function, there is a significant increase in the reaction force after the displacement \(u_{min}\) is reached. This reflects that contact is established in the vicinity of this point. The objective function \(C_1\) thus serves the intended purpose. Also, for \(V^*=1.0\) the reaction force at \(u_{max}\) is higher than for \(V^*=0.6\), and it is slightly lower at \(u_{min}\), this reflects the improvement obtained with a higher volume fraction.

3.2 Self-engaging hooks

Consider the domain shown in Fig. 9 where \(\Gamma _D\) is a boundary on which a vertical displacement is prescribed. The region \(\Omega _{\textrm{v}}\), which includes the boundaries \(\Gamma _{top}\) and \(\Gamma _{bot}\), is a prescribed void region, and \(\Omega _d\) designates the design region, which is split into two parts with equal dimensions. An objective for this problem may be to maximize the vertical reaction force on the boundary \(\Gamma _D\) given a downward displacement \(u_0\). If the displacement \(u_0\) is large, the reaction force on the boundary \(\Gamma _D\) of the optimized design is very likely an extremum with respect to the displacement \(u_0\). In this case, any perturbation increasing the displacement may cause the structure to snap and disengage. Thus, the resulting design is not expected to be robust with respect to the displacement in its deformed configuration. A simple yet effective approach to obtain a more robust design is to incorporate a requirement for a positive tangent stiffness of the deformed configuration in the objective function. Here, a small perturbation \(\Delta u\) is used either in the horizontal or vertical direction with respect to the initial displacement \((0,-u_0)\). It should be noted that controlling the behavior between the two displacement values \(u_0\) and \(u_0+\Delta u\) does not provide any guarantee that the force-displacement curve will increase monotonically for imposed displacements between 0 and \(u_0\). If one would like to enforce such a condition, a path following optimization would be necessary that accounts for the entire loading path and detects any critical points. The present work is limited to the optimization of the structural behavior locally around a specific point in the force-displacement response.

Fig. 7
figure 7

Grey-scale image of results for physical design (\(\bar{\tilde{\rho }}(\tilde{\rho }_e)\)) illustrated by 2 periods for objective function \(C_1\) at displacements \(u_D=0\), \(u_D=u_{min}\), and \(u_D=u_{max}\) for volume fractions \(V^*=\) 1.0 and \(V^*=\) 0.6

Fig. 8
figure 8

Force-displacement curves for lifting mechanism designs

Fig. 9
figure 9

Domain of self-engaging hooks problem. Initial guess \(\rho =0.5\) in \(\Omega _d\). Points used for enforced displacements of \(\Gamma _D\) are illustrated to the right

Let T and \(T'\) respectively be the vertical and horizontal reaction forces on the boundary \(\Gamma _D\)

$$\begin{aligned} T&= Q\cdot \hat{n} = \int _{\Gamma _D} q\cdot \hat{n}\, d \Gamma _D, \end{aligned}$$
(22)
$$\begin{aligned} T'&= Q\cdot n = \int _{\Gamma _D} q\cdot n\, d \Gamma _D, \end{aligned}$$
(23)

where \(\hat{n}\) is the unit tangent vector in the upward direction and n is the unit normal vector, as indicated in Fig. 9.

Fig. 10
figure 10

Representative illustration of loading history with indicated control points

Figure 10 illustrates a qualitative loading history for the reaction force in the vertical direction T on the boundary \(\Gamma _D\) as a function of the applied vertical displacement \(u_D\). In order to incorporate the tangent stiffness in the objective function, two control points, which are a distance \(\Delta u\) apart, are added, as shown in Fig. 10. A first order approximation of the aforementioned tangent stiffness can be based on these two control points

$$\begin{aligned} \dfrac{\text {d}T}{\text {d}u_D} \Bigg |_{u_D=u_{0}} \approx \dfrac{\Delta T}{\Delta u}. \end{aligned}$$
(24)

A straightforward way to include this tangent stiffness is to penalize tangent stiffness values below a given threshold. Here, we chose to penalize tangent stiffness values below the average stiffness of the structure, represented by the secant stiffness \(T_0/u_0\). The tangent stiffness can now be controlled by penalizing values of the tangent stiffness in the deformed configuration being smaller than the average stiffness, i.e. positive values of

$$\begin{aligned} \dfrac{T_0}{u_{0}} - \dfrac{\Delta T}{\Delta u}. \end{aligned}$$
(25)
Table 3 Parameters for self-engaging hook problem

For improved stability, the same logic can be applied to a horizontal perturbation \(\Delta u'\) on \(\Gamma _D\) by penalizing tangent stiffness values below 1/10 of the average stiffness. The perturbations are illustrated in figure Fig. 9, note that the enforced displacement is negative in the y-direction and positive in the x-direction, thus the signs of the terms (25) are flipped. The objective now has the form

$$\begin{aligned} C(\tilde{\rho }_e,u,q)&= k_q \bigg (-(T_0+\Delta T) \nonumber \\&\quad + k_s \dfrac{1}{2} \left\langle \dfrac{\Delta T}{\Delta u} - \dfrac{T_0}{u_{0}} \right\rangle ^2 \nonumber \\&\quad + k_s \dfrac{1}{2} \left\langle -\dfrac{\Delta T'}{\Delta u'} -\dfrac{T_0}{u_{0}} \dfrac{1}{10} \right\rangle ^2 \bigg ). \end{aligned}$$
(26)

The first term in the objective function \((T_0+\Delta T)\) is the reaction force in the deformed configuration \((0,-u_{0}-\Delta u)\). The second term in Eq. (26) penalizes tangent stiffness values for downward perturbations \(\Delta u\) being smaller than the average stiffness \(-T/u_{0}\). The third term penalizes transverse stiffness, i.e. the change in the reaction force T with respect to a horizontal perturbation \(\Delta u'\) on \(\Gamma _D\). Thus, the objective function includes a tangent stiffness term for vertical as well as horizontal displacements on top of the deformed configuration. The factor \(k_q\) scales the objective function in order to obtain an adequate scaling for the augmented objective function in Eq. (12) and \(k_s\) is the relative weight applied to the penalization of the tangent stiffness terms.

Numerical parameters for the problem are specified in Table 3 and discretizations remain as specified in Sect. 3.1. A relatively large filter radius is applied in order to avoid very slender members that can lead to local nonlinear buckling. Accounting for such buckling modes would add significant computational cost and complexity to the proposed method and it is left for future work. Results for three different values of the enforced displacement \(u_{0}\) are shown in Fig. 11 with the meshed region indicated on Fig. 11a. The three designs all resemble two opposing hooks—to some extent. In the deformed configuration, these hooks engage, this is shown in Fig. 12 for the design from Fig. 11c. A magnification in Fig. 12 shows the void—which remains stable due to the regularization—being fully compressed to a state where it reflects contact.

Force-displacement curves as shown in Fig. 13 are obtained as the hooks are deformed through the prescribed loading history. As may be expected, the design obtained for \(u_{0}=2.0\,t\) has the highest force among the three designs at \(u_D=2.0\,t\). Likewise for \(u_{0}=2.5\,t\) at \(u_D=2.5\,t\). In the deformed configuration, as shown by the magnification for the design obtained for \(u_{0}=3.0\,t\) in Fig. 13, the tangent stiffness closely matches the average stiffness. Thus, showing that the first penalization term in the objective function Eq. (26) remains active until the converged state. A magnification of the \(u_{0}=2.5\,t\) design in Fig. 13 shows a jump in the force-displacement curve. This jump is caused by the engagement of the non-overlapping tips of the hooks from Fig. 11b.

Fig. 11
figure 11

Optimized designs obtained for three different values of the enforced displacement \(u_0\)

3.3 Bending mechanism

This section applies the method outlined in Sect. 2 to a bending problem that is inspired by the bending section found in endoscopes. Endoscope bending sections, which comprise the controllable part at the distal end of an endoscope, typically comprise periodic structures. Thus, when designing such a component, it is reasonable to focus on a single unit of the periodic structure. An illustration of a bending section and the repeated unit is shown in Fig. 14. Let the design domain of the repeated unit from Fig. 14 be defined as shown in Fig. 15a where the boundaries \(\Gamma _{top}\) and \(\Gamma _{bot}\) are two consecutive cross sections through the periodic structure resulting in a single repeated unit.

Fig. 12
figure 12

Hooks optimized for \(u_0=3.0\,t\) at displacement in deformed configuration (\(u_D=3.0\,t\))

During use, the endoscope bending section is deformed such that the segment in Fig. 15a forms a section of an annulus as shown in Fig. 15b, where the arc length at the center of the annular section has the length H. Deformations are prescribed on the outer boundary \(\partial \Omega \) by specifying the angle \(\alpha \) of the annular section. There are no strains along the boundaries \(\Gamma _{top}\) and \(\Gamma _{bot}\), i.e. they rotate as rigid bodies.

From the perspective of the endoscopist, it may be desirable to have a bending section that can bend very easily at any angle below a certain threshold. This way, the endoscopist may easily maneuver the bending section without it surpassing a certain curvature. Surpassing the threshold angle may cause damage to tools being passed through the endoscope. Further, it may be desirable for the obtained design to be subject to a state of pure bending. This may reduce interactions with other components in the endoscope bending section. Additionally, the control of the endoscope is simpler for a state of pure bending with no bending-stretching coupling.

Reaction forces and bending moment on the respective boundaries are calculated through the reaction traction q by

$$\begin{aligned} Q_i&= \int _{\Gamma _i} q \, d \Gamma _i \quad \text {and}\nonumber \\ M_i&= \int _{\Gamma _i} ((q-\bar{q}_i) \cdot n) (p \cdot \hat{n}) \, d \Gamma _i, \end{aligned}$$
(27)

where n and \(\hat{n}\) respectively are the unit normal and tangent vectors shown in Fig. 15b, p is a point on the boundary \(\Gamma _i\), and \(\bar{q}_i\) is the average surface traction.

Fig. 13
figure 13

Force-displacement curves for hook designs from Fig. 12

Fig. 14
figure 14

Bending section with periodic structure

Fig. 15
figure 15

Domain of bending section with prescribed solid (black) and prescribed void (white). Initial guess \(\rho =0.4\) in \(\Omega _d\)

Based on two angular control points \(\alpha _0\) and \(\alpha _1\) where \(\alpha _0<\alpha _1\), the desired properties may be cast into an objective function that approximates the desired outcome. Here we propose an objective function defined by

$$\begin{aligned}&C(\tilde{\rho }_e,u,q) \nonumber \\&\quad = k_q \bigg ( - M_{top}|_{\alpha _1} - M_{bot}|_{\alpha _1} \nonumber \\&\qquad + k_m \left( M^2_{top}|_{\alpha _0} + \,M^2_{bot}|_{\alpha _0}\right) \nonumber \\&\qquad + k_s \, \left( ||Q_{top}||^2|_{\alpha _0} + ||Q_{bot}||^2|_{\alpha _0} \right) \bigg ). \end{aligned}$$
(28)

The objective function in Eq. (28) minimizes any positive or negative values of the bending moment at an angle \(\alpha _0\), this ensures low bending resistance at low angles. Simultaneously, it maximizes the bending moment at an angle \(\alpha _1>\alpha _0\), which inhibits bending at large angles. Inclusion of the terms containing the reaction forces ensures that reaction forces are minimized at the relevant boundaries. \(k_s\) is a weighting factor for the reaction forces on the boundaries \(\Gamma _{top}\) and \(\Gamma _{bot}\). Likewise, \(k_m\) is a weighting factor for the bending moment at angle \(\alpha _0\). Higher values of \(k_m\) increasingly penalize bending moments at lower angles.

Fig. 16
figure 16

Bend design at angles \(\alpha =0\), \(\alpha =\alpha _0\), and \(\alpha =\alpha _1\) for \(\alpha _0=14^\circ \) and \(\alpha _0=18^\circ \)

Fig. 17
figure 17

Resulting bending moment and force for bending problem

Table 4 Parameters for bend problem

Results for two different values of the control point \(\alpha _0\) and parameters listed in Table 4 are shown in Fig. 16. All designs were obtained with symmetry enforced across the vertical center line of the domain. Moreover, a buffer zone of solid material is prescribed at the bottom and top of the domain as shown in Fig. 15a. All discretizations remain as specified in Sect. 3.1. Note that the regularization scaling term \(\bar{k_r}\) has been increased to \(3\cdot 10^{-6}\) compared to \( 10^{-6}\) used in the previous two examples. This is in order to further stabilize the problem, since \(\bar{k_r}=10^{-6}\) was not sufficient to stabilize void regions in this case.

The deformed configurations show how the optimized designs establish contact around an angle \(\alpha _0\). A notable difference between the two designs is that the \(\alpha _0=14^\circ \) design includes two void regions for contact, whereas the \(\alpha _0=18^\circ \) design only includes one. In contrast to the example in Sect. 3.2 the contact in Fig. 16 does not form through a forced void region, instead the void which serves as the contact medium is a direct result of the optimization. This could also be seen in the results from Sect. 3.1. It thus shows that contacting surfaces can be established in design regions without any pre-specification of a void to serve as the contact medium.

Figure 17 shows the bending moment and the norm of the force as a function of the bending angle for the resulting designs. The slope of the moment curve, which represents the bending stiffness, significantly increases around the point \(\alpha _0\). Both moment curves show a soft kink, indicating that contact is established, at an angle of approximately \(14^\circ \) and \(16^\circ \) respectively. From the force curve, it can be seen that the force is kept at a relatively low level, as intended by the objective function until contact is established.

4 Conclusion

The present work has adapted the third medium contact method for topology optimization from [1] to standard topology optimization methods and applied it to advanced kinematic examples. This includes PDE filtering through an inhomogeneous Helmholtz equation, threshold projection, SIMP, as well as the application of MMA. To avoid non-physical exploitation of void regions, which serve as the third medium, it has proven useful to penalize small features by evaluating the volume constraint on a dilated design—as it is known from the robust formulation in topology optimization [23]. This penalization also adds an indirect control of the length scale of the obtained structures. In addition, a solution algorithm that includes \(\beta \)-continuation as proposed in [23] is suggested.

The application of the third medium contact has been extended to more complex applications, which e.q. require additional control of the tangential stiffness of the structure. Three examples have been used to illustrate possible applications as well as how the approach works for problems subject to large deformations: (1) a lifting mechanism maximizing vertical reaction force upon a horizontal displacement, (2) a design of a coupling between two domains separated by a void region, resulting in two hooks, and (3) the design of a bending mechanism inspired by the bending section of an endoscope. Results show that the optimized structures can exploit prescribed void regions to establish contact, as well as establish new void regions within the design domain to be used for contact. This inclusion of contact extends the possible solution space in topology optimization and should allow programming even more complex force-displacement responses in compliant mechanism design than provided in [15].