원시데이터 수집 시스템
선정목록으로

Level-set topology optimisation with unfitted finite elements and automatic shape differentiation

간접 관련 엔지니어링 플라스틱 · (23) 컴파운드 (4) 카시트 모듈(9) 타이어코드

기본 정보

저자
  1. Zachary J. Wegert
  2. Jordi Manyer
  3. Connor N. Mallon
  4. Santiago Badia
  5. Vivien J. Challis
DOI
10.1016/j.cma.2025.118203
저널
Computer Methods in Applied Mechanics and Engineering
발행년도
2025
발행기관
Elsevier BV
피인용수
7
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.cma.2025.118203
토픽
Composite Structure Analysis and Optimization
OpenAlex ID
W4412076063

평가 내용

관련도
간접 관련
사업분야
엔지니어링 플라스틱 · (23) 컴파운드
부 분야
(4) 카시트 모듈, (9) 타이어코드
R&D 측면
분석·모델링
확신도
0.70
근거 용어
topology optimisation, linear elastic wheel, fluid-structure interaction, finite element methods, shape differentiation
판단 근거
이 논문은 위상 최적화(Topology Optimisation) 및 형상 미분(Shape Differentiation)을 위한 수치 해석 알고리즘을 다룹니다. 이는 코오롱인더스트리의 엔지니어링 플라스틱 컴파운드 설계나 자동차 부품(카시트, 휠 관련 구조물)의 경량화 및 구조적 최적화 설계 시뮬레이션에 응용될 수 있는 방법론입니다.
R&D 활용 포인트
자동차용 경량 컴파운드 부품이나 산업용 구조물의 강성을 유지하면서 무게를 최소화하는 최적 설계 시뮬레이션 모델링 기법으로 활용 가능합니다.
평가 입력
본문 89,261자 중 30,032자 발췌

초록

In this paper we develop automatic shape differentiation techniques for unfitted discretisations and link these to recent advances in shape calculus for unfitted methods. We extend existing analytic shape calculus results to the case where the domain boundary intersects with the boundary of the background domain. We further show that we can recover these analytic derivatives to machine precision regardless of the mesh size using the developed automatic shape differentiation techniques, drastically reducing the burden associated with the analytic derivation of these quantities. In addition, we show that we can also recover the symmetric shape Hessian. We implement these techniques for both serial and distributed computing frameworks in the Julia package GridapTopOpt and the wider Gridap ecosystem. As part of this implementation we propose a novel graph-based approach for isolated volume detection. We demonstrate the applicability of the unfitted automatic shape differentiation framework and our implementation by considering the three-dimensional minimum compliance topology optimisation of a linear elastic wheel and of a linear elastic structure in a fluid-structure interaction problem with Stokes flow. The implementation is general and allows GridapTopOpt to solve a wider range of problems on unstructured meshes without analytic calculation of shape derivatives and avoiding issues that arise when material properties are smoothed at the domain boundary. The software is open source and available at https://github.com/zjwegert/GridapTopOpt.jl.

본문 89,261자

본문 펼치기
## Level-set topology optimisation with unfitted finite elements and automatic shape differentiation Zachary J. Wegert <sup>a,∗</sup>, Jordi Manyer <sup>b</sup>, Connor Mallon <sup>a</sup>, Santiago Badia <sup>b</sup>, Vivien J. Challis <sup>a,∗</sup> _aSchool of Mathematical Sciences, Queensland University of Technology, 2 George_ _St, Brisbane, 4000, Queensland, Australia_ _bSchool of Mathematics, Monash University, Wellington Rd, Clayton, 3800, Victoria, Australia_ Abstract In this paper we develop automatic shape differentiation techniques for unfitted discretisations and link these to recent advances in shape calculus for unfitted methods. We extend existing analytic shape calculus results to the case where the domain boundary intersects with the boundary of the background domain. We further show that we can recover these analytic derivatives to machine precision regardless of the mesh size using the developed automatic shape differentiation techniques, drastically reducing the burden associated with the analytic derivation of these quantities. In addition, we show that we can also recover the symmetric shape Hessian. We implement these techniques for both serial and distributed computing frameworks in the Julia package GridapTopOpt and the wider Gridap ecosystem. As part of this implementation we propose a novel graph-based approach for isolated volume detection. We demonstrate the applicability of the unfitted automatic shape differentiation framework and our implementation by considering the three-dimensional minimum compliance topology optimisation of a linear elastic wheel and of a linear elastic structure in a fluid-structure interaction problem with Stokes flow. The implementation is general and allows GridapTopOpt to solve a wider range of problems on unstructured meshes without analytic calculation of shape derivatives and avoiding issues that arise when material properties are smoothed at the domain boundary. The software is open source and available at `[https://github.com/zjwegert/GridapTopOpt.jl](https://github.com/zjwegert/GridapTopOpt.jl)` . _Keywords:_ Shape calculus, Automatic differentiation, unfitted finite element methods, CutFEM, Memory-distributed computing 1. Introduction Shape and topology optimisation are important computational techniques with a wide range of industrial applications and a substantial theoretical foundation [1, 2, 3, 4]. Generally speaking, ∗Corresponding author _Email addresses:_ `zach.wegert@hdr.qut.edu.au` (Zachary J. Wegert), `jordi.manyer@monash.edu` (Jordi Manyer), `connor.mallon@monash.edu` (Connor Mallon), `santiago.badia@monash.edu` (Santiago Badia), `vivien.challis@qut.edu.au` (Vivien J. Challis) _Preprint submitted to Elsevier_ _August 21, 2025_ there are two main branches of techniques in topology optimisation: _density_ methods [5, 6] and _level-set_ methods [7, 8]. In the former, design variables are typically material densities of elements or nodes in a mesh, while, in the latter, the boundary of the domain is implicitly tracked via a levelset function and updated using an evolution equation. In conventional level-set methods, the underlying partial differential equations are solved over a domain that is immersed in a static background domain by ‘smudging’ the boundary over the interface with a smooth Heaviside function [7, 8, 4]. This allows integration to be relaxed over the whole computational domain. While this is computationally efficient and suitable for many topology optimisation problems, it can lead to undesirable computational artefacts particularly in the case of nonlinear behaviour or solid-fluid interaction. In addition, differentiation with respect to the level-set function in a smoothed boundary regime cannot fully capture the shape derivative of a functional under a boundary perturbation [9]. Unfitted finite element methods are an alternative approach that embed a complex computational domain into a simple bounding domain without introducing additional degrees of freedom. This works by defining an _in_ and _out_ region based on the sign of the level-set function. The boundary separating the regions is the intersection of the zero isosurface of the level-set function and the background mesh, determined using an appropriate method such as marching tetrahedra [10, 11]. The boundary mesh can be used to integrate transmission conditions across the interface; for example, in the case of fluid-structure interaction. Unfitted methodologies are a promising way to address the above issues with conventional level-set methods because they provide a precise description of the boundary as a _D_ - 1 dimensional manifold. However, the small cut-cell problem affects unfitted finite element methods; the resulting discrete system is ill-posed when the portion of a cut cell in the domain interior is small [12]. This issue has been addressed by using ghost penalty stabilisation (CutFEM) [10] and discrete extension operators (AgFEM) [11]. CutFEM has been successfully applied to several topology optimisation problems, including those involving linear elasticity, fluid flow, and acoustics [13, 14, 15]. In recent work by Berggren [16], a shape calculus for unfitted discretisations was proposed based on the concept of boundary-face dilation. This can be regarded as a discretise-then-differentiate approach because it directly relies on parameterising the dilated region under a perturbation of a continuous and piecewise linear level-set function. Using this technique, Berggren [16] rigorously derived the directional shape derivatives for general volume and surface integrals in two and three dimensions, and provided the minimum regularity requirements for these results. One of the underlying assumptions of Berggren’s work is that the fictitious domain is entirely enclosed in the background domain. Although this situation is common in unfitted finite element methods [e.g., 10], it is less standard in general topology optimisation problems where boundary conditions are typically applied on subsets of the boundary of the background domain. In this work, we therefore consider the extension of the results given by Berggren [16] to the case where the domain boundary intersects the background domain boundary. In addition, we derive the directional shape derivative for general flux integrals. The derivation of first- and second-order shape derivatives is difficult and error-prone. To this end, automatic shape differentiation, which is the application of automatic differentiation techniques to shape derivatives, has been proposed in the literature to help reduce this burden [17, 18, 19, 20]. These techniques have now been implemented in several software packages 2 [e.g., 21, 22]. The conventional methodology relies on deformations of a mesh to propagate dual numbers through the desired integrals. Although the conventional automatic shape differentiation discussed above has been successfully applied to several topology optimisation problems in the aforementioned work, it relies on having a body-fitted mesh throughout the optimisation procedure. Naturally, this poses the question of whether shape derivatives can be recovered in the context of unfitted discretisations and to what level of precision. The automatic shape differentiation for unfitted discretisations was first proposed by Mallon et al. [23]. They proposed the use of forward-mode differentiation to automatically compute shape derivatives as perturbations of a level-set function. However, it is not clear how the derivatives computed in their work relate to the analytic shape derivatives [e.g., 8] or the directional shape derivatives in [16]. In this work, we further develop the mathematics behind automatic differentiation for unfitted discretisations and link it to the directional derivatives in [16]. We will show that the results given by Berggren [16] can be recovered to machine precision regardless of mesh size. The developed unfitted automatic shape differentiation techniques can be used to avoid computing complicated mesh-related quantities that appear in directional derivatives of surface integrals. In addition, the technique can also compute derivatives of expressions for which there is not yet a rigorous mathematical counterpart in the framework of Berggren [16] (e.g., shape Hessians). We implement the analytic directional shape derivatives in [16] and automatic shape differentiation for unfitted discretisations in the Julia package GridapTopOpt [9] and the wider Gridappackage ecosystem [24, 25]. GridapTopOpt provides efficient implementations of C´ea’s method [26] (also known as the adjoint method) for differentiating functionals that depend on the solutions to PDEs. As a result, our implementation can be used to solve general PDE-constrained optimisation problems with a syntax that is near one-to-one with the mathematical notation. In addition, we leverage GridapDistributed [27] to implement analytic derivatives, automatic shape differentiation, and unfitted evolution and reinitialisation in both serial and memory-distributed computing frameworks. These extensions of GridapTopOpt [9] allow us to solve an even wider range of problems on unstructured background triangulations. In addition, compatibility of our framework within the Gridap package ecosystem makes it possible to solve a significant number of cutting-edge topology optimisation problems involving complicated physical phenomena such as those posed on non-standard function spaces such as _H_ (div) and _H_ (curl). To demonstrate the applicability of the unfitted automatic shape differentiation framework, we consider two example optimisation problems. In the first, we consider the minimum compliance optimisation of a three-dimensional linear elastic wheel. In the second problem, we consider topology optimisation of a three-dimensional linear elastic structure in a fluid-structure interaction problem with Stokes flow. We solve both computational examples in a memory-distributed manner using a ghost penalty stabilisation [28]. Note that the computational framework and theoretical results given in Section 2 and 3 can be readily applied to other unfitted finite element methods. The remainder of the paper is as follows. In Section 2, we recall the main results given in [16] and extend them to the cases mentioned above. In Section 3, we discuss automatic differentiation for unfitted discretisations and compare the results to those in Section 2. In Section 4, we discuss the implementation of unfitted level-set topology optimisation. In Section 5, we give two example results computed using the unfitted framework. Finally, in Section 6 we present our concluding remarks. 3 2. Directional shape derivatives for unfitted methods _2.1._ _Notation and previous results_ In the following, we recall the notation and main results of Berggren [16]. We refer to this work and references therein for further discussion of shape calculus in the context of unfitted discretisations. For the purpose of restating these results, we assume that the unfitted domain does not intersect the boundary of the background domain. Suppose that we consider a background domain _D_ ⊂ R <sup>_d_</sup> with a symplectic triangulation _Th_ . We use _Sh_ to denote the faces of the triangulation and _Eh_ to denote the subfaces. We define a level-set function ϕ ∈ _Wh_, where _W_ <sup>_h_</sup> = { _v_ ∈ _C_ <sup>0</sup> ( Ω <sup>¯</sup> ) : _v_ | _K_ ∈ _P_ <sup>1</sup> ( _K_ ), ∀ _K_ ∈ _Sh_ }, with the property that ϕ partitions _D_ in the standard manner: ϕ( _x_ ) < 0 if _x_ ∈ Ω, ϕ( _x_ ) = 0 if _x_ ∈ ∂Ω, ϕ( _x_ ) > 0 if _x_ ∈ _D_ \Ω <sup>¯</sup> . We now consider perturbations of Ω under variations of ϕ. Namely, we consider domains (1) under perturbations Ω _t_ = { _x_ ∈ _D_ : ϕ _t_ ( _x_ ) < 0} (2) ϕ _t_ ( _x_ ) = ϕ( _x_ ) + _tw_ ( _x_ ) (3) where _t_ ≥ 0 and _w_ is a Lagrangian basis function for _Wh_ . Finally, we define the perturbed region _Et_ = Ω \ Ω <sup>¯</sup> _t_ . Parameterising this domain is a fundamental ingredient in formulating the directional semiderivatives in [16]. Note that the semiderivatives are one-sided derivatives that coincide under certain assumptions discussed below. Before we state the main theorems in [16], we recall the following assumptions: Assumption 1. _There_ _is_ _a_ _t_ max - 0 _such_ _that_ _for_ _each_ _K_ ∈ _Th,_ _if_ ∂Ω _t_ ∩ _K_ _is_ _either_ _empty_ _or_ _non-empty for some t_ ∈ (0, _t_ max] _, it has the same property for each t_ ∈ (0, _t_ max] _._ Assumption 2. _The boundary_ ∂Ω _does not intersect any mesh points of the triangulation Th._ The first assumption ensures that _Et_ has a unique parameterisation while the second ensures agreement of semiderivatives in the limits _t_ → 0 <sup>+</sup> and _t_ → 0 <sup>−</sup> . Theorem 1 (Berggren [16]) . _Under the perturbation in Equation_ (3) _, the directional semideriva-_ _tive of volume integral_ _J_ 1(ϕ) = _f_ d _x_, (4) _for_ _f_ ∈ _C_ <sup>0</sup> ( _T_ <sup>¯</sup> _h_ ) _, satisfies_ d _J_ 1(ϕ; _w_ ) = lim _t_ →0 <sup>+</sup> Ω(ϕ) <u>1</u> _t_ <sup>(</sup> <sup>_J_</sup> <sup>(ϕ</sup> <sup>_t_</sup> <sup>) −</sup> <sup>_J_</sup> <sup>(ϕ)) = −</sup> 4 ∂Ω _<u>w</u>_ _f_ |∂ _n_ ϕ| <sup>d</sup> <sup>_s_</sup> (5) _n_ 1 ∂Ωτ ∩ _S_ _m_ 2 _n_ ∂Ωτ∩ _K_ 1 S _n_ <sup>_S_</sup> _t_ <sup>_S_</sup> 1 ∂Ωτ ∩ _S_ S _n_ <sup>_S_</sup> _t_ <sup>_S_</sup> 1 _t_ <sup>_S_</sup> 1 <sup>= −</sup> <sup>_e_</sup> <sup>3</sup> _t_ <sup>_S_</sup> 2 <sup>=</sup> <sup>_e_</sup> <sup>3</sup> _m_ 1 _n_ ∂Ωτ∩ _K_ 2 <sup>_S_</sup> 2 <sup>=</sup> <sup>_e_</sup> <sup>3</sup> ∂Ωτ _K_ 1 _m_ 2 _m_ 1 _n_ ∂Ωτ∩ _K_ 2 _n_ ∂Ωτ∩ _K_ 1 _n_ 1 _K_ 2 (a) _K_ 1 ∂Ωτ _K_ 2 (b) Figure 1: An illustration of geometric quantities required for the resolution of Equation (7) in two dimensions (Fig. a) and three dimensions (Fig. b) where _K_ 1 and _K_ 2 are two neighbouring elements of _Th_ that are cut by the interface, _S_ = _K_ <sup>¯</sup> 1 ∩ _K_ <sup>¯</sup> 2 is the facet shared by _K_ 1 and _K_ 2, _n_ 1 is the normal to _S_ in the direction of _K_ 2 and similarly for _n_ 2, _n_ ∂Ωτ∩ _Kk_ is the outward normal restricted to ∂Ωτ ∩ _Kk_, _t_ <sup>_S_</sup> _k_ <sup>is the tangent to ∂Ωτ ∩</sup> <sup>_S_</sup> <sup>,</sup> _K_ 2 and similarly for _n_ 2, _n_ ∂Ωτ∩ _Kk_ is the outward normal restricted to ∂Ωτ ∩ _Kk_, _t_ <sup>_S_</sup> _k_ <sup>is the tangent to ∂Ωτ ∩</sup> <sup>_S_</sup> <sup>,</sup> and _m_ _k_ is the co-normal defined by _m_ _k_ = _t_ <sup>_S_</sup> _k_ <sup>×</sup> <sup>_n_</sup> <sup>∂Ωτ∩</sup> <sup>_Kk_</sup> <sup>.</sup> <sup>In Figure (a) we use the convention that</sup> <sup>_t_</sup> <sup>_S_</sup> 1 <sup>=</sup> <sup>−</sup> <sup>_e_</sup> <sup>3</sup> and _m_ _k_ is the co-normal defined by _m_ _k_ = _t_ <sup>_S_</sup> _k_ <sup>×</sup> <sup>_n_</sup> <sup>∂Ωτ∩</sup> <sup>_Kk_</sup> <sup>.</sup> <sup>In Figure (a) we use the convention that</sup> <sup>_t_</sup> <sup>_S_</sup> 1 <sup>=</sup> <sup>−</sup> <sup>_e_</sup> <sup>3</sup> and _t_ <sup>_S_</sup> 2 <sup>=</sup> <sup>_e_</sup> <sup>3.</sup> <sup>(Adapted from [16])</sup> <sup>_S_</sup> 2 <sup>=</sup> <sup>_e_</sup> <sup>3.</sup> <sup>(Adapted from [16])</sup> <sup>_S_</sup> _k_ <sup>×</sup> <sup>_n_</sup> <sup>∂Ωτ∩</sup> <sup>_Kk_</sup> <sup>.</sup> <sup>In Figure (a) we use the convention that</sup> <sup>_t_</sup> <sup>_S_</sup> 1 _(i)_ _If Assumption 1 is violated, then_ _f_ _and_ ∂ _n_ ϕ _are the limits of these functions from the interior_ _of_ Ω _whenever these quantities possess jump discontinuities on_ ∂Ω _._ _(ii)_ _If Assumption 1 is satisfied, the semiderivatives t_ → 0 <sup>−</sup> _and t_ → 0 <sup>+</sup> _agree._ Theorem 2 (Berggren [16]) . _Consider the perturbation in Equation_ (3) _according to Assumption_ _1 of a domain respecting Assumption 2._ _The semiderivative of boundary integral_ _J_ 2(ϕ) = _f_ d _s_ (6) ∂Ω(ϕ) _for_ _f_ ∈ _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ _satisfies_ d _J_ 2(ϕ, _w_ ) = − ∂Ω _<u>w</u>_ |∂ _n_ ϕ| <sup>d</sup> <sup>_s_</sup> <sup>−</sup> _<u>w</u>_ _n_ <sup>_S_</sup> - � _f_ _m_ �|∂ _n_ _S_ ϕ| <sup>dγ,</sup> (7) <u>∂</u> _<u>f</u>_ ∂ _n_ _S_ ∈ _Sh_ ∂Ω∩ _S_ _where_ _n_ <sup>_S_</sup> _is_ _a_ _unit_ _vector_ _located_ _in_ _S,_ _outward-directed_ _from_ Ω _,_ _and_ _orthogonal_ _to_ ∂Ω ∩ _S_ _for_ _d_ = 3 _._ _Moreover,_ - _f m_ - = _f_ 1 _m_ 1 + _f_ 2 _m_ 2 _._ _Here,_ _m_ _k_ _is the co-normal for_ τ = 0 _defined by Equation_ (8) _, and_ _fk_ _is the limit_ _f_ _on S_ _defined by_ _fk_ ( _x_ ) = limϵ→0+ _f_ ( _x_ - ϵ _m_ _k_ ) _for_ _x_ ∈ ∂Ω ∩ _S ._ In the above, _n_ is the outward normal of ∂Ω, _m_ _k_ is the co-normal defined by _m_ _k_ = _t_ <sup>_S_</sup> _k_ <sup>×</sup> <sup>_n_</sup> <sup>∂Ω</sup> τ <sup>∩</sup> <sup>_K_</sup> _k_ (8) 5 ∂ _D_ supp _w_ _x_ _w_ _Et_ Ω ∂Ω Figure 2: A visualisation of intersections between ∂Ω and ∂ _D_ considered in this work. for τ ∈ [0, _t_ ], where _t_ <sup>_S_</sup> _k_ <sup>is</sup> <sup>the</sup> <sup>tangent</sup> <sup>to</sup> <sup>∂Ωτ</sup> <sup>∩</sup> <sup>_S_</sup> <sup>for</sup> <sup>_S_</sup> <sup>∈</sup> <sup>_Sh_</sup> <sup>and</sup> <sup>_n_</sup> <sup>∂Ωτ∩</sup> <sup>_Kk_</sup> <sup>is</sup> <sup>the</sup> <sup>outward</sup> <sup>normal</sup> restricted to ∂Ωτ ∩ _Kk_ . An illustration of these quantities is given in Figure 1 and a detailed discussion can be found in [16]. _2.2._ _Extension to non-empty intersections of_ ∂Ω _and_ ∂ _D_ Let us now consider an extension to the case where ∂Ω has a non-empty intersection with ∂ _D_ as shown in Figure (2). The result of Theorem 1 and the related results in [16] remain unchanged for the non-empty intersections considered here. This is because the computation in these results is performed locally on each element _K_ ∈ _Th_ and does not require information from adjacent elements. This is quite different from the situation in Theorem 2, where the jump of quantities over element interfaces is required. In particular, Lemma 6.10 from [16] must be extended as follows: Lemma 1. _Let t_ ∈ (0, _t_ max] _<u>according to Assumption 1 and consider the perturbation in Equation</u>_ (3) _._ _Moreover, let_ _f_ ∈ _C_ <sup>1</sup> ( _T_ _h_ ) _and_ Θ ∈ _L_ <sup>∞</sup> ( _Et_ ) <sup>_d_</sup> _such that_ Θ| _Et_ ∩ _K_ ∈ _C_ <sup>1</sup> ( _Et_ ∩ _K_ ) <sup>_d_</sup> _for each K_ ∈ _Th._ _In addition, suppose that we have non-empty_ ∂Ω ∩ ∂ _D._ _Then, we have_ ∂Ωτ∩ _S_ _K_ ∈ _Th_ - _t_ 0 _n_ - Θ _f_ d _s_ + _S_ ∈ _Sh_ \∂ _D_ _<u>w</u>_ _n_ <sup>_S_</sup> - � _f_ Θ × _t_ <sup>_S_</sup> �|∂ _n_ _S_ ϕτ| <sup>dγ dτ</sup> _Et_ ∩ _K_ �(∇ - Θ) _f_ + Θ · ∇ _f_ - d _V_ = ∂ _Et_ \∂ _D_ ∂Ωτ∩ _S_ - _t_ 0 _n_ <sup>_S_</sup> - ( _f_ Θ × _t_ <sup>_S_</sup> ) |∂ _n_ _<u>wS</u>_ ϕτ| <sup>dγ dτ.</sup> (9) + _S_ ∈ _Sh_ ∩∂ _D_ _Proof._ For the case where ∂Ω ∩ ∂ _D_ is empty, the proof is as in Lemma 6.10. from [16]. For the case of non-empty ∂Ω ∩ ∂ _D_, we assume that _Et_ = Ω \ Ω _t_ is nonempty and denote cells _K_ ∈ _Th_ with faces _S_ ∈ _Sh_ . Integrating (∇ - Θ) _f_ on _Et_ ∩ _K_ by parts gives _f_ _n_ - Θ d _s_, _K_ ∈ _Th_ (10) _Et_ ∩ _K_ �(∇ - Θ) _f_ + Θ · ∇ _f_ - d _V_ = 6 ∂( _Et_ ∩ _K_ ) and summing the resulting terms yields _K_ ∈ _Th_ = _Et_ ∩ _K_ _f_ _n_ - Θ d _s_ + �(∇ - Θ) _f_ + Θ · ∇ _f_ - d _V_ _S_ ∈ _Sh_ \∂ _D_ _f_ 1 _n_ 1 · Θ1 + _f_ 2 _n_ 2 · Θ2 d _s_ + _f_ _n_ - Θ d _s_ . (11) _S_ ∈ _Sh_ ∩∂ _D_ ∂ _Et_ \∂ _D_ _Et_ ∩ _S_ _Et_ ∩ _S_ When _Et_ ∩ ∂ _D_ is empty, the last term of Equation (11) vanishes and the remaining terms are as in Equation (6.32) from [16], so the proof is complete. For non-empty _Et_ ∩∂ _D_, application of Lemma 6.9 from [16] to the last two integrals in Equation (11) gives ∂Ωτ∩ _S_ [ _f_ 1 _n_ 1 · Θ1 + _f_ 2 _n_ 2 · Θ2] d _s_ = - _t_ 0 _<u>w</u>_ ( _f_ 1 _n_ 1 · Θ1 + _f_ 2 _n_ 2 · Θ2) |∂ _n_ _S_ ϕτ| <sup>dγ dτ,</sup> _S_ ∈ _Sh_ \ ∂ _D_, _Et_ ∩ _S_ (12) and - - _t_ - _t_ _f_ _n_ - Θ d _s_ = _Et_ ∩ _S_ For Equation (12) we have _<u>w</u>_ ( _f_ _n_ - Θ) |∂ _n_ _S_ ϕτ| <sup>dγ dτ,</sup> _S_ ∈ _Sh_ ∩ ∂ _D_ . (13) 0 ∂Ωτ∩ _S_ _f_ 1 _n_ 1 · Θ1 + _f_ 2 _n_ 2 · Θ2 = _n_ <sup>_S_</sup> - � _f_ Θ × _t_ <sup>_S_</sup> (14) ��� _S_ by Equation (6.34) from [16]. On the other hand, for Equation (13) the term _f_ _n_ - Θ is single valued and has no jump. This is the same case for _t_ <sup>_S_</sup> . As a result, we have - Θ = _n_ <sup>_S_</sup> - - (15) _f_ Θ × _t_ <sup>_S_</sup> <sup>����</sup> - _S_, _f_ _n_ - Θ = _f_ - _t_ <sup>_S_</sup> × _n_ <sup>_S_</sup> <sup>�</sup> where we use that _n_ = _t_ <sup>_S_</sup> × _n_ <sup>_S_</sup> and properties of the triple product in the first and second equalities, respectively. Substituting Equations (14) and (15) into Equations (12) and (13), and substituting the result into Equation (11) completes the proof. The extension of Theorem 2 to the case of non-empty ∂Ω ∩ ∂ _D_ is then as follows: Theorem 3. _Consider_ _the_ _perturbation_ _in_ _Equation_ (3) _according_ _to_ _Assumption_ _1_ _of_ _a_ _domain_ _respecting Assumption 2. Suppose in addition that we have non-empty_ ∂Ω∩∂ _D. The semiderivative_ _of Equation_ (6) _for_ _f_ ∈ _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ _satisfies_ _<u>w</u>_ |∂ _n_ ϕ| <sup>d</sup> <sup>_s_</sup> <sup>−</sup> <u>∂</u> _<u>f</u>_ ∂ _n_ _<u>w</u>_ _n_ <sup>_S_</sup> - � _f_ _m_ �|∂ _n_ _S_ ϕ| <sup>dγ −</sup> ∂Ω∩ _S_ _S_ ∈ _Sh_ \∂ _D_ _S_ ∈ _Sh_ ∩∂ _D_ ∂Ω∩ _S_ d _J_ 2(ϕ, _w_ ) = − ∂Ω _n_ <sup>_S_</sup> - ( _f_ _m_ ) _<u>w</u>_ |∂ _n_ _S_ ϕ| <sup>dγ.</sup> (16) Using Lemma 1, the proof of the extension in Theorem 3 is analogous to the one given in [16]. Note that assumption 2 restricts the analysis to the case that Ω is not part of ∂ _D_, namely ϕ( _x_ ) - 0 on ∂ _D_, except for measure-zero intersections (i.e., point intersections for _d_ = 2 or surface intersections for _d_ = 3). 7 _2.3._ _Directional derivative of flux integrals_ The following result considers the directional derivative of flux integrals of the form _J_ 3(ϕ) = _f_ - _n_ d _s_ . (17) ∂Ω(ϕ) These are necessary for problems involving loads over ∂Ω (e.g., fluid-structure interaction). Lemma 2. _Consider_ _the_ _perturbation_ _in_ _Equation_ (3) _according_ _to_ _Assumption_ _1_ _of_ _a_ _domain_ _respecting_ _Assumption_ _2_ _and_ _where_ _the_ _intersection_ ∂Ω ∩ ∂ _D_ _is_ _empty._ _The_ _semiderivative_ _of_ _Equation_ (17) _for_ _f_ ∈ - _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ �� _d_ _satisfies_ - _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ �� _d_ _satisfies_ d _J_ 3(ϕ; _w_ ) = − ∂Ω _<u>w</u>_ ∇ - _f_ |∂ _n_ ϕ| <sup>d</sup> <sup>_s_</sup> <sup>.</sup> (18) _Proof._ Since _f_ ∈ - _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ �� _d_ and the intersection ∂Ω ∩ ∂ _D_ is empty, Equation (17) can be rewritten using the divergence theorem as _Proof._ Since _f_ ∈ - _C_ <sup>1 �</sup> _T_ <sup>¯</sup> _h_ _J_ 3(ϕ) = Ω(ϕ) ∇ - _f_ d _s_ . (19) Application of Theorem 1 yields the desired result. Remark 1. _We_ _note_ _that_ _extension_ _of_ _this_ _result_ _to_ _the_ _case_ _of_ _non-empty_ ∂Ω ∩ ∂ _D_ _as_ _well_ _as_ _more_ _general_ _integrands_ _(e.g.,_ _g_ ( _n_ ) _)_ _requires_ _further_ _mathematical_ _development._ _The_ _latter_ _has_ _been_ _considered_ _in_ _the_ _context_ _of_ _domain_ _transformations_ _[e.g.,_ _29],_ _however,_ _the_ _analog_ _in_ _the_ _framework of [16] is not immediately clear._ 3. Automatic di ff erentiation In this section, we consider automatic differentiation for unfitted discretisations. We first recall some basic properties of dual numbers. Then we consider how dual numbers propagate through quadrature for unfitted discretisations and verify that we exactly recover the semiderivatives from the previous section. _3.1._ _Dual numbers_ Forward-mode automatic differentiation, in which the function and its derivative are computed concurrently, is based on the properties of dual numbers to evaluate derivatives exactly [30]. A dual number is defined as _a_ + _b_ ε with the property ε <sup>2</sup> = 0. As a result, the Taylor series of a differentiable function _f_ ( _a_ + _b_ ε) about _a_ is _f_ ( _a_ + _b_ ε) = _f_ ( _a_ ) + _b_ ε _f_ <sup>′</sup> ( _a_ ) (20) where the higher order terms vanish thanks to ε <sup>2</sup> = 0. This allows us to recover the derivative of _f_ exactly via the dual component of _f_ ( _a_ + _b_ ε). 8 Figure 3: An example subtriangulation of a domain Ω(ϕ) defined by ϕ( _x_ ) ≤ 0. The green cells, denoted Ω _h_,CUT(ϕ), are those that include the interface Γ(ϕ). The red cells, denoted Ω _h_,IN, are the remaining internal cells. _3.2._ _Automatic di_ ff _erentiation for unfitted discretisations_ We now demonstrate how dual numbers propagate through quadrature on a cut triangulation. In particular, we consider piecewise linear cuts defined via a level-set function (e.g., Figure 3). Consider the functional _J_ 1(ϕ) = Ω(ϕ) _f_ d _x_ (21) where, for the purpose of this demonstration, we let Ω(ϕ) ⊂ _D_ ⊂ R <sup>2</sup> as in Figure 3, and _f_ is sufficiently differentiable. Suppose that we generate a fully-symplectic subtriangulation of the background mesh _Th_ at the interface defined by ϕ( _x_ ) = 0. This can be accomplished using the algorithms described in [10] and the references therein. We denote this subtriangulation as Ω _h_ (ϕ) = Ω _h_,CUT ∪ Ω _h_,IN where Ω _h_,CUT and Ω _h_,IN are the simplices that include the interface (ϕ( _x_ ) = 0) and the bulk (ϕ( _x_ ) < 0), respectively. Figure 3 shows an example visualisation of this subtriangulation. Finally, we let _K_ (ϕ) ∈ Ω _h_,CUT and _K_ ∈ Ω _h_,IN denote a cut subcell and bulk element, respectively. We assume Assumption 1 and 2 are satisfied, as such the topology of Ω _h_,CUT and Ω _h_,IN are invariant under small perturbations of ϕ while the geometry of elements of Ω _h_,CUT can vary, hence the notational dependence of _K_ (ϕ) ∈ Ω _h_,CUT. The functional _J_ 1 can now be rewritten as _K_ (ϕ) 9 _J_ 1(ϕ) = _K_ (ϕ)∈Ω _h_,CUT _f_ d _x_ + _K_ ∈Ω _h_,IN _f_ d _x_ . (22) _K_ ξ2 (0, 1) (0, 0) (1, 0) _x_ = _T_ ϕ(ξ) _q_ 3 _v_ 2(ϕ) _v_ 1(ϕ) _q_ 2 ξ1 _q_ 1 Figure 4: A visualisation of the map _T_ ϕ : _K_ <sup>ˆ</sup> → _K_ (ϕ) from the reference element _K_ <sup>ˆ</sup> to a cut subcell _K_ (ϕ). The intersection points _v_ 1(ϕ) and _v_ 2(ϕ) of the cut subcell are computed using ϕ( _q_ 1), ϕ( _q_ 2), and ϕ( _q_ 3) via interpolation. Let us focus our attention on the integral over _K_ (ϕ) and assume without loss of generality that the element is cut as in Figure 4. In addition, suppose that we have _T_ ϕ : _K_ <sup>ˆ</sup> → _K_ (ϕ) that maps the first-order reference element to the cut subcell. For the cut subcell in Figure 4, the mapping _T_ ϕ is defined as _T_ ϕ(ξ) = _JK_ (ϕ)ξ + _q_ 1 (23) where _q_ 1 = ( _x_ _q_ 1, _y_ _q_ 1) and _JK_ (ϕ) is the Jacobian of _T_ defined as _JK_ (ϕ) = - _x_ _v_ 1(ϕ) − _x_ _q_ 1 _x_ _v_ 2(ϕ) − _x_ _q_ 1 _y_ _v_ 1(ϕ) − _y_ _q_ 1 _y_ _v_ 2(ϕ) − _y_ _q_ 1 . (24) The above coordinates _v_ 1 and _v_ 2 depend on ϕ via the following interpolants |ϕ( _<u>q</u>_ <u>1)|</u> _v_ 1(ϕ) = _q_ 1 + |ϕ( _q_ 1)| + |ϕ( _q_ 2)| <sup>(</sup> <sup>_q_</sup> <sup>2 −</sup> <sup>_q_</sup> <sup>1),</sup> (25) |ϕ( _<u>q</u>_ <u>1)|</u> _v_ 2(ϕ) = _q_ 1 + |ϕ( _q_ 1)| + |ϕ( _q_ 3)| <sup>(</sup> <sup>_q_</sup> <sup>3 −</sup> <sup>_q_</sup> <sup>1).</sup> (26) At this point, our map _T_ ϕ is well defined and we can proceed with our quadrature rule: _f_ d _x_ = _N_ _i_ =1 ω _i f_ ( _T_ ϕ(ξ _i_ ))| _JK_ (ϕ)|. (27) _f_ ( _T_ ϕ(ξ))| _JK_ (ϕ)| dξ = _K_ (ϕ) _K_ ˆ Thus, our original functional _J_ 1 can be written as _N_ _i_ =1 _J_ 1(ϕ) = _K_ (ϕ)∈Ω _h_,CUT ω _i f_ ( _T_ ϕ(ξ _i_ ))| _JK_ (ϕ)| + _N_ - _K_ ∈Ω _h_,IN _i_ =1 ω _i f_ ( _T_ (ξ _i_ ))| _JK_ | (28) where the latter integral has been rewritten using a standard quadrature rule. Now that the dependence of the quadrature rule in Equation (28) on ϕ is well defined, we can consider computing the directional derivative of _J_ 1 with respect to ϕ in the direction _w_ using dual numbers. 10 Let _F_ ( _s_ ) = _J_ 1(ϕ + _sw_ ) and consider the Taylor series of _F_ ( _t_ + ε) about _t_ = 0. Equation (20) gives _F_ (ε) = _F_ (0) + ε _F_ <sup>′</sup> ( _t_ )| _t_ =0, (29) In terms of _J_ 1 this becomes _J_ 1(ϕ + ε _w_ ) = _J_ 1(ϕ) + ε <sup><u>d</u></sup> d _t_ _J_ 1(ϕ + _tw_ ) = _J_ 1(ϕ) + ε d _J_ 1(ϕ, _w_ ), (30) ����� _t_ =0 where the last equality is purely notational. Thus, we recover the directional derivative as the dual component of _J_ 1(ϕ + ε _w_ ). Importantly, we capture the change in shape due to the propagation of dual numbers through the map _T_ ϕ and its Jacobian | _JK_ (ϕ)| . From an algorithmic point of view, computing the derivative using automatic differentiation can be summarised as follows: 1. Construct the dual numbers corresponding to the level-set values at each node (i.e., replace ϕ _i_ by ϕ _i_ + ε _i_ where ε _i_ is the corresponding dual number at node _i_ ). 2. Compute the nodal coordinates of the cut subcells using ϕ _i_ + ε _i_ in Equation (25) and (26). 3. Construct the map _T_ ϕ _i_ +ε _i_ and the corresponding Jacobian _JK_ (ϕ _i_ +ε _i_ ). 4. Compute the integral using the quadrature rule in Equation (28) and assemble the vector of dual components. Remark 2. _Note_ _that_ _the_ _above_ _demonstrative_ _example_ _is_ _verbatim_ _for_ _the_ _case_ _of_ _J_ 2 _and_ _J_ 3 _in_ _Equation_ (6) _and_ (17) _, respectively, with the exception that the normal in_ _J_ 3 _should be calculated_ _using the nodal coordinates resulting from Step (2) of the above summary._ _This ensures that the_ _dual numbers are propagated correctly in the calculation of the normal vector._ Remark 3. _We_ _further_ _note_ _that,_ _among_ _other_ _things,_ _the_ _above_ _technique_ _can_ _also_ _be_ _used_ _to_ _evaluate derivatives of functionals that depend on additional fields (e.g., solutions to finite element_ _problems) or whose rigorous mathematical counterpart is not yet known._ _For example,_ _J_ 4(ϕ) = _g_ ( _n_ ) d _s_ . (31) ∂Ω(ϕ) _For functionals that depend on the solutions to PDEs, C´ea’s method can be utilised [26]._ _3.3._ _Implementation_ We implement the analytic directional derivatives discussed in Section 2 and automatic differentiation methods discussed above in the Julia package GridapTopOpt [9] using the machinery provided by GridapEmbedded [31] and Gridap [24, 25]. GridapEmbedded provides algorithms and abstract methods for computation on subtriangulations, while Gridap provides the underlying finite element method. We leverage GridapDistributed [27] to implement both the analytic derivatives and automatic differentiation for unfitted discretisations in both serial and distributed 11 computing frameworks. The latter readily follows from the serial implementation, as all computation is cell-wise. As such, the serial implementation can be mapped over each local partition. It should be noted that for shape differentiation of functionals that depend on the solutions to PDEs, C´ea’s method [26] is utilised in conjunction with automatic shape differentiation. We refer the reader to Section 2.6 of Wegert et al. [9] for further discussion. _3.4._ _Verification_ In this section, we verify that automatic differentiation for unfitted discretisations can exactly compute their analytic counterparts. To show this, we consider the four level-set functions shown in Figure 5. Table 1 shows the results when comparing the analytic expressions, automatic differentiation, and finite differences. These demonstrate that the derivatives computed using the exact expressions from Section 2 exactly correspond to the derivatives computed using automatic differentiation. This correspondence is to within machine precision regardless of mesh size because the exact expressions in Section 2 are derived using a discretise-then-differentiate approach. The implementation discussed in Section 3.3 can also be leveraged for computation of shape Hessians for unfitted discretisations. For example, we computed the Hessian of _F_ (ϕ) = �∂Ω(ϕ) <sup>∥</sup> <sup>_n_</sup> <sup>−</sup> Hessians for unfitted discretisations. For example, we computed the Hessian of _F_ (ϕ) = ∂Ω(ϕ) <sup>∥</sup> <sup>_n_</sup> <sup>−</sup> _n_ _g_ ∥ <sup>2</sup> d _s_ using automatic differentiation and finite differences and found that the absolute error was 1.85 × 10 <sup>−5</sup> . This suggests an interesting avenue of mathematical development for the analytic methods proposed in [16]. Table 1: Verification of directional derivatives resulting from automatic differentiation against the exact expressions from Section 2 and finite differences. In the above, we take _f_ ( _x_, _y_ ) = cos( _x_ + _y_ ) and _g_ ( _n_ ) = <u>∇</u> _<u>g</u>_ - <u>π</u> _<u>y</u>_ ∥ _n_ - _n_ _g_ ∥ <sup>2</sup> with _n_ _g_ = ∥∇ _g_ ∥ <sup>and</sup> <sup>_g_</sup> <sup>(</sup> <sup>_x_</sup> <sup>,</sup> <sup>_y_</sup> <sup>) =</sup> <sup>_x_</sup> <sup>−</sup> 10 <sup><u>1</u></sup> <sup>sin</sup> 3 . The latter is based on an expression in [Sec. 6.3., 29]. Note that we use ‘N/A’ for directional derivatives that cannot readily be calculated analytically. <u>F</u> <u>Level-set function</u> <u>∥d</u> _<u>F</u>_ <u>AD −</u> <u>d</u> _<u>F</u>_ <u>exact∥∞</u> <u>∥d</u> _<u>F</u>_ <u>AD −</u> <u>d</u> _<u>F</u>_ <u>FDM∥∞</u> Fig. 5a 3.47×10 <sup><u>−17</u></sup> 4.44×10 <sup><u>−10</u></sup> Ω(ϕ) _f_ d _x_ _f_ d _s_ ∂Ω(ϕ) _f_ - _n_ d _s_ ∂Ω(ϕ) ∂Ω(ϕ) _g_ ( _n_ ) d _s_ Fig. 5b 7.81×10 <sup>−18</sup> 2.09×10 <sup>−11</sup> Fig. 5c 3.90×10 <sup>−18</sup> 4.22×10 <sup>−11</sup> <u>Fig.</u> <u>5d</u> <u>1.73×10</u> <sup>−18</sup> <u>7.04×10</u> <sup>−12</sup> Fig. 5a 3.47×10 <sup><u>−16</u></sup> 3.59×10 <sup><u>−8</u></sup> Fig. 5b 3.05×10 <sup>−16</sup> 1.03×10 <sup>−9</sup> Fig. 5c 2.64×10 <sup>−16</sup> 9.39×10 <sup>−10</sup> <u>Fig.</u> <u>5d</u> <u>2.92×10</u> <sup>−16</sup> <u>1.62×10</u> <sup>−10</sup> Fig. 5a 4.30 × 10 <sup><u>−16</u></sup> 1.52 × 10 <sup><u>−9</u></sup> Fig. 5b N/A 6.78 × 10 <sup>−11</sup> Fig. 5c 3.12 × 10 <sup>−17</sup> 1.44 × 10 <sup>−10</sup> <u>Fig.</u> <u>5d</u> <u>N/A</u> <u>1.63 × 10</u> <sup>−11</sup> Fig. 5a N/A 9.35 × 10 <sup><u>−8</u></sup> Fig. 5b N/A 2.35 × 10 <sup>−9</sup> Fig. 5c N/A 2.50 × 10 <sup>−9</sup> Fig. 5d N/A 6.09 × 10 <sup>−10</sup> 12 (a) ~~�~~ ( _x_ - 0.5) <sup>2</sup> + ( _y_ - 0.5) <sup>2</sup> - 0.23 ≤ 0 (b) cos(2π _x_ ) cos(2π _y_ ) − 0.11 ≤ 0 (c) �( _x_ - 0.5) <sup>2</sup> + ( _y_ - 0.5) <sup>2</sup> + ( _z_ - 0.5) <sup>2</sup> −0.23 ≤ 0 (d) cos(2π _x_ ) cos(2π _y_ ) cos(2π _z_ ) − 0.11 ≤ 0 Figure 5: A visualisation of the geometries and discretisations used for validation of automatic differentiation 4. Level-set topology optimisation In the following, we discuss our implementation of level set-based topology optimisation in the framework of unfitted finite elements. 13 _4.1._ _Boundary evolution_ In this work, we use the approach proposed by Burman et al. [10] to update the level-set function. Namely, we evolve the level-set function by solving a transport equation <u>∂ϕ(</u> _<u>t</u>_ <u>,</u> _<u>x</u>_ <u>)</u> + β · ∇ϕ( _t_, _x_ ) = 0, ∂ _t_ (32)  ϕ(0, _x_ ) = ϕ0( _x_ ), _x_ ∈ _D_, _t_ ∈ (0, _T_ ), where β is a velocity field. In this work β is computed as β = _n_ _g_ Ω, where _g_ Ω is the regularised sensitivity resulting from the Hilbertian extension-regularisation approach [4]. This approach projects a directional derivative d _J_ (ϕ; _w_ ) of a functional _J_ (ϕ), computed using the approaches in Section 2 and 3, onto a Hilbert space _H_ on _D_, typically with additional regularity. This involves solving an identification problem [4]: Weak form 1. _For Find g_ Ω ∈ _H such that_ ⟨ _g_ Ω, _w_ ⟩ _H_ = d _J_ (ϕ; _w_ ), ∀ _w_ ∈ _H_, (33) _where_ ⟨·, ·⟩ _H_ _is the inner product on H._ In addition to naturally extending the sensitivity from ∂Ω onto the bounding domain _D_ with _H_ -regularity, this approach also ensures that the solution _g_ Ω is a descent direction for _J_ (Ω). The transport equation in Equation (32) is solved using an interior penalty approach and CrankNicolson for the discretisation in time [13, 32, 33]. The weak formulation of this problem is: Weak form 2. _For all t_ ∈ (0, _T_ ) _, find_ ϕ ∈ _W_ <sup>_h_</sup> _such that_ _F_ _F_ ∈ _Sh_ d _x_ + _ceh_ <sup>2</sup> _F_ <sup>|</sup> <sup>_n_</sup> <sup>_F_</sup> <sup>· β|�</sup> <sup>_n_</sup> <sup>_F_</sup> <sup>· ∇ϕ��</sup> <sup>_n_</sup> <sup>_F_</sup> <sup>· ∇</sup> <sup>_v_</sup> <sup>�</sup> <sup>d</sup> <sup>_s_</sup> <sup>= 0,</sup> <sup>∀</sup> <sup>_v_</sup> <sup>∈</sup> <sup>_W_</sup> <sup>_h_</sup> <sup>,</sup> (34) _D_ - _v_ <sup><u>∂ϕ</u></sup> ∂ _t_ <sup>+</sup> <sup>_v_</sup> <sup>β · ∇ϕ</sup> _where_ _Sh_ _is_ _the_ _set_ _of_ _interior_ _mesh_ _facets,_ _hF_ _is_ _the_ _average_ _element_ _diameters_ _of_ _the_ _elements_ _sharing a facet,_ _n_ _F_ _is the normal to the facet F,_ - _v_ - = _v_ <sup>+</sup> - _v_ <sup>−</sup> _is the jump in a function v over the_ _facet F, and ce is a stabilisation coe_ ffi _cient._ We include | _n_ _F_ - β| in the interior penalty term as proposed by Burman and Fern´andez [33]. In the context of topology optimisation, this ensures that non-designable regions with β = 0 are not locally over-stabilised by the interior penalty term. The example in Figure 6 shows the evolution of an interface towards a non-designable region highlighted in grey with (green) and without (red) the | _n_ _F_ - β| term. This shows that when the velocity magnitude is not included the interface will encroach into the non-designable domain, and this will continue over the entire evolution process. Note that this term was omitted from the formulation in [13, 32], likely because non-designable regions were not considered. In our numerical examples, we take the stabilisation coefficient to be _ce_ = 0.01. 14 (a) (b) (c) (d) Figure 6: The evolution of an interface visualised in Figure (a), (b), (c), and (d) towards a non-designable region highlighted in grey both with (green) and without (red) the | _n_ _F_ - β| term in the evolution equation (Equation 34). In Figure (d) we overlay both curves on the right to show the slippage of the red interface into the non-designable region and the deviation from the green interface, which is particularly visible in the inset. We visualise the velocity field in purple that has been extended onto the background domain. _4.2._ _Reinitialisation_ Evolution of the boundary described above requires that the level-set function ϕ has wellbehaved gradients. This is usually achieved by reinitialising ϕ to be an approximation of the signed distance function [34] given by - _d_ ( _x_, ∂Ω) if _x_ ∈ Ω, 0 if _x_ ∈ ∂Ω, _d_ ( _x_, ∂Ω) if _x_ ∈ _D_ \Ω <sup>¯</sup>, ϕ( _x_ ) =  where _d_ ( _x_, ∂Ω) := min _p_ ∈∂Ω| _x_ - _p_ | is the minimum distance from _x_ to the boundary ∂Ω. To achieve this, we solve the reinitialisation equation [34, 35] given by (35) (36) <u>∂ϕ</u>  <u>∂ϕ∂</u> _t_ <sup>(</sup> <sup>_t_</sup> <sup>,</sup> <sup>_x_</sup> <sup>) + sign(ϕ0(</sup> <sup>_x_</sup> <sup>)) (|∇ϕ(</sup> <sup>_t_</sup> <sup>,</sup> <sup>_x_</sup> <sup>)| −</sup> <sup>1) = 0,</sup> ϕ(0, _x_ ) = ϕ0( _x_ ), _x_ ∈ _D_, _t_ - 0. We solve this problem to steady state using an approach based on the one proposed by Mallon et al. [23]. The weak formulation for this problem is given as: 15 Weak form 3. _Find_ ϕ ∈ _W_ <sup>_h_</sup> _such that_ _v_ _w_ - ∇ϕ − _v_ sign(ϕ0) d _x_ + _D_ Γ <u>γ</u> _<u>d</u>_ _h_ <sup>ϕ</sup> <sup>_v_</sup> <sup>d</sup> <sup>_s_</sup> <sup>+</sup> <sup>_j_</sup> <sup>(ϕ,</sup> <sup>_v_</sup> <sup>) = 0,</sup> <sup>∀</sup> <sup>_v_</sup> <sup>∈</sup> <sup>_W_</sup> <sup>_h_</sup> <sup>,</sup> (37) _where_ _w_ = sign(ϕ0) ∥∇ <sup><u>∇</u></sup> ϕ <sup><u>ϕ</u></sup> ∥ <sup>_,_</sup> <sup>γ</sup> <sup>_d is the surface penalty coe_</sup> <sup>ffi</sup> <sup>_cient that we set to 20, and h is the element_</sup> _size._ In the above, the first term comes from multiplying Equation (36) by a test function and integrating over _D_, while the second term is a surface penalty term to reduce boundary movement under reinitialisation. The final term stabilises the finite element discretisation using an artificial viscosity given by _j_ (ϕ, _v_ ) = _cr_,1 _h_ ∥ _w_ ∥∇ϕ · ∇ _v_ d _x_, (38) _D_ where _h_ is the element diameter and _cr_,1 is a stabilisation coefficient. In our examples, we take _cr_,1 = 0.5. The above is then solved using Picard iterations, namely _w_ is considered constant when computing the Jacobian in Newton-Raphson. In our testing, we found that approximating the sign function with <u>ϕ</u> sign(ϕ) ≈ (39) ~~<u>�</u>~~ ϕ <sup>2</sup> + _h_ <sup>2</sup> |∇ϕ| <sup>2</sup> <sup>,</sup> as proposed in [35], provides better convergence. In addition, we also considered replacing the artificial viscosity with a continuous interior penalty term, as this is more consistent with the strong formulation. This is given by _cr_,2 _h_ <sup>2</sup> _F_ <sup>�∇ϕ�</sup> <sup>· �∇</sup> <sup>_v_</sup> <sup>�</sup> <sup>d</sup> <sup>_s_</sup> <sup>,</sup> (40) _F_ _j_ (ϕ, _v_ ) = _F_ ∈ _Sh_ where _cr_,2 is a different stabilisation coefficient. We generally found that this provides better results than an artificial viscosity term, but requires that the initial level-set function ϕ0 is closer to a signed distance function for convergence. As such, for the results presented below, we solve the reinitialisation problem using the artificial viscosity term given by Equation (38). In future work, further exploration of these approaches will be considered. _4.3._ _Isolated volume tagging_ Isolated volumes of a domain Ω ⊂ _D_ are regions of that domain within which solution fields are not sufficiently constrained (i.e., disconnected from all boundaries that have Dirichlet boundary conditions). In conventional level-set methods, where the void phase _D_ \ Ω is filled with a weak ersatz material [e.g., 8, 4], this situation is naturally remedied because the isolated volumes are connected by ersatz material and therefore fields are well constrained. Since we do not introduce such an approximation, the differential operator over disconnected volumes has a non-trivial kernel. As a result, the matrices resulting from a discretisation (e.g., finite element method) are singular. 16 To remedy this situation, Villanueva and Maute [14] proposed constructing an indicator function by solving a thermal convection problem on Ω with heat dissipating towards a value of zero in regions connected to Dirichlet boundaries and accumulating to a desired value in isolated regions. A smoothed Heaviside function was then used to construct a binary indicator. However, in our tests, we found that this method fails to distinguish between volumes that are separated by a single cell layer. In these cases, the degrees of freedom within the two volumes are “connected” through the ghost penalty term required by the CutFEM formulation. In this work, we propose a novel graph-based approach to detect isolated volumes as described below. This method relies on the creation of a conforming connectivity graph for the cut mesh, followed by a graph-colouring algorithm. We then mark all regions that are connected to the relevant Dirichlet boundaries. The negation of this map then identifies the isolated volumes. Once isolated volumes are identified, we follow the approach in [14]. Namely, for a generic weak formulation _a_ ( _u_, _v_ ) = _l_ ( _v_ ) over Ω with a non-trivial kernel owing to disconnected volumes marked by ψ, we add a penalty term _k_ ( _u_, _v_ ) = ψ _uv_ d _x_ . (41) Ω This constrains the average of _u_ to be zero in the regions marked by ψ. Concrete examples of this will be given in Section 5. _4.3.1._ _Generating the graph_ The first step is to construct a connectivity graph for the cut mesh, where each vertex corresponds to a cell within the mesh. The graph must be conforming, in the sense that two vertices are connected if and only if their associated cells share a face. Conforming meshes are generally not produced by typical cutting algorithms such as Delaunay or marching cubes, where cells are split locally without ensuring global mesh conformity. In twodimensional settings, the meshes produced will always be conforming because two cells that share a cut edge will always split that edge in the same way. However, in three dimensions two cells sharing a cut face might generate non-matching sub-faces on the shared boundary (see Figure 7). Generating a conforming mesh composed solely of tetrahedra and hexahedra for a complex cut geometry, particularly in higher dimensions, is generally challenging. This challenge motivates the development and use of embedded boundary methods, which do not require a conforming mesh. Therefore, the sub-triangulated cut mesh typically used for numerical integration cannot be directly employed to generate this conforming connectivity graph. Instead, we generate an auxiliary cut mesh, where cut cells are split into general polytopes or polyhedra. The resulting mesh is conforming, regardless of dimension. To create polytopal cuts, we adopt the framework proposed in [36] and adapt the algorithms and their implementation in STLCutters.jl [37] for the case where the nodal values of the level set functions determine cuts. The result is the required conforming graph _G_, see Figure 8. _4.3.2._ _Colouring the graph_ The next step involves creating a colouring for the graph _G_, where each colour corresponds to a distinct disconnected volume. This is done by successfully applying a Breadth-First-Search 17 (a) (b) Figure 7: Non-conforming cut meshes generated by Delaunay triangulation in 3D. Figure (a) shows the original mesh in black, given by two tetrahedra. The mesh is split through a plane, given by the red lines. Figure (b) shows the result of applying a Delaunay triangulation to both tetrahedra. The shared quadrilateral face is triangulated differently in each tetrahedra, creating a non-conforming edge (in red). Figure 8: Polytopal cut mesh for the example in Figure 3. Note that, compared to the subtriangulated cut mesh, this mesh deals with cut cells using polytopes with an arbitrary number of faces. 18 (a) (b) Figure 9: Colouring of a “snake” level set within a distributed background mesh. The background mesh is split between four processors. Processor boundaries are shown with black lines. The level set creates a single IN volume that loops around the whole background mesh while only being constrained by boundary conditions touching the boundary of the background mesh. Figure (a) shows the local colourings produced by each processor independently. Figure (b) shows the global colouring. (BFS) algorithm to colour connected parts of the graph that share the same IN/OUT state. Algorithms 1 and 2 detail the procedures used to colour the whole graph and each individual volume, respectively. In the context of distributed meshes, each processor _p_ only stores a local portion of the graph, denoted _G_ _p_ . Colouring each local graph partition _G_ _p_ locally (independently) is insufficient to reliably identify the global isolated volumes. Specifically, a single volume might span multiple processor domains but only be adjacent to constraining boundaries (e.g., Dirichlet boundaries) within a subset of these domains. In the worst-case scenario, a volume could theoretically span all processor domains within the communicator, while the relevant constraining boundaries reside in only a single processor’s domain (see Figure 9). This information has to be propagated to all processors that share the volume, which is inevitably a global operation. A global volume colouring algorithm is therefore required. This is done in two steps: First, we use Algorithm 1 in each processor _p_ to create a local colouring of _G_ _p_ . For each local volume, we then locally collect a) all neighbouring processors sharing this volume and b) the local colour ID of the volume within the neighbouring processor. This can be done through (relatively) inexpensive neighbour-to-neighbour communications, typical within an FEM context. Finally, this local information is gathered within a single processor that uses it to create a global numbering. The global colouring is then scattered back to all processors. 19 <u>Algorithm 1</u> <u>ColourGraph(G,S)</u> Input: 1: _G_ : Adjacency graph: _neighbours_ ( _v_ ) = _G_ [ _v_ ] 2: _S_ : Array of vertex IN/OUT states: _state_ ( _v_ ) = _S_ [ _v_ ] Output: 3: _C_ : Final colour assignment for each cell, where each colour identifies a connected component within a group. 4: _S c_ : Mapping from final colour index to its state. 5: 6: Initialise _C_ as an empty vector of size num ~~v~~ ertices( _G_ ) 7: Initialise _S c_ as an empty list 8: _nc_ ← 0 9: for _v_ in _G_ do 10: if _v_ not coloured then - New volume found 11: _nc_ ← _nc_ + 1 12: Append!( _S c_, _state_ ( _v_ )) 13: Call ColourVolume( _v_, _nc_, _G_, _S_, _C_ ) - Propagate colour through volume. 14: return _C_, _S c_ <u>Algorithm 2</u> colourVolume( _<u>v</u>_ <u>0,</u> _<u>c</u>_ <u>,</u> _<u>G</u>_ <u>,</u> _<u>S</u>_ <u>,</u> _<u>C</u>_ <u>)</u> Input: 1: _v_ 0: Starting vertex 2: _c_ : Colour value to assign to this volume 3: _G_ : Adjacency graph: _neighbours_ ( _v_ ) = _G_ [ _v_ ] 4: _S_ : Array of vertex IN/OUT states: _state_ ( _v_ ) = _S_ [ _v_ ] 5: _C_ : Array to vertex colours (output) Output: 6: Modifies _C_ in place, stops when all connected vertices to _v_ 0 that share the same state have been coloured. 7: 8: Initialise empty queue _Q_ 9: Enqueue _v_ 0 into _Q_ 10: while _Q_ is not empty do 11: _v_ ← Dequeue( _Q_ ) 12: _C_ [ _v_ ] ← _c_ - Colour the vertex 13: for all _u_ in _neighbours_ ( _v_ ) do - Enqueue neighbours 14: if _u_ not coloured and _state_ ( _v_ ) == _state_ ( _u_ ) then 15: Enqueue _u_ into _Q_ 20 Algorithm 3 ColourDistributedGraph( _G_, _S_ _p_ ) Input: 1: _G_ = { _G_ _p_, _gG_ }: Global adjacency graph 2: _S p_ : Local arrays of vertex IN/OUT states Output: 3: _C_ = { _C_ _p_, _gC_ }: Global colouring for each cell 4: _S c_ : Mapping from each local colour to its state. 5: 6: _C_ _p_, _S c_ ← ColourGraph( _G_ _p_, _S_ _p_ ) 7: _C_ ← GlobalColouring( _G_, _C_ _p_ ) 8: return _C_, _S c_ 5. Examples In this section, we consider two examples that make use of the automatic differentiation techniques and the isolated volume algorithm discussed above. The first example is topology optimisation of a three-dimensional linear elastic wheel and the second is topology optimisation of the elastic part in a fluid-structure interaction problem. _5.1._ _Elastic wheel_ _5.1.1._ _Formulation_ In this section, we consider the minimum compliance optimisation of a three-dimensional linear elastic wheel. The formulation of this problem is similar to the two-dimensional wheel considered in [13]. Figure 10a shows the background domain _D_ and the boundary conditions for this problem. We apply a homogeneous Dirichlet boundary condition to the outer shell and a non-homogeneous Neumann boundary condition _g_ ( _x_, _y_, _z_ ) = 100(− _y_, _x_, 0) to the inner shell. The strong formulation of this problem is given by −∇ - σ( _d_ ) = 0 in Ω(ϕ), σ( _d_ ) · _n_ = 0 on Γ(ϕ), (42) σ( _d_ ) · _n_ = _g_ on Γ _N_,  _d_ = 0 on Γ _D_, −∇ - σ( _d_ ) = 0 in Ω(ϕ), σ( _d_ ) · _n_ = 0 on Γ(ϕ), σ( _d_ ) · _n_ = _g_ on Γ _N_, _d_ = 0 on Γ _D_, (42) where σ( _d_ ) = λ tr(ε( _d_ )) _I_ + 2µε( _d_ ) is the stress tensor, ε( _d_ ) = <sup><u>1</u></sup> 2 <sup>(∇</sup> <sup>_d_</sup> <sup>+ (∇</sup> <sup>_d_</sup> <sup>)⊺) is the strain tensor,</sup> and λ = 0.5769 and µ = 0.3846 are the Lam´e constants of the material. To avoid ill-conditioning of the system resulting from the finite element discretisation of Equation (42), we use CutFEM as described in [13] and references therein. In particular, the weak formulation of this problem is: Weak form 4. _For_ Ω(ϕ) ⊂ _D, find_ _d_ ∈ _R such that_ _A_ ( _d_, _s_ ) = _a_ ( _d_, _s_ ) + _k_ ψ( _d_, _s_ ) + _j_ ( _d_, _s_ ) = _l_ ( _s_ ), ∀ _s_ ∈ _T_, (43) 21 Γ _N_ _D_ Γ _D_ (a) (b) Figure 10: A visualisation of the setup for the minimum compliance optimisation of a three-dimensional linear elastic wheel. Figure (a) shows the background domain _D_ and boundary conditions. The red boundary denotes a homogeneous Dirichlet boundary condition on Γ _D_, while the blue boundary denotes a nonhomogeneous Neumann boundary condition _g_ ( _x_, _y_, _z_ ) = 100(− _y_, _x_, 0) on Γ _N_ . Figure (b) shows the initial domain Ω(ϕ0). The inner and outer cylinders have a radii of 0.1 and 1, respectively, and the thickness of the wheel is 0.3. _with_ _a_ ( _d_, _s_ ) = _l_ ( _s_ ) = Γ _N_ _k_ ψ( _d_, _s_ ) = σ ( _d_ ) : ε ( _s_ ) d _x_, (44) Ω(ϕ) _s_ - _g_ d _s_, (45) ψ _d_ - _s_ d _x_, (46) Ω(ϕ) _j_ ( _d_, _s_ ) = γ(λ + µ) _F_ ∈ _TG_ _F_ _h_ <sup>3</sup> _F_ <sup>�</sup> <sup>_n_</sup> <sup>_F_</sup> <sup>· ∇</sup> <sup>_d_</sup> <sup>�</sup> <sup>· �</sup> <sup>_n_</sup> <sup>_F_</sup> <sup>· ∇</sup> <sup>_s_</sup> <sup>�</sup> <sup>d</sup> <sup>_s_</sup> <sup>,</sup> (47) _where R_ = { _d_ ∈ [ _H_ <sup>1</sup> (Ω(ϕ))] <sup>3</sup> : _d_ |Γ _D_ = 0, _d_ |Γ _N_ = _d_ 0} _and T_ = { _d_ ∈ [ _H_ <sup>1</sup> (Ω(ϕ))] <sup>3</sup> : _d_ |Γ _D_ = 0, _d_ |Γ _N_ = 0 } _._ In the above, _TG_ is known as the ghost skeleton and defined in [10] as follows: for distinct elements _K_ 1 ∈ _Sh_ and _K_ 2 ∈ _Sh_, a facet _F_ ∈ _TG_ is given by _F_ = _K_ 1 ∩ _K_ 2 where at least one of _K_ 1 or _K_ 2 intersect the interface. In addition, the operation : denotes double contraction, _a_ ( _d_, _s_ ) is the standard bilinear form for elasticity, _k_ ψ( _d_, _s_ ) enforces zero displacement within the isolated volume marked by ψ (see Section 4.3), and _j_ ( _d_, _s_ ) is the ghost penalty stabilisation term discussed 22 in [13] with stabilisation parameter γ = 10 <sup>−7</sup> . Finally, we replace the test space _T_ and trial space _R_ with discrete spaces of continuous piecewise-linear vector fields denoted _T_ <sup>_h_</sup> and _R_ <sup>_h_</sup>, respectively. The optimisation problem is then ϕmin∈ _W_ <sup>_h_</sup> <sup>_J_</sup> <sup>(ϕ) �</sup> Ω(ϕ) σ ( _d_ ) : ε ( _d_ ) d _x_ s.t. _C_ (ϕ) = 0, _A_ ( _d_, _s_ ) = _l_ ( _s_ ), ∀ _s_ ∈ _T_ <sup>_h_</sup>, (48) where _C_ (ϕ) - Vol(Ω(ϕ)) − _V_ _f_ Vol( _D_ ) with Vol(Ω(ϕ)) = where _C_ (ϕ) - Vol(Ω(ϕ)) − _V_ _f_ Vol( _D_ ) with Vol(Ω(ϕ)) = Ω(ϕ) <sup>1 d</sup> <sup>_x_</sup> <sup>and similarly for Vol(</sup> <sup>_D_</sup> <sup>),</sup> <sup>and</sup> _V_ _f_ = 0.4 is the required volume fraction. The above is implemented using GridapTopOpt v0.2.0 [9]. Note that because Gridap and GridapTopOpt allow the user to specify arbitrary weak formulations and optimisation problems, other unfitted approaches, such as the finite cell method [38], can also readily be used. _5.1.2._ _Results_ We solve the optimisation problem in Equation (48) using augmented Lagrangian method [39] as described by Wegert et al. [9] with initial structure shown in Figure 10b. We use the automatic differentiation techniques discussed in Section 3 along with C´ea’s method [26] as provided by GridapTopOpt [9] to compute all derivatives. We generate the symplectic background triangulation _D_ using Gmsh [40] and load the resulting triangulation using GridapGmsh [41]. The resulting mesh has roughly 1.32M elements and 219K nodes. We partition the background triangulation into 48 parts and solve the optimisation problem in an efficient memory-distributed framework using 48 processors. For a detailed review of the techniques used to improve computational efficiency we refer the reader to Badia and Verdugo [24], Badia et al. [27], and Wegert et al. [9]. To solve the Hilbertian extension-regularisation problem (Equation 33) we use an algebraic multigrid preconditioned conjugate gradient method as outlined in [9]. We use SuperLU ~~D~~ IST [42, 43, 44] to solve the state equation for elasticity, the transport equation, and the reinitialisation equation. In the future, we will investigate iterative methods for solving these problems at larger scales. Figure 11 shows visualisations of intermediate structures and the final structure, while Figure 12 gives the iteration history of the objective and volume constraint. The average iteration time is approximately 4 minutes. This could be significantly improved in future using scalable iterative solvers for the linear systems resulting from the finite element discretisation. In addition, the number of iterations required to reach convergence could be reduced by using a more advanced optimiser such as a projection/null-space method [45, 46]. The results demonstrate that using the unfitted approaches for level-set evolution and reinitialisation, we are able to solve topology optimisation problems on unstructured background domains using the automatic differentiation techniques discussed in Section 3. _5.2._ _Fluid-structure interaction_ _5.2.1._ _Formulation_ In this section, we consider topology optimisation of a linear elastic structure in a fluidstructure interaction problem with Stokes flow. We assume that the displacement of the elastic 23 (a) Iter. 50 (b) Iter. 100 (c) Iter. 150 (d) Iter. 240 Figure 11: Visualisations of the intermediate structures (Fig. a – Fig. c) and the final optimised structure (Fig. d) for the elastic wheel problem. We outline the background domain using the black lines. (a) (b) Figure 12: Iteration history of the objective (Fig. a) and volume constraint (Fig. b) for the elastic wheel problem. 24 1 Γ _f_, _D_ 0.7 1 Γbottom Γ _s_, _D_ Γ _f_, _N_ 0.8 <u>1.5</u> <u>1</u> 4 Figure 13: A visualisation of the background domain _D_ and boundary conditions for the fluid-structure interaction problem. The red boundary Γ _s_, _D_ has a homogeneous Dirichlet boundary condition on the displacement, the blue boundary Γ _f_, _D_ has an in-flow Dirichlet boundary condition on the flow, the green boundary Γ _f_, _N_ has a zero stress condition on the flow exiting the domain, and Γbottom has a no-slip condition. In addition, the sides of the domain Γsides = ∂ _D_ \ (Γbottom ∪ Γ _s_, _D_ ∪ Γ _f_, _D_ ∪ Γ _f_, _N_ ) have no-slip conditions on the flow. The plate at the centre of the domain is fixed and non-designable. The base of the plate and the width of the upright region both have a depth and width of 0.1, respectively. structure is small, so that the coupling in the fluid-structure problem is one way. This allows the fluid and elastic problems to be de-coupled so that they can be solved in a sequential manner. We will refer to these as _staggered_ problems. Figure 13 shows the background domain and boundary conditions for this problem. The region shown in grey is a non-designable region. This setup is similar to the one in [47]. The strong formulation of the Stokes flow is −∇ - σ _f_ ( _u_, _p_ ) = 0 in Ωout(ϕ), ∇ - _u_ = 0 in Ωout(ϕ), σ _f_ ( _u_, _p_ ) · _n_ = 0 on Γ _f_, _N_, _u_ = _u_ _d_ on Γ _f_, _D_, _u_ = 0 on Γ(ϕ) ∪ Γbottom,  _u_ - _n_ = 0 on Γsides, while the strong formulation governing the linear elastic structure is −∇ - σ( _d_ ) = 0 in Ω(ϕ), σ( _d_ ) · _n_ = σ _f_ ( _u_, _p_ ) · _n_ in Γ(ϕ),  _d_ = 0 on Γ _s_, _D_, (49) (50) where Ωout(ϕ) = _D_ \ Ω(ϕ) is the fluid domain, µ _f_ is the viscosity of the flow, _p_ is the pressure, _u_ _d_ = _y_ _e_ 1 is the in-flow on Γ _f_, _D_, and σ _f_ ( _u_, _p_ ) = 2µ _f_ ε( _u_ ) − _p_ _I_ is the stress tensor for the fluid. The system above has one-way coupling as only the surface traction term in Equation 50 depends on the normal stress imparted by the fluid on Γ(ϕ). For the Stokes flow problem, we use the stabilised Nitsche fictitious domain method and a face ghost-penalty stabilisation as detailed in [10] with continuous piecewise linear elements for the 25 velocities and piecewise constant elements for the pressures. For the linear elastic problem, we use the same approach as in Section 5.1. The weak formulations are given by: Weak form 5. _For_ Ω _out_ (ϕ) ⊂ _D, find_ ( _u_, _p_ ) ∈ _U_ × _Q such that_ _R_ 1(( _u_, _p_ ), ( _v_, _q_ )) = _a_ _f_ ( _u_, _v_ )+ _b_ _f_ ( _v_, _p_ )+ _b_ _f_ ( _u_, _q_ )+ _j_ _f_, _u_ ( _u_, _v_ )− _j_ _f_, _p_ ( _p_, _q_ )+ _j_ _f_,ψ( _p_, _q_ ) = 0, ∀( _v_, _q_ ) ∈ _V_ × _Q_, (51) _with_ µ _f_ ∇ _u_ : ∇ _u_ d _x_ _p_ ∇ - _v_ d _x_ µ _f_ ( _n_ - ∇ _u_ ) · _v_ + µ _f_ ( _n_ - ∇ _v_ ) · _u_ - <sup><u>γ</u></sup> <sup>_<u>N</u>_</sup> (52) _h_ <sup>_u_</sup> <sup>·</sup> <sup>_v_</sup> <sup>d</sup> <sup>_s_</sup> <sup>,</sup> _a_ _f_ ( _u_, _v_ ) = Ω _out_ (ϕ) Γ(ϕ) _p_ _n_ - _v_ d _s_, (53) _b_ _f_ ( _v_, _p_ ) = − Ω _out_ (ϕ) Γ(ϕ) _hF_ - _n_ _F_ - ∇ _d_ - - � _n_ _F_ - ∇ _s_ - d _s_, (54) _F_ _j_ _f_, _u_ ( _u_, _v_ ) = γ _u_ µ _f_ _F_ ∈ _TG_ _j_ _f_, _p_ ( _p_, _q_ ) = <sup>γ</sup> <sup>_p_</sup> µ _f_ _j_ _f_,ψ( _p_, _q_ ) = _F_ ∈ _Th_ _F_ _hF_ - _p_ �� _q_ - d _s_, (55) Ω _out_ (ϕ) ψ _f pq_ d _x_, (56) _where_ _U_ = { _u_ ∈ [ _H_ <sup>1</sup> (Ω(ϕ))] <sup>3</sup> : _u_ |Γ _f_, _D_ = _u_ _d_, _u_ |Γ(ϕ)∪Γ _bottom_ = 0, ( _u_ - _n_ )|Γ _sides_ = 0} _and_ _V_ = { _u_ ∈ [ _H_ <sup>1</sup> (Ω(ϕ))] <sup>3</sup> : _u_ |Γ _f_, _D_ = 0, _u_ |Γ(ϕ)∪Γ _bottom_ = 0, ( _u_ - _n_ )|Γ _sides_ = 0} _are_ _the_ _trial_ _and_ _test_ _spaces_ _for_ _the_ _velocity field, and Q_ = _L_ <sup>2</sup> (Ω) _is pressure space._ Weak form 6. _For_ Ω(ϕ) ⊂ _D and_ ( _u_, _p_ ) ∈ _U_ × _Q such that R_ 1(( _u_, _p_ ), ( _v_, _q_ )) = 0, ∀( _v_, _q_ ) ∈ _V_ × _Q,_ _find_ _d_ ∈ _T_ _such that_ _R_ 2(( _u_, _p_ ), _d_, _s_ ) = _a_ ( _d_, _s_ ) + _k_ ( _d_, _s_ ) + _j_ ( _d_, _s_ ) − _ls_ (( _u_, _p_ ), _s_ ) = 0, ∀ _s_ ∈ _T_, (57) _with a_ ( _d_, _s_ ) _, k_ ( _d_, _s_ ) _, and_ _j_ ( _d_, _s_ ) _as in Equation_ (44) _,_ (46) _, and_ (47) _, and_ _ls_ (( _u_, _p_ ), _s_ ) = _where T_ = { _d_ ∈ [ _H_ <sup>1</sup> (Ω(ϕ))] <sup>3</sup> : _d_ |Γ _s_, _D_ = 0 } _._ (1 − ψ _s_ ) _s_ - (σ _f_ ( _u_, _p_ ) · _n_ ) d _s_ (58) Γ(ϕ) In Weak form 5, the inclusion of 1 - ψ _s_ in _ls_ ensures that isolated volumes of the solid phase have zero displacement, γ _N_ = 100 is the Nitsche parameter, _j_ _f_, _u_ ( _u_, _v_ ) is the ghost penalty term with stabilisation parameter γ _u_ = 0.1, _j_ _f_, _p_ ( _p_, _q_ ) is the symmetric pressure stabilisation for piecewise constant pressures with stabilisation parameter γ _p_ = 0.25, and _j_ _f_,ψ( _p_, _q_ ) enforces an average pressure in isolated volumes of Ωout(ϕ) marked by ψ _f_ . The optimisation problem is then given by ϕmin∈ _W_ <sup>_h_</sup> <sup>_J_</sup> <sup>(ϕ) �</sup> Ω(ϕ) σ ( _d_ ) : ε ( _d_ ) d _x_ + Ω(ϕ) γ _s_ ψ _s_ d _x_ s.t. _C_ (ϕ) = 0, _R_ 1(( _u_, _p_ ), ( _v_, _q_ )) = 0, ∀( _v_, _q_ ) ∈ _V_ × _Q_, _R_ 2(( _u_, _p_ ), _d_, _s_ ) = 0, ∀ _s_ ∈ _T_, 26 (59) where _C_ (ϕ) is the volume constraint as previously with _V_ _f_ = 0.06. It should be noted that isolated volumes in the solid phase obstruct fluid flow due to the no-slip boundary conditions at the interface. As a result, these can artificially improve the objective. We therefore augment the minimum compliance objective with a term that penalises isolated volumes in the solid phase with a penalisation constant of _c_ = 1000. This ensures that isolated volumes in the solid phase are removed. Note that when no isolated volumes are present, the objective reduces to minimum compliance. To compute derivatives of _J_ with respect to ϕ, we develop an adjoint method for staggered problems based on C´ea’s method [26] and implement this in GridapTopOpt [9]. This is given in Appendix A for general staggered problems of size _k_ . Our particular example corresponds to the case _k_ = 2. Incorporating additional physics (e.g., thermostatics) increases the size of the staggered system. _5.2.2._ _Results_ To solve the optimisation problem in Equation (59) we again use the augmented Lagrangian method. In addition, we generate an unstructured symplectic background triangulation with refinement in the region around the non-designable region to improve accuracy of the solutions near the interface of the elastic structure. The non-refined region has a maximum element size of 0.05 while the refined region has a maximum element size of 0.015. In addition, we use symmetry to halve the computational domain. As a result, the background triangulation has roughly 824K elements and 129K nodes. We partition the background triangulation into 48 parts and solve the optimisation problem in a memory-distributed framework using 48 processors. We use SuperLU ~~D~~ IST [42, 43, 44] to solve all linear systems in parallel. Figure 14 show visualisations of the initial structure, intermediate structures, and the final structure, while Figure 15 gives the iteration history of the objective and volume constraint. The average iteration time is approximately 8.5 minutes. As with the previous example, this could be significantly improved in future by using scalable iterative solvers and the number of iterations required to reach convergence could be reduced by using a more advanced optimiser. These results demonstrate that automatic shape differentiation for unfitted discretisations can be used to solve more complicated multi-physics problems, thereby avoiding the difficult and error-prone calculation of shape derivatives. In addition, the unfitted finite element allows us to accurately represent the boundary condition for the flow field. 6. Conclusions In this paper, we extended the shape calculus results developed in [16] to the case where the domain boundary intersects the background domain boundary and linked these theoretical results to automatic shape differentiation for unfitted discretisations. We implemented analytic directional shape derivatives and unfitted automatic shape differentiation in the Julia package GridapTopOpt [9] and showed that the analytic directional shape derivatives given by Berggren [16] and the extensions considered in this work can be recovered to machine precision regardless of mesh size. We proposed that unfitted automatic shape differentiation can be used to avoid computing intricate mesh-related quantities that appear in directional derivatives of surface integrals. Furthermore, automatic shape differentiation can compute derivatives of expressions for which there is not yet a 27 (a) It. 0 (b) It. 50 (c) It. 100 (d) It. 200 (e) It. 400 (f) It. 519 (g) Figure 14: Visualisations of the initial structure (Fig. a), intermediate structures (Fig. b – Fig. e) and the final optimised structure (Fig. f) for the fluid-structure interaction problem. Figure (g) shows a visualisation of the velocity field and pressure field in the fluid. rigorous mathematical counterpart in the framework of Berggren [16], such as shape Hessians. We showed that our implementation readily captures the shape Hessian and again verified the result with finite differences. Our implementation in GridapTopOpt and the wider Gridap ecosystem is general and can be 28 (a) (b) Figure 15: Iteration history of the objective (Fig. a) and volume constraint (Fig. b) for the fluid-structure interaction problem. executed in both serial and distributed computing frameworks to solve arbitrary PDE-constrained optimisation problems using unfitted finite elements. We propose a novel graph-based approach to detect isolated volumes using a conforming connectivity graph for the cut mesh and a graphcolouring algorithm. These extensions allow GridapTopOpt to solve an even wider range of problems on unstructured background triangulations. Furthermore, by utilising unfitted methods, we avoid issues that arise from smoothing the material properties across the interface, thus providing higher accuracy solutions. To demonstrate the applicability of the unfitted automatic shape differentiation framework and our implementation, we considered two example optimisation problems: minimum compliance optimisation of a three-dimensional linear elastic wheel; and topology optimisation of a three-dimensional linear elastic structure in a fluid-structure interaction problem with Stokes flow. We solved these problems using CutFEM and distributed the computation over a computing cluster. We avoided computation of all analytic directional shape derivatives by leveraging the automatic shape differentiation techniques developed in this work. In the future, we plan to extend the framework to multi-material problems involving several level-set functions and improve the scalability of algorithms by leveraging matrix-free methods. CRediT authorship contribution statement Zachary J Wegert: Writing – original draft, Writing – review and editing, Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization. Jordi Manyer: Writing - original draft, Writing - review & editing, Software, Methodology. Connor Mallon: Writing – review & editing, Supervision. Santiago Badia: Supervision, Writing - review & editing, Resources. Vivien J Challis: Supervision, Writing - review & editing, Conceptualization, Project administration, Funding acquisition, Resources. Declaration of Competing Interest The authors have no competing interests to declare that are relevant to the content of this article. 29 Data availability The source code and data for this work is available at `[https://github.com/zjwegert/](https://github.com/zjwegert/GridapTopOpt.jl)` `[GridapTopOpt.jl](https://github.com/zjwegert/GridapTopOpt.jl)` . Acknowledgement The authors would like to thank Prof. Martin Berggren for his insightful and encouraging comments. This work was supported by the Australian Research Council through the Discovery Projects grant scheme (DP220102759). This research used computational resources provided by: the eResearch Office, Queensland University of Technology; the Queensland Cyber Infrastructure Foundation (QCIF); and the National Computational Infrastructure (NCI) Australia. The first author is supported by a QUT Postgraduate Research Award and a Supervisor Top-Up Scholarship. The above support is gratefully acknowledged. Appendix A. Adjoint method for staggered problems In this appendix, we consider the directional derivative of a functional _J_ ( _u_ 1, . . ., _uk_, ϕ) at ϕ in the direction ψ where ( _u_ 1, . . ., _uk_ ) ∈ _U_ = _U_ 1 × · · · × _Uk_ depend on ϕ ∈ Φ through the residuals _R_ 1( _u_ 1, _v_ 1, ϕ) = 0, ∀ _v_ 1 ∈ _V_ 1, _R_ 2( _u_ 1, _u_ 2, _v_ 2, ϕ) = 0, ∀ _v_ 2 ∈ _V_ 2, ... _Rk_ ( _u_ 1, . . ., _uk_, _vk_, ϕ) = 0, ∀ _vk_ ∈ _Vk_, where _u_ 1, . . ., _uk_ have the following dependence _u_ 1 = _u_ 1(ϕ), _u_ 2 = _u_ 2( _u_ 1, ϕ), ... _uk_ = _uk_ ( _u_ 1, . . ., _uk_, ϕ), and _Ri_ is linear in the test function _vi_ . (A.1) (A.2) We assume that the above are sufficiently differentiable and proceed with C´ea’s formal method [26]. For brevity of the construction, we drop the notational dependence of _J_ and _Ri_ on _u_ 1, . . ., _uk_ and ϕ, excepting the definition of the Lagrangian below. In particular, we use the following shorthand for directional derivatives: the directional derivative of _J_ at _ui_ in the direction _qi_ is ∂ _ui_ _J_ ( _qi_ ) � ∂ _ui_ _J_ ( _u_ 1, . . ., _uk_, ϕ)( _qi_ ) � <sup>_<u>d</u>_</sup> _dt_ _J_ ( _u_ 1, . . ., _ui_ + _tqi_, . . ., _uk_, ϕ), (A.3) ����� _t_ =0 and similarly for other functionals and fields. 30 Suppose that we define the Lagrangian L : _U_ × _V_ × Φ to be L( _p_ 1, . . ., _pk_, λ1, . . ., λ _k_, ϕ) = _J_ ( _p_ 1, . . ., _pk_, ϕ) − _k_ _i_ =1 _Ri_ ( _p_ 1, . . ., _pi_, λ _i_, ϕ). (A.4) where _V_ = _V_ 1 × · · · × _Vk_ and (λ1, . . ., λ _k_ ) ∈ _V_ are called the adjoint variables. Clearly, at the solutions _u_ 1, . . ., _uk_ of the residuals in Equation (A.1) we recover _J_ via L|( _p_ 1,..., _pk_ )=( _u_ 1,..., _uk_ )= _J_ ( _u_ 1, . . ., _uk_, ϕ). (A.5) A derivative of L at λ _i_ in the direction _qi_ gives ∂λ _i_ L( _qi_ ) = − _Ri_ ( _p_ 1, . . ., _pi_, _qi_, ϕ) (A.6) by linearity in the test function. Requiring stationarity of Equation (A.6) recovers the ith equation in (A.1) for ( _p_ 1, . . ., _pk_ ) = ( _u_ 1, . . ., _uk_ ). Next, a derivative of L at _pi_ in the direction _wi_ gives ∂ _pi_ L( _wi_ ) = ∂ _pi_ _J_ ( _wi_ ) − _k_ _j_ = _i_ ∂ _piR_ _j_ ( _wi_ ) (A.7) Requiring stationarity of Equation (A.7) recovers an equation for the ith adjoint problem. Note that the ith equation in Equation (A.7) depends on λ _i_ +1, . . ., λ _k_ . This defines a staggered system of linear adjoint problems of the form: For ( _p_ 1, . . ., _pk_ ) = ( _u_ 1, . . ., _uk_ ), find (λ1, . . ., λ _k_ ) ∈ _V_ such that ∂ _ukRk_ ( _u_ 1, . . ., _uk_, λ _k_, ϕ)( _wk_ ) = ∂ _uk_ _J_ ( _u_ 1, . . ., _uk_, ϕ)( _wk_ ), _wk_ ∈ _Uk_, ∂ _uk_ −1 _Rk_ −1( _u_ 1, . . ., _uk_ −1, λ _k_ −1, ϕ)( _wk_ −1) = ∂ _uk_ −1 _J_ ( _u_ 1, . . ., _uk_ −1, _uk_, ϕ)( _wk_ −1) - ∂ _uk_ −1 _Rk_ ( _u_ 1, . . ., _uk_, λ _k_, ϕ)( _wk_ −1), _wk_ −1 ∈ _Uk_ −1, ... ∂ _uiRi_ ( _u_ 1, . . ., _ui_, λ _i_, ϕ)( _wi_ ) = ∂ _ui_ _J_ ( _u_ 1, . . ., _ui_, . . ., _uk_, ϕ)( _wi_ ) − ... _k_ _j_ = _i_ +1 ∂ _uiR_ _j_ ( _u_ 1, . . ., _u_ _j_, λ _j_, ϕ)( _wi_ ), _wi_ ∈ _Ui_, ∂ _u_ 1 _R_ 1( _u_ 1, λ1, ϕ)( _w_ 1) = ∂ _u_ 1 _J_ ( _u_ 1, . . ., _uk_, ϕ)( _w_ 1) − _k_ _j_ =2 ∂ _u_ 1 _R j_ ( _u_ 1, . . ., _u_ _j_, λ _j_, ϕ)( _w_ 1), _w_ 1 ∈ _U_ 1. (A.8) For clarity, we explicitly show the dependence on the fields _ui_ and λ _i_ . Note that the test and trial functions are swapped, so the transpose is assembled at discretisation. Each λ _i_ can be found by first solving the problem for λ _k_ then λ _k_ −1 through to λ1. Finally, at the solution ( _p_ 1, . . ., _pk_ ) = ( _u_ 1, . . ., _uk_ ) that satisfies the residuals in Equation (A.1), and (λ1, . . ., λ _k_ ) that that satisfies the staggered linear system in Equation (A.8), a derivative of L at ϕ in the direction ψ gives _k_ ∂ϕ _Ri_ (ψ) + _i_ =1 31 dL(ϕ; ψ) = ∂ϕ _J_ (ψ) − _k_ _i_ =1 ∂λ _i_ L(∂ϕλ _i_ (ψ)) + _k_ _i_ =1 ∂ _ui_ L(∂ϕ _ui_ (ψ)) (A.9) where we have used the chainrule. The last two expressions vanish due to the stationarity of Equations (A.6) and (A.8). As we recover the _J_ from L in Equation (A.5), we have d _J_ (ϕ; ψ) = ∂ϕ _J_ ( _u_ 1, . . ., _uk_, ϕ)(ψ) − _k_ _i_ =1 ∂ϕ _Ri_ ( _u_ 1, . . ., _ui_, λ _i_, ϕ)(ψ), (A.10) where we have written out the explicit dependence on fields _ui_ and λ _i_ . References [1] M. P. Bendsøe, O. Sigmund, Topology Optimization Theory, Methods, and Applications, second ed., Springer Berlin Heidelberg, Berlin, Heidelberg, 2004. doi: `[10.1007/978-3-662-05086-6](http://dx.doi.org/10.1007/978-3-662-05086-6)` . [2] J. Deaton, R. Grandhi, A survey of structural and multidisciplinary continuum topology optimization: post 2000, Structural and Multidisciplinary Optimization 49 (2013) 1––38. doi: `[10.1007/s00158-013-0956-z](http://dx.doi.org/10.1007/s00158-013-0956-z)` . [3] O. Sigmund, K. Maute, Topology optimization approaches: A comparative review, Structural and Multidisci plinary Optimization 48 (2013) 1031–1055. doi: `[10.1007/s00158-013-0978-6](http://dx.doi.org/10.1007/s00158-013-0978-6)` . [4] G. Allaire, C. Dapogny, F. Jouve, Shape and topology optimization, volume 22, Elsevier, 2021, p. 1–132. doi: `[10.](http://dx.doi.org/10.1016/bs.hna.2020.10.004)` `[1016/bs.hna.2020.10.004](http://dx.doi.org/10.1016/bs.hna.2020.10.004)` . [5] M. P. Bendsøe, Optimal shape design as a material distribution problem, Structural Optimization 1 (1989) 193–202. doi: `[10.1007/BF01650949](http://dx.doi.org/10.1007/BF01650949)` . [6] G. I. N. Rozvany, M. Zhou, T. Birker, Generalized shape optimization without homogenization, Structural Optimization 4 (1992) 250–252. doi: `[10.1007/BF01742754](http://dx.doi.org/10.1007/BF01742754)` . [7] M. Y. Wang, X. Wang, D. Guo, A level set method for structural topology optimization, Computer Methods in Applied Mechanics and Engineering 192 (2003) 227–246. doi: `[10.1016/S0045-7825(02)00559-5](http://dx.doi.org/10.1016/S0045-7825%0x2802%0x2900559-5)` . [8] G. Allaire, F. Jouve, A.-M. Toader, Structural optimization using sensitivity analysis and a level-set method, Journal of Computational Physics 194 (2004) 363–393. doi: `[10.1016/j.jcp.2003.09.032](http://dx.doi.org/10.1016/j.jcp.2003.09.032)` . [9] Z. J. Wegert, J. Manyer, C. N. Mallon, S. Badia, V. J. Challis, GridapTopOpt.jl: a scalable Julia toolbox for level set-based topology optimisation, Structural and Multidisciplinary Optimization 68 (2025) 22. doi: `[10.1007/](http://dx.doi.org/10.1007/s00158-024-03927-3)` `[s00158-024-03927-3](http://dx.doi.org/10.1007/s00158-024-03927-3)` . [10] E. Burman, S. Claus, P. Hansbo, M. G. Larson, A. Massing, CutFEM: Discretizing geometry and partial differential equations, International Journal for Numerical Methods in Engineering 104 (2015) 472–501. doi: `[10.1002/nme.4823](http://dx.doi.org/10.1002/nme.4823)` . [11] S. Badia, F. Verdugo, A. F. Mart´ın, The aggregated unfitted finite element method for elliptic problems, Com puter Methods in Applied Mechanics and Engineering 336 (2018) 533–553. doi: `[10.1016/j.cma.2018.03.](http://dx.doi.org/10.1016/j.cma.2018.03.022)` `[022](http://dx.doi.org/10.1016/j.cma.2018.03.022)` . [12] F. de Prenter, C. V. Verhoosel, E. H. van Brummelen, M. G. Larson, S. Badia, Stability and conditioning of immersed finite element methods: Analysis and remedies, Archives of Computational Methods in Engineering 30 (2023) 3617–3656. URL: `[http://dx.doi.org/10.1007/s11831-023-09913-0](http://dx.doi.org/10.1007/s11831-023-09913-0)` . doi: `[10.1007/s11831-023-09913-0](http://dx.doi.org/10.1007/s11831-023-09913-0)` . [13] E. Burman, D. Elfverson, P. Hansbo, M. G. Larson, K. Larsson, Shape optimization using the cut finite element method, Computer Methods in Applied Mechanics and Engineering 328 (2018) 242–261. doi: `[10.1016/j.cma.](http://dx.doi.org/10.1016/j.cma.2017.09.005)` `[2017.09.005](http://dx.doi.org/10.1016/j.cma.2017.09.005)` . [14] C. H. Villanueva, K. Maute, CutFEM topology optimization of 3d laminar incompressible flow problems, Computer Methods in Applied Mechanics and Engineering 320 (2017) 444–473. doi: `[10.1016/j.cma.2017.](http://dx.doi.org/10.1016/j.cma.2017.03.007)` `[03.007](http://dx.doi.org/10.1016/j.cma.2017.03.007)` . [15] A. Bernland, E. Wadbro, M. Berggren, Acoustic shape optimization using cut finite elements: Acoustic shape optimization using cut finite elements, International Journal for Numerical Methods in Engineering 113 (2018) 432–449. doi: `[10.1002/nme.5621](http://dx.doi.org/10.1002/nme.5621)` . [16] M. Berggren, Shape calculus for fitted and unfitted discretizations: Domain transformations vs. boundaryface dilations, Communications in Optimization Theory 2023 (2023). URL: `[https://cot.mathres.org/](https://cot.mathres.org/archives/1568)` `[archives/1568](https://cot.mathres.org/archives/1568)` . doi: `[10.23952/cot.2023.27](http://dx.doi.org/10.23952/cot.2023.27)` . 32 [17] S. Schmidt, Weak and strong form shape hessians and their automatic generation, SIAM Journal on Scientific Computing 40 (2018) C210–C233. doi: `[10.1137/16M1099972](http://dx.doi.org/10.1137/16M1099972)` . [18] S. Schmidt, M. Sch¨utte, A. Walther, Efficient numerical solution of geometric inverse problems involving maxwell’s equations using shape derivatives and automatic code generation, SIAM Journal on Scientific Computing 40 (2018) B405–B428. doi: `[10.1137/16M110602X](http://dx.doi.org/10.1137/16M110602X)` . [19] D. A. Ham, L. Mitchell, A. Paganini, F. Wechsung, Automated shape differentiation in the unified form language, Structural and Multidisciplinary Optimization 60 (2019) 1813–1820. doi: `[10.1007/s00158-019-02281-z](http://dx.doi.org/10.1007/s00158-019-02281-z)` . [20] A. Neofytou, T. Rios, M. Bujny, S. Menzel, H. A. Kim, Level set topology optimization with sparse automatic differentiation, Structural and Multidisciplinary Optimization 67 (2024) 178. doi: `[10.1007/](http://dx.doi.org/10.1007/s00158-024-03894-9)` `[s00158-024-03894-9](http://dx.doi.org/10.1007/s00158-024-03894-9)` . [21] J. S. Dokken, S. K. Mitusch, S. W. Funke, Automatic shape derivatives for transient pdes in fenics and firedrake (2020). URL: `[http://arxiv.org/abs/2001.10058](http://arxiv.org/abs/2001.10058)` . doi: `[10.48550/arXiv.2001.10058](http://dx.doi.org/10.48550/arXiv.2001.10058)`, arXiv:2001.10058 [math]. [22] P. Gangl, K. Sturm, M. Neunteufel, J. Sch¨oberl, Fully and semi-automated shape differentiation in ngsolve, Structural and Multidisciplinary Optimization 63 (2021) 1579–1607. doi: `[10.1007/s00158-020-02742-w](http://dx.doi.org/10.1007/s00158-020-02742-w)` . [23] C. N. Mallon, A. W. Thornton, M. R. Hill, S. Badia, Neural Level Set Topology Optimization Using Unfitted Finite Elements, International Journal for Numerical Methods in Engineering 126 (2025) e70004. URL: `[https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.70004](https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.70004)` . doi: `[https://doi.org/10.1002/](http://dx.doi.org/https://doi.org/10.1002/nme.70004)` `[nme.70004](http://dx.doi.org/https://doi.org/10.1002/nme.70004)` . [24] S. Badia, F. Verdugo, Gridap: an extensible finite element toolbox in Julia, Journal of Open Source Software 5 (2020) 2520. doi: `[10.21105/joss.02520](http://dx.doi.org/10.21105/joss.02520)` . [25] F. Verdugo, S. Badia, The software design of Gridap: A finite element package based on the Julia JIT compiler, Computer Physics Communications 276 (2022) 108341. doi: `[10.1016/j.cpc.2022.108341](http://dx.doi.org/10.1016/j.cpc.2022.108341)` . [26] J. C´ea, Conception optimale ou identification de formes, calcul rapide de la d´eriv´ee directionnelle de la fonc tion coˆut, ESAIM: Mathematical Modelling and Numerical Analysis 20 (1986) 371–402. doi: `[10.1051/m2an/](http://dx.doi.org/10.1051/m2an/1986200303711)` `[1986200303711](http://dx.doi.org/10.1051/m2an/1986200303711)` . [27] S. Badia, A. F. Mart´ın, F. Verdugo, GridapDistributed: a massively parallel finite element toolbox in julia, Journal of Open Source Software 7 (2022) 4157. URL: `[https://doi.org/10.21105/joss.04157](https://doi.org/10.21105/joss.04157)` . doi: `[10.](http://dx.doi.org/10.21105/joss.04157)` `[21105/joss.04157](http://dx.doi.org/10.21105/joss.04157)` . [28] E. Burman, Ghost penalty, Comptes Rendus. Math´ematique 348 (2010) 1217–1220. URL: `[http://dx.doi.](http://dx.doi.org/10.1016/j.crma.2010.10.006)` `[org/10.1016/j.crma.2010.10.006](http://dx.doi.org/10.1016/j.crma.2010.10.006)` . doi: `[10.1016/j.crma.2010.10.006](http://dx.doi.org/10.1016/j.crma.2010.10.006)` . [29] C. Dapogny, A. Faure, G. Michailidis, G. Allaire, A. Couvelas, R. Estevez, Geometric constraints for shape and topology optimization in architectural design, Computational Mechanics 59 (2017) 933–965. doi: `[10.1007/](http://dx.doi.org/10.1007/s00466-017-1383-6)` `[s00466-017-1383-6](http://dx.doi.org/10.1007/s00466-017-1383-6)` . [30] A. G. Baydin, B. A. Pearlmutter, A. A. Radul, J. M. Siskind, Automatic Differentiation in Machine Learning: a Survey, Journal of Machine Learning Research 18 (2018) 1–43. [31] F. Verdugo, E. Neiva, P. A. Martorell, S. Badia, GridapEmbedded, `[https://github.com/gridap/](https://github.com/gridap/GridapEmbedded.jl)` `[GridapEmbedded.jl](https://github.com/gridap/GridapEmbedded.jl)`, 2020. [32] E. Burman, D. Elfverson, P. Hansbo, M. G. Larson, K. Larsson, A cut finite element method for the Bernoulli free boundary value problem, Computer Methods in Applied Mechanics and Engineering 317 (2017) 598–618. doi: `[10.1016/j.cma.2016.12.021](http://dx.doi.org/10.1016/j.cma.2016.12.021)` . [33] E. Burman, M. A. Fern´andez, Finite element methods with symmetric stabilization for the transient convection–diffusion–reaction equation, Computer Methods in Applied Mechanics and Engineering 198 (2009) 2508–2519. doi: `[10.1016/j.cma.2009.02.011](http://dx.doi.org/10.1016/j.cma.2009.02.011)` . [34] S. Osher, R. Fedkiw, Level Set Methods and Dynamic Implicit Surfaces, Applied Mathematical Sciences, 1 ed., Springer Science & Business Media, 2006. [35] D. Peng, B. Merriman, S. Osher, H. Zhao, M. Kang, A pde-based fast local level set method, Journal of Computational Physics 155 (1999) 410–438. doi: `[10.1006/jcph.1999.6345](http://dx.doi.org/10.1006/jcph.1999.6345)` . [36] S. Badia, P. A. Martorell, F. Verdugo, Geometrical discretisations for unfitted finite elements on explicit boundary representations, Journal of Computational Physics 460 (2022) 111162. URL: `[https://www.](https://www.sciencedirect.com/science/article/pii/S0021999122002248)` `[sciencedirect.com/science/article/pii/S0021999122002248](https://www.sciencedirect.com/science/article/pii/S0021999122002248)` . doi: `[https://doi.org/10.1016/j.](http://dx.doi.org/https://doi.org/10.1016/j.jcp.2022.111162)` [33](http://dx.doi.org/https://doi.org/10.1016/j.jcp.2022.111162) `[jcp.2022.111162](http://dx.doi.org/https://doi.org/10.1016/j.jcp.2022.111162)` . [37] P. A. Martorell, S. Badia, Stlcutters.jl: A scalable geometrical framework library for unfitted finite element dis cretisations, Computer Physics Communications 309 (2025) 109479. URL: `[http://dx.doi.org/10.1016/](http://dx.doi.org/10.1016/j.cpc.2024.109479)` `[j.cpc.2024.109479](http://dx.doi.org/10.1016/j.cpc.2024.109479)` . doi: `[10.1016/j.cpc.2024.109479](http://dx.doi.org/10.1016/j.cpc.2024.109479)` . [38] J. Parvizian, A. D¨uster, E. Rank, Topology optimization using the finite cell method, Optimization and Engi neering 13 (2012) 57–78. doi: `[10.1007/s11081-011-9159-x](http://dx.doi.org/10.1007/s11081-011-9159-x)` . [39] J. Nocedal, S. J. Wright, Numerical optimization, Springer series in operations research, 2nd ed ed., Springer, New York, 2006. [40] C. Geuzaine, J.-F. Remacle, Gmsh: A 3-d finite element mesh generator with built-in pre- and postprocessing facilities, International Journal for Numerical Methods in Engineering 79 (2009) 1309–1331. URL: `[https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.2579](https://onlinelibrary.wiley.com/doi/abs/10.1002/nme.2579)` . doi: `[doi.org/10.1002/nme.2579](http://dx.doi.org/doi.org/10.1002/nme.2579)` . `[arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1002/nme.2579](http://arxiv.org/abs/https://onlinelibrary.wiley.com/doi/pdf/10.1002/nme.2579)` . [41] S. Badia, F. Verdugo, GridapGmsh, `[https://github.com/gridap/GridapGmsh.jl](https://github.com/gridap/GridapGmsh.jl)`, 2019. [42] J. W. Demmel, J. R. Gilbert, X. S. Li, SuperLU Users’ Guide, Technical Report LBNL-44289, Lawrence Berkeley National Laboratory, 1999. URL: `[http://www.osti.gov/servlets/purl/751785-85h6HO/](http://www.osti.gov/servlets/purl/751785-85h6HO/webviewable/)` `[webviewable/](http://www.osti.gov/servlets/purl/751785-85h6HO/webviewable/)` . doi: `[10.2172/751785](http://dx.doi.org/10.2172/751785)` . [43] X. S. Li, J. W. Demmel, SuperLU ~~D~~ IST: A scalable distributed-memory sparse direct solver for unsymmetric linear systems, ACM Trans. Math. Softw. 29 (2003) 110–140. doi: `[10.1145/779359.779361](http://dx.doi.org/10.1145/779359.779361)` . [44] X. S. Li, P. Lin, Y. Liu, P. Sao, Newly Released Capabilities in the Distributed-Memory SuperLU Sparse Direct Solver, ACM Trans. Math. Softw. 49 (2023) 10:1–10:20. doi: `[10.1145/3577197](http://dx.doi.org/10.1145/3577197)` . [45] Z. J. Wegert, A. P. Roberts, V. J. Challis, A Hilbertian projection method for constrained level setbased topology optimisation, Structural and Multidisciplinary Optimization 66 (2023) 204. doi: `[10.1007/](http://dx.doi.org/10.1007/s00158-023-03663-0)` `[s00158-023-03663-0](http://dx.doi.org/10.1007/s00158-023-03663-0)` . [46] F. Feppon, G. Allaire, C. Dapogny, Null space gradient flows for constrained optimization with applications to shape optimization, ESAIM: Control, Optimisation and Calculus of Variations 26 (2020) 90. doi: `[10.1051/](http://dx.doi.org/10.1051/cocv/2020015)` `[cocv/2020015](http://dx.doi.org/10.1051/cocv/2020015)` . [47] F. Feppon, G. Allaire, C. Dapogny, P. Jolivet, Topology optimization of thermal fluid–structure systems using body-fitted meshes and parallel computing, Journal of Computational Physics 417 (2020) 109574. doi: `[10.](http://dx.doi.org/10.1016/j.jcp.2020.109574)` `[1016/j.jcp.2020.109574](http://dx.doi.org/10.1016/j.jcp.2020.109574)` . 34

섹션 본문 162문단 · 50,874자

(제목 없음)

1In this paper we develop automatic shape differentiation techniques for unfitted discretisations and link these to recent advances in shape calculus for unfitted methods.We extend existing analytic shape calculus results to the case where the domain boundary intersects with the boundary of the background domain.We further show that we can recover these analytic derivatives to machine precision regardless of the mesh size using the developed automatic shape differentiation techniques, drastically reducing the burden associated with the analytic derivation of these quantities.In addition, we show that we can also recover the symmetric shape Hessian.We implement these techniques for both serial and distributed computing frameworks in the Julia package GridapTopOpt and the wider Gridap ecosystem.As part of this implementation we propose a novel graph-based approach for isolated volume detection.We demonstrate the applicability of the unfitted automatic shape differentiation framework and our implementation by considering the three-dimensional minimum compliance topology optimisation of a linear elastic wheel and of a linear elastic structure in a fluid-structure interaction problem with Stokes flow.The implementation is general and allows GridapTopOpt to solve a wider range of problems on unstructured meshes without analytic calculation of shape derivatives and avoiding issues that arise when material properties are smoothed at the domain boundary.The software is open source and available at https://github.com/zjwegert/GridapTopOpt.jl.

Introduction

2Shape and topology optimisation are important computational techniques with a wide range of industrial applications and a substantial theoretical foundation [1,2,3,4].Generally speaking, there are two main branches of techniques in topology optimisation: density methods [5,6] and level-set methods [7,8].In the former, design variables are typically material densities of elements or nodes in a mesh, while, in the latter, the boundary of the domain is implicitly tracked via a levelset function and updated using an evolution equation.

3In conventional level-set methods, the underlying partial differential equations are solved over a domain that is immersed in a static background domain by 'smudging' the boundary over the interface with a smooth Heaviside function [7,8,4].This allows integration to be relaxed over the whole computational domain.While this is computationally efficient and suitable for many topology optimisation problems, it can lead to undesirable computational artefacts particularly in the case of nonlinear behaviour or solid-fluid interaction.In addition, differentiation with respect to the level-set function in a smoothed boundary regime cannot fully capture the shape derivative of a functional under a boundary perturbation [9].Unfitted finite element methods are an alternative approach that embed a complex computational domain into a simple bounding domain without introducing additional degrees of freedom.This works by defining an in and out region based on the sign of the level-set function.The boundary separating the regions is the intersection of the zero isosurface of the level-set function and the background mesh, determined using an appropriate method such as marching tetrahedra [10,11].The boundary mesh can be used to integrate transmission conditions across the interface; for example, in the case of fluid-structure interaction.Unfitted methodologies are a promising way to address the above issues with conventional level-set methods because they provide a precise description of the boundary as a D − 1 dimensional manifold.However, the small cut-cell problem affects unfitted finite element methods; the resulting discrete system is ill-posed when the portion of a cut cell in the domain interior is small [12].This issue has been addressed by using ghost penalty stabilisation (CutFEM) [10] and discrete extension operators (AgFEM) [11].CutFEM has been successfully applied to several topology optimisation problems, including those involving linear elasticity, fluid flow, and acoustics [13,14,15].

4In recent work by Berggren [16], a shape calculus for unfitted discretisations was proposed based on the concept of boundary-face dilation.This can be regarded as a discretise-then-differentiate approach because it directly relies on parameterising the dilated region under a perturbation of a continuous and piecewise linear level-set function.Using this technique, Berggren [16] rigorously derived the directional shape derivatives for general volume and surface integrals in two and three dimensions, and provided the minimum regularity requirements for these results.One of the underlying assumptions of Berggren's work is that the fictitious domain is entirely enclosed in the background domain.Although this situation is common in unfitted finite element methods [e.g., 10], it is less standard in general topology optimisation problems where boundary conditions are typically applied on subsets of the boundary of the background domain.In this work, we therefore consider the extension of the results given by Berggren [16] to the case where the domain boundary intersects the background domain boundary.In addition, we derive the directional shape derivative for general flux integrals.

5The derivation of first-and second-order shape derivatives is difficult and error-prone.To this end, automatic shape differentiation, which is the application of automatic differentiation techniques to shape derivatives, has been proposed in the literature to help reduce this burden [17,18,19,20].These techniques have now been implemented in several software packages [e.g., 21,22].The conventional methodology relies on deformations of a mesh to propagate dual numbers through the desired integrals.Although the conventional automatic shape differentiation discussed above has been successfully applied to several topology optimisation problems in the aforementioned work, it relies on having a body-fitted mesh throughout the optimisation procedure.Naturally, this poses the question of whether shape derivatives can be recovered in the context of unfitted discretisations and to what level of precision.

6The automatic shape differentiation for unfitted discretisations was first proposed by Mallon et al. [23].They proposed the use of forward-mode differentiation to automatically compute shape derivatives as perturbations of a level-set function.However, it is not clear how the derivatives computed in their work relate to the analytic shape derivatives [e.g., 8] or the directional shape derivatives in [16].In this work, we further develop the mathematics behind automatic differentiation for unfitted discretisations and link it to the directional derivatives in [16].We will show that the results given by Berggren [16] can be recovered to machine precision regardless of mesh size.The developed unfitted automatic shape differentiation techniques can be used to avoid computing complicated mesh-related quantities that appear in directional derivatives of surface integrals.In addition, the technique can also compute derivatives of expressions for which there is not yet a rigorous mathematical counterpart in the framework of Berggren [16] (e.g., shape Hessians).

7We implement the analytic directional shape derivatives in [16] and automatic shape differentiation for unfitted discretisations in the Julia package GridapTopOpt [9] and the wider Gridappackage ecosystem [24,25].GridapTopOpt provides efficient implementations of Céa's method [26] (also known as the adjoint method) for differentiating functionals that depend on the solutions to PDEs.As a result, our implementation can be used to solve general PDE-constrained optimisation problems with a syntax that is near one-to-one with the mathematical notation.In addition, we leverage GridapDistributed [27] to implement analytic derivatives, automatic shape differentiation, and unfitted evolution and reinitialisation in both serial and memory-distributed computing frameworks.These extensions of GridapTopOpt [9] allow us to solve an even wider range of problems on unstructured background triangulations.In addition, compatibility of our framework within the Gridap package ecosystem makes it possible to solve a significant number of cutting-edge topology optimisation problems involving complicated physical phenomena such as those posed on non-standard function spaces such as H(div) and H(curl).

8To demonstrate the applicability of the unfitted automatic shape differentiation framework, we consider two example optimisation problems.In the first, we consider the minimum compliance optimisation of a three-dimensional linear elastic wheel.In the second problem, we consider topology optimisation of a three-dimensional linear elastic structure in a fluid-structure interaction problem with Stokes flow.We solve both computational examples in a memory-distributed manner using a ghost penalty stabilisation [28].Note that the computational framework and theoretical results given in Section 2 and 3 can be readily applied to other unfitted finite element methods.

9The remainder of the paper is as follows.In Section 2, we recall the main results given in [16] and extend them to the cases mentioned above.In Section 3, we discuss automatic differentiation for unfitted discretisations and compare the results to those in Section 2. In Section 4, we discuss the implementation of unfitted level-set topology optimisation.In Section 5, we give two example results computed using the unfitted framework.Finally, in Section 6 we present our concluding remarks.

Notation and previous results

10In the following, we recall the notation and main results of Berggren [16].We refer to this work and references therein for further discussion of shape calculus in the context of unfitted discretisations.For the purpose of restating these results, we assume that the unfitted domain does not intersect the boundary of the background domain.

11Suppose that we consider a background domain D ⊂ R d with a symplectic triangulation T h .We use S h to denote the faces of the triangulation and E h to denote the subfaces.We define a level-set function ϕ ∈ W h , where W h = {v ∈ C 0 ( Ω) : v| K ∈ P 1 (K), ∀K ∈ S h }, with the property that ϕ partitions D in the standard manner:

12We now consider perturbations of Ω under variations of ϕ.Namely, we consider domains

13under perturbations

14where t ≥ 0 and w is a Lagrangian basis function for W h .Finally, we define the perturbed region E t = Ω \ Ωt .Parameterising this domain is a fundamental ingredient in formulating the directional semiderivatives in [16].Note that the semiderivatives are one-sided derivatives that coincide under certain assumptions discussed below.Before we state the main theorems in [16], we recall the following assumptions:

15Assumption 1.There is a t max > 0 such that for each K ∈ T h , if ∂Ω t ∩ K is either empty or non-empty for some t ∈ (0, t max ], it has the same property for each t ∈ (0, t max ].

16Assumption 2. The boundary ∂Ω does not intersect any mesh points of the triangulation T h .

17The first assumption ensures that E t has a unique parameterisation while the second ensures agreement of semiderivatives in the limits t → 0 + and t → 0 − .Theorem 1 (Berggren [16]).Under the perturbation in Equation (3), the directional semiderivative of volume integral

18for f ∈ C 0 ( Th ), satisfies

19Figure 1: An illustration of geometric quantities required for the resolution of Equation ( 7) in two dimensions (Fig. a) and three dimensions (Fig. b) where K 1 and K 2 are two neighbouring elements of T h that are cut by the interface, S = K1 ∩ K2 is the facet shared by K 1 and K 2 , n 1 is the normal to S in the direction of K 2 and similarly for n 2 , n ∂Ω τ ∩K k is the outward normal restricted to ∂Ω τ ∩ K k , t S k is the tangent to ∂Ω τ ∩ S , and m k is the co-normal defined by (i) If Assumption 1 is violated, then f and ∂ n ϕ are the limits of these functions from the interior of Ω whenever these quantities possess jump discontinuities on ∂Ω.

20(ii) If Assumption 1 is satisfied, the semiderivatives t → 0 − and t → 0 + agree.

21Theorem 2 (Berggren [16]).Consider the perturbation in Equation (3) according to Assumption 1 of a domain respecting Assumption 2. The semiderivative of boundary integral

22where n S is a unit vector located in S , outward-directed from Ω, and orthogonal to ∂Ω ∩ S for d = 3.Moreover,

23Here, m k is the co-normal for τ = 0 defined by Equation (8), and f k is the limit f on S defined by f k

24In the above, n is the outward normal of ∂Ω, m k is the co-normal defined by for τ ∈ [0, t], where t S k is the tangent to ∂Ω τ ∩ S for S ∈ S h and n ∂Ω τ ∩K k is the outward normal restricted to ∂Ω τ ∩ K k .An illustration of these quantities is given in Figure 1 and a detailed discussion can be found in [16].

Extension to non-empty intersections of ∂Ω and ∂D

25Let us now consider an extension to the case where ∂Ω has a non-empty intersection with ∂D as shown in Figure (2).

26The result of Theorem 1 and the related results in [16] remain unchanged for the non-empty intersections considered here.This is because the computation in these results is performed locally on each element K ∈ T h and does not require information from adjacent elements.This is quite different from the situation in Theorem 2, where the jump of quantities over element interfaces is required.In particular, Lemma 6.10 from [16] must be extended as follows: Lemma 1.Let t ∈ (0, t max ] according to Assumption 1 and consider the perturbation in Equation

27In addition, suppose that we have non-empty ∂Ω ∩ ∂D.Then, we have

28Proof.For the case where ∂Ω ∩ ∂D is empty, the proof is as in Lemma 6.10.from [16].

29For the case of non-empty ∂Ω ∩ ∂D, we assume that E t = Ω \ Ω t is nonempty and denote cells K ∈ T h with faces S ∈ S h .Integrating (∇ • Θ) f on E t ∩ K by parts gives

30and summing the resulting terms yields

31When E t ∩ ∂D is empty, the last term of Equation (11) vanishes and the remaining terms are as in Equation (6.32) from [16], so the proof is complete.

32For non-empty E t ∩∂D, application of Lemma 6.9 from [16] to the last two integrals in Equation ( 11) gives

33For Equation ( 12) we have

34by Equation (6.34) from [16].On the other hand, for Equation ( 13) the term f n• Θ is single valued and has no jump.This is the same case for t S .As a result, we have

35where we use that n = t S × n S and properties of the triple product in the first and second equalities, respectively.Substituting Equations ( 14) and ( 15) into Equations ( 12) and ( 13), and substituting the result into Equation ( 11) completes the proof.

36The extension of Theorem 2 to the case of non-empty ∂Ω ∩ ∂D is then as follows: Theorem 3. Consider the perturbation in Equation (3) according to Assumption 1 of a domain respecting Assumption 2. Suppose in addition that we have non-empty ∂Ω∩∂D.The semiderivative of Equation (6)

37Using Lemma 1, the proof of the extension in Theorem 3 is analogous to the one given in [16].Note that assumption 2 restricts the analysis to the case that Ω is not part of ∂D, namely ϕ(x) 0 on ∂D, except for measure-zero intersections (i.e., point intersections for d = 2 or surface intersections for d = 3).

Directional derivative of flux integrals

38The following result considers the directional derivative of flux integrals of the form

39These are necessary for problems involving loads over ∂Ω (e.g., fluid-structure interaction).

40Lemma 2. Consider the perturbation in Equation (3) according to Assumption 1 of a domain respecting Assumption 2 and where the intersection ∂Ω ∩ ∂D is empty.The semiderivative of Equation ( 17)

41Proof.Since f ∈ C 1 Th d and the intersection ∂Ω ∩ ∂D is empty, Equation ( 17) can be rewritten using the divergence theorem as

42Application of Theorem 1 yields the desired result.

43Remark 1.We note that extension of this result to the case of non-empty ∂Ω ∩ ∂D as well as more general integrands (e.g., g(n)) requires further mathematical development.The latter has been considered in the context of domain transformations [e.g., 29], however, the analog in the framework of [16] is not immediately clear.

Automatic differentiation

44In this section, we consider automatic differentiation for unfitted discretisations.We first recall some basic properties of dual numbers.Then we consider how dual numbers propagate through quadrature for unfitted discretisations and verify that we exactly recover the semiderivatives from the previous section.

Dual numbers

45Forward-mode automatic differentiation, in which the function and its derivative are computed concurrently, is based on the properties of dual numbers to evaluate derivatives exactly [30].A dual number is defined as a + bε with the property ε 2 = 0.As a result, the Taylor series of a differentiable function f (a + bε) about a is

46where the higher order terms vanish thanks to ε 2 = 0.This allows us to recover the derivative of f exactly via the dual component of f (a + bε).

Automatic differentiation for unfitted discretisations

47We now demonstrate how dual numbers propagate through quadrature on a cut triangulation.In particular, we consider piecewise linear cuts defined via a level-set function (e.g., Figure 3).

48Consider the functional

49where, for the purpose of this demonstration, we let Ω(ϕ) ⊂ D ⊂ R 2 as in Figure 3, and f is sufficiently differentiable.Suppose that we generate a fully-symplectic subtriangulation of the background mesh T h at the interface defined by ϕ(x) = 0.This can be accomplished using the algorithms described in [10] and the references therein.We denote this subtriangulation as IN where Ω h,CUT and Ω h,IN are the simplices that include the interface (ϕ(x) = 0) and the bulk (ϕ(x) < 0), respectively.Figure 3 shows an example visualisation of this subtriangulation.Finally, we let K(ϕ) ∈ Ω h,CUT and K ∈ Ω h,IN denote a cut subcell and bulk element, respectively.We assume Assumption 1 and 2 are satisfied, as such the topology of Ω h,CUT and Ω h,IN are invariant under small perturbations of ϕ while the geometry of elements of Ω h,CUT can vary, hence the notational dependence of K(ϕ) ∈ Ω h,CUT .

50The functional J 1 can now be rewritten as

51(1, 0) (0, 0) Figure 4: A visualisation of the map T ϕ : K → K(ϕ) from the reference element K to a cut subcell K(ϕ).The intersection points v 1 (ϕ) and v 2 (ϕ) of the cut subcell are computed using ϕ(q 1 ), ϕ(q 2 ), and ϕ(q 3 ) via interpolation.

52Let us focus our attention on the integral over K(ϕ) and assume without loss of generality that the element is cut as in Figure 4.In addition, suppose that we have T ϕ : K → K(ϕ) that maps the first-order reference element to the cut subcell.For the cut subcell in Figure 4, the mapping T ϕ is defined as

53where q 1 = (x q 1 , y q 1 ) and J K(ϕ) is the Jacobian of T defined as

54The above coordinates v 1 and v 2 depend on ϕ via the following interpolants

55At this point, our map T ϕ is well defined and we can proceed with our quadrature rule:

56Thus, our original functional J 1 can be written as

57where the latter integral has been rewritten using a standard quadrature rule.Now that the dependence of the quadrature rule in Equation ( 28) on ϕ is well defined, we can consider computing the directional derivative of J 1 with respect to ϕ in the direction w using dual numbers.Let F(s) = J 1 (ϕ + sw) and consider the Taylor series of F(t + ε) about t = 0. Equation (20) gives

58In terms of J 1 this becomes

59where the last equality is purely notational.Thus, we recover the directional derivative as the dual component of J 1 (ϕ + εw).Importantly, we capture the change in shape due to the propagation of dual numbers through the map T ϕ and its Jacobian |J K(ϕ) | .

60From an algorithmic point of view, computing the derivative using automatic differentiation can be summarised as follows:

611. Construct the dual numbers corresponding to the level-set values at each node (i.e., replace ϕ i by ϕ i + ε i where ε i is the corresponding dual number at node i).

622. Compute the nodal coordinates of the cut subcells using ϕ i + ε i in Equation ( 25) and ( 26).

633. Construct the map T ϕ i +ε i and the corresponding Jacobian J K(ϕ i +ε i ) .

644. Compute the integral using the quadrature rule in Equation ( 28) and assemble the vector of dual components.

65Remark 2. Note that the above demonstrative example is verbatim for the case of J 2 and J 3 in Equation ( 6) and (17), respectively, with the exception that the normal in J 3 should be calculated using the nodal coordinates resulting from Step (2) of the above summary.This ensures that the dual numbers are propagated correctly in the calculation of the normal vector.

66Remark 3. We further note that, among other things, the above technique can also be used to evaluate derivatives of functionals that depend on additional fields (e.g., solutions to finite element problems) or whose rigorous mathematical counterpart is not yet known.For example,

67For functionals that depend on the solutions to PDEs, Céa's method can be utilised [26].

Implementation

68We implement the analytic directional derivatives discussed in Section 2 and automatic differentiation methods discussed above in the Julia package GridapTopOpt [9] using the machinery provided by GridapEmbedded [31] and Gridap [24,25].GridapEmbedded provides algorithms and abstract methods for computation on subtriangulations, while Gridap provides the underlying finite element method.We leverage GridapDistributed [27] to implement both the analytic derivatives and automatic differentiation for unfitted discretisations in both serial and distributed computing frameworks.The latter readily follows from the serial implementation, as all computation is cell-wise.As such, the serial implementation can be mapped over each local partition.

69It should be noted that for shape differentiation of functionals that depend on the solutions to PDEs, Céa's method [26] is utilised in conjunction with automatic shape differentiation.We refer the reader to Section 2.6 of Wegert et al. [9] for further discussion.

Verification

70In this section, we verify that automatic differentiation for unfitted discretisations can exactly compute their analytic counterparts.To show this, we consider the four level-set functions shown in Figure 5.

71Table 1 shows the results when comparing the analytic expressions, automatic differentiation, and finite differences.These demonstrate that the derivatives computed using the exact expressions from Section 2 exactly correspond to the derivatives computed using automatic differentiation.This correspondence is to within machine precision regardless of mesh size because the exact expressions in Section 2 are derived using a discretise-then-differentiate approach.

72The implementation discussed in Section 3.3 can also be leveraged for computation of shape Hessians for unfitted discretisations.For example, we computed the Hessian of F(ϕ) = ∂Ω(ϕ) ∥n − n g ∥ 2 ds using automatic differentiation and finite differences and found that the absolute error was 1.85 × 10 −5 .This suggests an interesting avenue of mathematical development for the analytic methods proposed in [16].

73Table 1: Verification of directional derivatives resulting from automatic differentiation against the exact expressions from Section 2 and finite differences.In the above, we take f (x, y) = cos(x + y) and g(n) = ∥n − n g ∥ 2 with n g = ∇g ∥∇g∥ and g(x, y) = x − 1 10 sin πy 3 .The latter is based on an expression in [Sec.6.3., 29].Note that we use 'N/A' for directional derivatives that cannot readily be calculated analytically.

Level-set topology optimisation

74In the following, we discuss our implementation of level set-based topology optimisation in the framework of unfitted finite elements.

Boundary evolution

75In this work, we use the approach proposed by Burman et al. [10] to update the level-set function.Namely, we evolve the level-set function by solving a transport equation

76where β is a velocity field.In this work β is computed as β = ng Ω , where g Ω is the regularised sensitivity resulting from the Hilbertian extension-regularisation approach [4].This approach projects a directional derivative dJ(ϕ; w) of a functional J(ϕ), computed using the approaches in Section 2 and 3, onto a Hilbert space H on D, typically with additional regularity.This involves solving an identification problem [4]:

77where ⟨•, •⟩ H is the inner product on H.

78In addition to naturally extending the sensitivity from ∂Ω onto the bounding domain D with H-regularity, this approach also ensures that the solution g Ω is a descent direction for J(Ω).

79The transport equation in Equation ( 32) is solved using an interior penalty approach and Crank-Nicolson for the discretisation in time [13,32,33].The weak formulation of this problem is:

80where S h is the set of interior mesh facets, h F is the average element diameters of the elements sharing a facet, n F is the normal to the facet F, v = v + − v − is the jump in a function v over the facet F, and c e is a stabilisation coefficient.

81We include |n F • β| in the interior penalty term as proposed by Burman and Fernández [33].In the context of topology optimisation, this ensures that non-designable regions with β = 0 are not locally over-stabilised by the interior penalty term.The example in Figure 6 shows the evolution of an interface towards a non-designable region highlighted in grey with (green) and without (red) the |n F • β| term.This shows that when the velocity magnitude is not included the interface will encroach into the non-designable domain, and this will continue over the entire evolution process.Note that this term was omitted from the formulation in [13,32], likely because non-designable regions were not considered.

82In our numerical examples, we take the stabilisation coefficient to be c e = 0.01.

Reinitialisation

83Evolution of the boundary described above requires that the level-set function ϕ has wellbehaved gradients.This is usually achieved by reinitialising ϕ to be an approximation of the signed distance function [34] given by

84where d(x, ∂Ω) := min p∈∂Ω |x − p| is the minimum distance from x to the boundary ∂Ω.

85To achieve this, we solve the reinitialisation equation [34,35] given by

86We solve this problem to steady state using an approach based on the one proposed by Mallon et al. [23].The weak formulation for this problem is given as:

87where w = sign(ϕ 0 ) ∇ϕ ∥∇ϕ∥ , γ d is the surface penalty coefficient that we set to 20, and h is the element size.

88In the above, the first term comes from multiplying Equation ( 36) by a test function and integrating over D, while the second term is a surface penalty term to reduce boundary movement under reinitialisation.The final term stabilises the finite element discretisation using an artificial viscosity given by

89where h is the element diameter and c r,1 is a stabilisation coefficient.In our examples, we take c r,1 = 0.5.The above is then solved using Picard iterations, namely w is considered constant when computing the Jacobian in Newton-Raphson.

90In our testing, we found that approximating the sign function with

91as proposed in [35], provides better convergence.In addition, we also considered replacing the artificial viscosity with a continuous interior penalty term, as this is more consistent with the strong formulation.This is given by

92where c r,2 is a different stabilisation coefficient.We generally found that this provides better results than an artificial viscosity term, but requires that the initial level-set function ϕ 0 is closer to a signed distance function for convergence.As such, for the results presented below, we solve the reinitialisation problem using the artificial viscosity term given by Equation (38).In future work, further exploration of these approaches will be considered.

Isolated volume tagging

93Isolated volumes of a domain Ω ⊂ D are regions of that domain within which solution fields are not sufficiently constrained (i.e., disconnected from all boundaries that have Dirichlet boundary conditions).In conventional level-set methods, where the void phase D \ Ω is filled with a weak ersatz material [e.g., 8, 4], this situation is naturally remedied because the isolated volumes are connected by ersatz material and therefore fields are well constrained.Since we do not introduce such an approximation, the differential operator over disconnected volumes has a non-trivial kernel.As a result, the matrices resulting from a discretisation (e.g., finite element method) are singular.

94To remedy this situation, Villanueva and Maute [14] proposed constructing an indicator function by solving a thermal convection problem on Ω with heat dissipating towards a value of zero in regions connected to Dirichlet boundaries and accumulating to a desired value in isolated regions.A smoothed Heaviside function was then used to construct a binary indicator.However, in our tests, we found that this method fails to distinguish between volumes that are separated by a single cell layer.In these cases, the degrees of freedom within the two volumes are "connected" through the ghost penalty term required by the CutFEM formulation.

95In this work, we propose a novel graph-based approach to detect isolated volumes as described below.This method relies on the creation of a conforming connectivity graph for the cut mesh, followed by a graph-colouring algorithm.We then mark all regions that are connected to the relevant Dirichlet boundaries.The negation of this map then identifies the isolated volumes.

96Once isolated volumes are identified, we follow the approach in [14].Namely, for a generic weak formulation a(u, v) = l(v) over Ω with a non-trivial kernel owing to disconnected volumes marked by ψ, we add a penalty term

97This constrains the average of u to be zero in the regions marked by ψ.Concrete examples of this will be given in Section 5.

Generating the graph

98The first step is to construct a connectivity graph for the cut mesh, where each vertex corresponds to a cell within the mesh.The graph must be conforming, in the sense that two vertices are connected if and only if their associated cells share a face.

99Conforming meshes are generally not produced by typical cutting algorithms such as Delaunay or marching cubes, where cells are split locally without ensuring global mesh conformity.In twodimensional settings, the meshes produced will always be conforming because two cells that share a cut edge will always split that edge in the same way.However, in three dimensions two cells sharing a cut face might generate non-matching sub-faces on the shared boundary (see Figure 7).Generating a conforming mesh composed solely of tetrahedra and hexahedra for a complex cut geometry, particularly in higher dimensions, is generally challenging.This challenge motivates the development and use of embedded boundary methods, which do not require a conforming mesh.Therefore, the sub-triangulated cut mesh typically used for numerical integration cannot be directly employed to generate this conforming connectivity graph.

100Instead, we generate an auxiliary cut mesh, where cut cells are split into general polytopes or polyhedra.The resulting mesh is conforming, regardless of dimension.To create polytopal cuts, we adopt the framework proposed in [36] and adapt the algorithms and their implementation in STLCutters.jl [37] for the case where the nodal values of the level set functions determine cuts.The result is the required conforming graph G, see Figure 8.

Colouring the graph

101The next step involves creating a colouring for the graph G, where each colour corresponds to a distinct disconnected volume.This is done by successfully applying a Breadth-First-Search (BFS) algorithm to colour connected parts of the graph that share the same IN/OUT state.Algorithms 1 and 2 detail the procedures used to colour the whole graph and each individual volume, respectively.

102In the context of distributed meshes, each processor p only stores a local portion of the graph, denoted G p .Colouring each local graph partition G p locally (independently) is insufficient to reliably identify the global isolated volumes.Specifically, a single volume might span multiple processor domains but only be adjacent to constraining boundaries (e.g., Dirichlet boundaries) within a subset of these domains.In the worst-case scenario, a volume could theoretically span all processor domains within the communicator, while the relevant constraining boundaries reside in only a single processor's domain (see Figure 9).This information has to be propagated to all processors that share the volume, which is inevitably a global operation.

103A global volume colouring algorithm is therefore required.This is done in two steps: First, we use Algorithm 1 in each processor p to create a local colouring of G p .For each local volume, we then locally collect a) all neighbouring processors sharing this volume and b) the local colour ID of the volume within the neighbouring processor.This can be done through (relatively) inexpensive neighbour-to-neighbour communications, typical within an FEM context.Finally, this local information is gathered within a single processor that uses it to create a global numbering.The global colouring is then scattered back to all processors.

Algorithm 1 ColourGraph(G,S)

104Input:

1051: G: Adjacency graph:

1063: C: Final colour assignment for each cell, where each colour identifies a connected component within a group.4: S c : Mapping from final colour index to its state.Append!(S c , state(v))

10713:

108Call ColourVolume(v, nc, G, S , C) ▷ Propagate colour through volume.6: Modifies C in place, stops when all connected vertices to v 0 that share the same state have been coloured.

1097:

110for all u in neighbours(v) do ▷ Enqueue neighbours 3: C = {C p , g C }: Global colouring for each cell 4: S c : Mapping from each local colour to its state.

1115:

Examples

112In this section, we consider two examples that make use of the automatic differentiation techniques and the isolated volume algorithm discussed above.The first example is topology optimisation of a three-dimensional linear elastic wheel and the second is topology optimisation of the elastic part in a fluid-structure interaction problem.

Elastic wheel 5.1.1. Formulation

113In this section, we consider the minimum compliance optimisation of a three-dimensional linear elastic wheel.

114The formulation of this problem is similar to the two-dimensional wheel considered in [13].Figure 10a shows the background domain D and the boundary conditions for this problem.We apply a homogeneous Dirichlet boundary condition to the outer shell and a non-homogeneous Neumann boundary condition g(x, y, z) = 100(−y, x, 0) to the inner shell.The strong formulation of this problem is given by

115where

116) is the strain tensor, and λ = 0.5769 and µ = 0.3846 are the Lamé constants of the material.To avoid ill-conditioning of the system resulting from the finite element discretisation of Equation ( 42), we use CutFEM as described in [13] and references therein.In particular, the weak formulation of this problem is:

117where

118In the above, T G is known as the ghost skeleton and defined in [10] as follows: for distinct elements K 1 ∈ S h and K 2 ∈ S h , a facet F ∈ T G is given by F = K 1 ∩ K 2 where at least one of K 1 or K 2 intersect the interface.In addition, the operation : denotes double contraction, a(d, s) is the standard bilinear form for elasticity, k ψ (d, s) enforces zero displacement within the isolated volume marked by ψ (see Section 4.3), and j(d, s) is the ghost penalty stabilisation term discussed in [13] with stabilisation parameter γ = 10 −7 .Finally, we replace the test space T and trial space R with discrete spaces of continuous piecewise-linear vector fields denoted T h and R h , respectively.

119The optimisation problem is then min

120where C(ϕ) Vol(Ω(ϕ)) − V f Vol(D) with Vol(Ω(ϕ)) = Ω(ϕ) 1 dx and similarly for Vol(D), and V f = 0.4 is the required volume fraction.

121The above is implemented using GridapTopOpt v0.2.0 [9].Note that because Gridap and GridapTopOpt allow the user to specify arbitrary weak formulations and optimisation problems, other unfitted approaches, such as the finite cell method [38], can also readily be used.

Results

122We solve the optimisation problem in Equation (48) using augmented Lagrangian method [39] as described by Wegert et al. [9] with initial structure shown in Figure 10b.We use the automatic differentiation techniques discussed in Section 3 along with Céa's method [26] as provided by Gri-dapTopOpt [9] to compute all derivatives.We generate the symplectic background triangulation D using Gmsh [40] and load the resulting triangulation using GridapGmsh [41].The resulting mesh has roughly 1.32M elements and 219K nodes.We partition the background triangulation into 48 parts and solve the optimisation problem in an efficient memory-distributed framework using 48 processors.For a detailed review of the techniques used to improve computational efficiency we refer the reader to Badia and Verdugo [24], Badia et al. [27], and Wegert et al. [9].To solve the Hilbertian extension-regularisation problem (Equation 33) we use an algebraic multigrid preconditioned conjugate gradient method as outlined in [9].We use SuperLU DIST [42,43,44] to solve the state equation for elasticity, the transport equation, and the reinitialisation equation.In the future, we will investigate iterative methods for solving these problems at larger scales.

123Figure 11 shows visualisations of intermediate structures and the final structure, while Figure 12 gives the iteration history of the objective and volume constraint.The average iteration time is approximately 4 minutes.This could be significantly improved in future using scalable iterative solvers for the linear systems resulting from the finite element discretisation.In addition, the number of iterations required to reach convergence could be reduced by using a more advanced optimiser such as a projection/null-space method [45,46].

124The results demonstrate that using the unfitted approaches for level-set evolution and reinitialisation, we are able to solve topology optimisation problems on unstructured background domains using the automatic differentiation techniques discussed in Section 3.

Fluid-structure interaction 5.2.1. Formulation

125In this section, we consider topology optimisation of a linear elastic structure in a fluidstructure interaction problem with Stokes flow.We assume that the displacement of the elastic structure is small, so that the coupling in the fluid-structure problem is one way.This allows the fluid and elastic problems to be de-coupled so that they can be solved in a sequential manner.We will refer to these as staggered problems.

126Figure 13 shows the background domain and boundary conditions for this problem.The region shown in grey is a non-designable region.This setup is similar to the one in [47].The strong formulation of the Stokes flow is

127while the strong formulation governing the linear elastic structure is

128where Ω out (ϕ) = D \ Ω(ϕ) is the fluid domain, µ f is the viscosity of the flow, p is the pressure, u d = ye 1 is the in-flow on Γ f,D , and σ f (u, p) = 2µ f ε(u) − pI is the stress tensor for the fluid.The system above has one-way coupling as only the surface traction term in Equation 50 depends on the normal stress imparted by the fluid on Γ(ϕ).

129For the Stokes flow problem, we use the stabilised Nitsche fictitious domain method and a face ghost-penalty stabilisation as detailed in [10] with continuous piecewise linear elements for the velocities and piecewise constant elements for the pressures.For the linear elastic problem, we use the same approach as in Section 5.1.The weak formulations are given by:

130are the trial and test spaces for the velocity field, and Q = L 2 (Ω) is pressure space.

131Weak form 6. For Ω(ϕ) ⊂ D and (u, p)

132with a(d, s), k(d, s), and j(d, s) as in Equation ( 44), (46), and (47), and

133where T = {d ∈ [H 1 (Ω(ϕ))] 3 : d| Γ s,D = 0}.

134In Weak form 5, the inclusion of 1 − ψ s in l s ensures that isolated volumes of the solid phase have zero displacement, γ N = 100 is the Nitsche parameter, j f,u (u, v) is the ghost penalty term with stabilisation parameter γ u = 0.1, j f,p (p, q) is the symmetric pressure stabilisation for piecewise constant pressures with stabilisation parameter γ p = 0.25, and j f,ψ (p, q) enforces an average pressure in isolated volumes of Ω out (ϕ) marked by ψ f .The optimisation problem is then given by min

135where C(ϕ) is the volume constraint as previously with V f = 0.06.It should be noted that isolated volumes in the solid phase obstruct fluid flow due to the no-slip boundary conditions at the interface.As a result, these can artificially improve the objective.We therefore augment the minimum compliance objective with a term that penalises isolated volumes in the solid phase with a penalisation constant of c = 1000.This ensures that isolated volumes in the solid phase are removed.Note that when no isolated volumes are present, the objective reduces to minimum compliance.

136To compute derivatives of J with respect to ϕ, we develop an adjoint method for staggered problems based on Céa's method [26] and implement this in GridapTopOpt [9].This is given in Appendix A for general staggered problems of size k.Our particular example corresponds to the case k = 2. Incorporating additional physics (e.g., thermostatics) increases the size of the staggered system.

Results

137To solve the optimisation problem in Equation (59) we again use the augmented Lagrangian method.In addition, we generate an unstructured symplectic background triangulation with refinement in the region around the non-designable region to improve accuracy of the solutions near the interface of the elastic structure.The non-refined region has a maximum element size of 0.05 while the refined region has a maximum element size of 0.015.In addition, we use symmetry to halve the computational domain.As a result, the background triangulation has roughly 824K elements and 129K nodes.We partition the background triangulation into 48 parts and solve the optimisation problem in a memory-distributed framework using 48 processors.We use SuperLU DIST [42,43,44] to solve all linear systems in parallel.

138Figure 14 show visualisations of the initial structure, intermediate structures, and the final structure, while Figure 15 gives the iteration history of the objective and volume constraint.The average iteration time is approximately 8.5 minutes.As with the previous example, this could be significantly improved in future by using scalable iterative solvers and the number of iterations required to reach convergence could be reduced by using a more advanced optimiser.

139These results demonstrate that automatic shape differentiation for unfitted discretisations can be used to solve more complicated multi-physics problems, thereby avoiding the difficult and error-prone calculation of shape derivatives.In addition, the unfitted finite element allows us to accurately represent the boundary condition for the flow field.

Conclusions

140In this paper, we extended the shape calculus results developed in [16] to the case where the domain boundary intersects the background domain boundary and linked these theoretical results to automatic shape differentiation for unfitted discretisations.We implemented analytic directional shape derivatives and unfitted automatic shape differentiation in the Julia package GridapTopOpt [9] and showed that the analytic directional shape derivatives given by Berggren [16] and the extensions considered in this work can be recovered to machine precision regardless of mesh size.We proposed that unfitted automatic shape differentiation can be used to avoid computing intricate mesh-related quantities that appear in directional derivatives of surface integrals.Furthermore, automatic shape differentiation can compute derivatives of expressions for which there is not yet a rigorous mathematical counterpart in the framework of Berggren [16], such as shape Hessians.We showed that our implementation readily captures the shape Hessian and again verified the result with finite differences.Our implementation in GridapTopOpt and the wider Gridap ecosystem is general and can be executed in both serial and distributed computing frameworks to solve arbitrary PDE-constrained optimisation problems using unfitted finite elements.We propose a novel graph-based approach to detect isolated volumes using a conforming connectivity graph for the cut mesh and a graphcolouring algorithm.These extensions allow GridapTopOpt to solve an even wider range of problems on unstructured background triangulations.Furthermore, by utilising unfitted methods, we avoid issues that arise from smoothing the material properties across the interface, thus providing higher accuracy solutions.To demonstrate the applicability of the unfitted automatic shape differentiation framework and our implementation, we considered two example optimisation problems: minimum compliance optimisation of a three-dimensional linear elastic wheel; and topology optimisation of a three-dimensional linear elastic structure in a fluid-structure interaction problem with Stokes flow.We solved these problems using CutFEM and distributed the computation over a computing cluster.We avoided computation of all analytic directional shape derivatives by leveraging the automatic shape differentiation techniques developed in this work.

141In the future, we plan to extend the framework to multi-material problems involving several level-set functions and improve the scalability of algorithms by leveraging matrix-free methods.

Declaration of Competing Interest

142The authors have no competing interests to declare that are relevant to the content of this article.

143where we have used the chainrule.The last two expressions vanish due to the stationarity of Equations (A.6) and (A.8).As we recover the J from L in Equation (A.5), we have dJ(ϕ; ψ) = ∂ ϕ J(u 1 , . . ., u k , ϕ)(ψ) − k i=1 ∂ ϕ R i (u 1 , . . ., u i , λ i , ϕ)(ψ), (A.10)

144where we have written out the explicit dependence on fields u i and λ i .

145Figure 1: An illustration of geometric quantities required for the resolution of Equation (7) in two dimensions (Fig. a) and three dimensions (Fig. b) where K 1 and K 2 are two neighbouring elements of T h that are cut by the interface, S = K1 ∩ K2 is the facet shared by K 1 and K 2 , n 1 is the normal to S in the direction of K 2 and similarly for n 2 , n ∂Ω τ ∩K k is the outward normal restricted to ∂Ω τ ∩ K k , t S k is the tangent to ∂Ω τ ∩ S , and m k is the co-normal defined by m k = t S k × n ∂Ω τ ∩K k .In Figure (a) we use the convention that t S 1 = −e 3 and t S 2 = e 3 .(Adapted from [16])

Figure 2 :

146Figure 2: A visualisation of intersections between ∂Ω and ∂D considered in this work.

Figure 3 :

147Figure 3: An example subtriangulation of a domain Ω(ϕ) defined by ϕ(x) ≤ 0. The green cells, denoted Ω h,CUT (ϕ), are those that include the interface Γ(ϕ).The red cells, denoted Ω h,IN , are the remaining internal cells.

FΩ

148Fig.5a3.47×10−17 4.44×10 −10 Fig.5b7.81×10−18 2.09×10 −11 Fig.5c3.90×10−18 4.22×10 −11 Fig.5d1.73×10−18 7.04×10−12

Figure 5 :

149Figure 5: A visualisation of the geometries and discretisations used for validation of automatic differentiation

Figure 6 :

150Figure 6: The evolution of an interface visualised in Figure (a), (b), (c), and (d) towards a non-designable region highlighted in grey both with (green) and without (red) the |n F • β| term in the evolution equation (Equation34).In Figure(d) we overlay both curves on the right to show the slippage of the red interface into the non-designable region and the deviation from the green interface, which is particularly visible in the inset.We visualise the velocity field in purple that has been extended onto the background domain.

Figure 7 :

151Figure 7: Non-conforming cut meshes generated by Delaunay triangulation in 3D. Figure (a) shows the original mesh in black, given by two tetrahedra.The mesh is split through a plane, given by the red lines.Figure (b) shows the result of applying a Delaunay triangulation to both tetrahedra.The shared quadrilateral face is triangulated differently in each tetrahedra, creating a non-conforming edge (in red).

152Figure 7: Non-conforming cut meshes generated by Delaunay triangulation in 3D. Figure (a) shows the original mesh in black, given by two tetrahedra.The mesh is split through a plane, given by the red lines.Figure (b) shows the result of applying a Delaunay triangulation to both tetrahedra.The shared quadrilateral face is triangulated differently in each tetrahedra, creating a non-conforming edge (in red).

Figure 8 :

153Figure 8: Polytopal cut mesh for the example in Figure3.Note that, compared to the subtriangulated cut mesh, this mesh deals with cut cells using polytopes with an arbitrary number of faces.

Figure 9 :

154Figure 9: Colouring of a "snake" level set within a distributed background mesh.The background mesh is split between four processors.Processor boundaries are shown with black lines.The level set creates a single IN volume that loops around the whole background mesh while only being constrained by boundary conditions touching the boundary of the background mesh.Figure (a) shows the local colourings produced by each processor independently.Figure (b) shows the global colouring.

5 : 6 :

155Initialise C as an empty vector of size num vertices(G) 7: Initialise S c as an empty list 8: nc ← 0 9: for v in G do 10: if v not coloured then ▷ New volume found 11: nc ← nc + 1 12:

14 :

156return C, S c Algorithm 2 colourVolume(v 0 , c, G, S , C) Input: 1: v 0 : Starting vertex 2: c: Colour value to assign to this volume 3: G: Adjacency graph: neighbours(v) = G[v] 4: S : Array of vertex IN/OUT states: state(v) = S [v] 5: C: Array to vertex colours (output) Output:

Figure 10 :

157Figure 10: A visualisation of the setup for the minimum compliance optimisation of a three-dimensional linear elastic wheel.Figure (a) shows the background domain D and boundary conditions.The red boundary denotes a homogeneous Dirichlet boundary condition on Γ D , while the blue boundary denotes a nonhomogeneous Neumann boundary condition g(x, y, z) = 100(−y, x, 0) on Γ N .Figure (b) shows the initial domain Ω(ϕ 0 ).The inner and outer cylinders have a radii of 0.1 and 1, respectively, and the thickness of the wheel is 0.3.

Figure 11 :

158Figure 11: Visualisations of the intermediate structures (Fig. a -Fig.c) and the final optimised structure (Fig. d) for the elastic wheel problem.We outline the background domain using the black lines.

Figure 12 :Figure 13 :

159Figure 12: Iteration history of the objective (Fig. a) and volume constraint (Fig. b) for the elastic wheel problem.

Figure 14 :

160Figure 14: Visualisations of the initial structure (Fig. a), intermediate structures (Fig. b -Fig.e) and the final optimised structure (Fig. f) for the fluid-structure interaction problem. Figure (g) shows a visualisation of the velocity field and pressure field in the fluid.

Figure 15 :

161Figure 15: Iteration history of the objective (Fig. a) and volume constraint (Fig. b) for the fluid-structure interaction problem.

Zachary J Wegert :

162Writing -original draft, Writing -review and editing, Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization.Jordi Manyer: Writing -original draft, Writing -review & editing, Software, Methodology.Connor Mallon: Writing -review & editing, Supervision.Santiago Badia: Supervision, Writing -review & editing, Resources.Vivien J Challis: Supervision, Writing -review & editing, Conceptualization, Project administration, Funding acquisition, Resources.

참고문헌 43건

  1. CutFEM: Discretizing geometry and partial differential equations International Journal for Numerical Methods in Engineering · Wiley · 2014 10.1002/nme.4823
  2. Topology Optimization: Theory, Methods, and Applications 2011
  3. Generalized shape optimization without homogenization Structural Optimization · Springer Nature · 1992 10.1007/bf01742754
  4. Structural optimization using sensitivity analysis and a level-set method Journal of Computational Physics · Elsevier BV · 2003 10.1016/j.jcp.2003.09.032
  5. Topology optimization using the finite cell method Optimization and Engineering · Springer Science+Business Media · 2011 10.1007/s11081-011-9159-x
  6. Finite element methods with symmetric stabilization for the transient convection–diffusion–reaction equation Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2009 10.1016/j.cma.2009.02.011
  7. Optimal shape design as a material distribution problem Structural and Multidisciplinary Optimization · Springer Science+Business Media · 1989 10.1007/bf01650949
  8. Level Set Methods and Dynamic Implicit Surfaces Applied mathematical sciences · Springer Nature · 2003 10.1007/b98879
  9. A PDE-Based Fast Local Level Set Method Journal of Computational Physics · Elsevier BV · 1999 10.1006/jcph.1999.6345
  10. Gmsh: A 3‐D finite element mesh generator with built‐in pre‐ and post‐processing facilities International Journal for Numerical Methods in Engineering · Wiley · 2009 10.1002/nme.2579
  11. A level set method for structural topology optimization Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2002 10.1016/s0045-7825(02)00559-5
  12. SuperLU_DIST ACM Transactions on Mathematical Software · Association for Computing Machinery · 2003 10.1145/779359.779361
  13. A survey of structural and multidisciplinary continuum topology optimization: post 2000 Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2013 10.1007/s00158-013-0956-z
  14. Topology optimization approaches Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2013 10.1007/s00158-013-0978-6
  15. Conception optimale ou identification de formes, calcul rapide de la dérivée directionnelle de la fonction coût ESAIM Mathematical Modelling and Numerical Analysis · EDP Sciences · 1986 10.1051/m2an/1986200303711
  16. Geometric constraints for shape and topology optimization in architectural design Computational Mechanics · Springer Science+Business Media · 2017 10.1007/s00466-017-1383-6
  17. A cut finite element method for the Bernoulli free boundary value problem Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2016 10.1016/j.cma.2016.12.021
  18. Shape optimization using the cut finite element method Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2017 10.1016/j.cma.2017.09.005
  19. CutFEM topology optimization of 3D laminar incompressible flow problems Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2017 10.1016/j.cma.2017.03.007
  20. Acoustic shape optimization using cut finite elements International Journal for Numerical Methods in Engineering · Wiley · 2017 10.1002/nme.5621
  21. The aggregated unfitted finite element method for elliptic problems Computer Methods in Applied Mechanics and Engineering · Elsevier BV · 2018 10.1016/j.cma.2018.03.022
  22. Weak and Strong Form Shape Hessians and Their Automatic Generation SIAM Journal on Scientific Computing · Society for Industrial and Applied Mathematics · 2018 10.1137/16m1099972
  23. Efficient Numerical Solution of Geometric Inverse Problems Involving Maxwell's Equations Using Shape Derivatives and Automatic Code Generation SIAM Journal on Scientific Computing · Society for Industrial and Applied Mathematics · 2018 10.1137/16m110602x
  24. Automated shape differentiation in the Unified Form Language Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2019 10.1007/s00158-019-02281-z
  25. Null space gradient flows for constrained optimization with applications to shape optimization ESAIM Control Optimisation and Calculus of Variations · EDP Sciences · 2020 10.1051/cocv/2020015
  26. Automatic Differentiationin Machine Learning: a Survey MURAL - Maynooth University Research Archive Library (National University of Ireland, Maynooth) · National University of Ireland, Maynooth · 2018
  27. Topology optimization of thermal fluid–structure systems using body-fitted meshes and parallel computing Journal of Computational Physics · Elsevier BV · 2020 10.1016/j.jcp.2020.109574
  28. Shape and topology optimization Handbook of numerical analysis · Elsevier BV · 2020 10.1016/bs.hna.2020.10.004
  29. Gridap: An extensible Finite Element toolbox in Julia The Journal of Open Source Software · Open Journals · 2020 10.21105/joss.02520
  30. Fully and semi-automated shape differentiation in NGSolve Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2020 10.1007/s00158-020-02742-w
  31. The software design of Gridap: A Finite Element package based on the Julia JIT compiler Computer Physics Communications · Elsevier BV · 2022 10.1016/j.cpc.2022.108341
  32. Geometrical discretisations for unfitted finite elements on explicit boundary representations Journal of Computational Physics · Elsevier BV · 2022 10.1016/j.jcp.2022.111162
  33. Ghost penalty Comptes Rendus Mathématique · Elsevier BV · 2010 10.1016/j.crma.2010.10.006
  34. GridapDistributed: a massively parallel finite elementtoolbox in Julia The Journal of Open Source Software · Open Journals · 2022 10.21105/joss.04157
  35. Numerical Optimization 2006 10.1007/978-0-387-40065-5
  36. Newly Released Capabilities in the Distributed-Memory SuperLU Sparse Direct Solver ACM Transactions on Mathematical Software · Association for Computing Machinery · 2022 10.1145/3577197
  37. Stability and Conditioning of Immersed Finite Element Methods: Analysis and Remedies Archives of Computational Methods in Engineering · Springer Science+Business Media · 2023 10.1007/s11831-023-09913-0
  38. A Hilbertian projection method for constrained level set-based topology optimisation Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2023 10.1007/s00158-023-03663-0
  39. Shape calculus for fitted and unfitted discretizations: Domain transformations vs. boundary-face dilations Communications in Optimization Theory · 2023 10.23952/cot.2023.27
  40. Level set topology optimization with sparse automatic differentiation Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2024 10.1007/s00158-024-03894-9
  41. STLCutters.jl: A scalable geometrical framework library for unfitted finite element discretisations Computer Physics Communications · Elsevier BV · 2024 10.1016/j.cpc.2024.109479
  42. GridapTopOpt.jl: a scalable Julia toolbox for level set-based topology optimisation Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2025 10.1007/s00158-024-03927-3
  43. Neural Level Set Topology Optimization Using Unfitted Finite Elements International Journal for Numerical Methods in Engineering · Wiley · 2025 10.1002/nme.70004