betaFeedback

WorksPhysics and Astronomy

Hyperparameter-free minimum-lengthscale constraints for topology optimization

Abstract

The geometric constraints of Zhou et al. (2015) are a widely used technique in topology/freeform optimization to impose minimum lengthscales for manufacturability. However, its efficacy degrades as design binarization is increased, and it requires heuristic tuning of multiple hyperparameters. In this work, we derive analytical hyperparameters from first principles, depending only on the target lengthscale. We present results for both conic and PDE-based filtering schemes, showing that the latter is less robust due to the singularity of its underlying Green's function. To address this, we also introduce a double-filtering approach to obtain a well-behaved PDE-based filter. Combined with our derived hyperparameters, we obtain a straightforward strategy for enforcing lengthscales using geometric constraints, with minimal hyperparameter tuning. A key enabling factor is the recent subpixel-smooth projection (SSP) method (Hammond et al. 2025), which facilitates the rapidly-converging optimization of almost-everywhere binary designs. The effectiveness of our method is demonstrated for several photonics and heat-transfer inverse-design problems.

Introduction

For practical manufacturing purposes, designs generated via the topology optimization (TO) framework ([6] (Jensen and Sigmund 2011; Sigmund and Maute 2013)) (reviewed in § 2) must adhere to fabrication constraints; in particular, designs must typically comply with minimum linewidth and linespacing requirements. A popular technique in density-based TO for imposing these conditions is the geometric-constraints approach, introduced by Zhou et al. (2015) (reviewed in § 3). It consists of including two extra constraints into the TO problem: one that imposes a minimum lengthscale on the solid phase and another on the void phase. Both constraints are differentiable and inexpensive to compute, and thus well-suited for gradient-based optimization methods for large-scale nonlinear problems, such as the conservative convex separable approximation (CCSA) algorithm (Svanberg 2002). While this approach has proven successful in many works (Clausen et al. 2015b; Zhao et al. 2018; Wang et al. 2018; Giannini et al. 2020; Hammond et al. 2021, 2022b, 2023, 2022a; Ruan et al. 2022; Albrechtsen et al. 2022; Sang et al. 2022; Shang et al. 2023; Chen et al. 2024; Martinez de Aguirre Jokisch et al. [1]; Chen et al. [13]), it still has some unsatisfactory aspects. First, there is a delicate interplay between the binarization level of a design—controlled by a projection steepness hyperparameter β\beta, which is gradually increased during optimization—and the efficacy of the geometric constraints. The lengthscale of a design becomes meaningful only when the design is close to binary, hence the geometric constraints require a high β\beta to adequately impose minimum lengthscales. However, this presents a challenge, as standard binarization/projection schemes (Xu et al. 2010; Wang et al. 2011) suffer from ill-conditioning and slow convergence as binarization is increased (Hammond et al. 2025; Dunning and Wein 2025). Consequently, binarization must be limited by a heuristic choice of β\beta, hindering the effectiveness of the geometric constraints. Second, the constraints are controlled by several hyperparameters, and guidance on setting these hyperparameters is mostly empirical and subject to cumbersome problem-specific tuning. For example, to account for non-binary designs, the user must heuristically relax the geometric constraints by means of a threshold ϵ\epsilon, which is gradually decreased during optimization (see § 3). Recently, Hammond et al. introduced a new binarization technique, the subpixel-smoothed projection (SSP) (Hammond et al. 2025) (§ 2), capable of optimizing an almost-everywhere binary design (differentiable at β=∞\beta= \infty) while simultaneously overcoming the issue of slow convergence. Given this new SSP development, can one now revisit the existing geometric constraints algorithm, to obtain a simplified approach with improved performance and minimal reliance on heuristic hyperparameter tuning?

In this paper, we show that the existing geometric constraint algorithm can be greatly simplified and accelerated in conjunction with SSP binarization. In particular, given a desired minimum lengthscale to be imposed on the design, we can now theoretically justify specific choices for all geometric constraint hyperparameters (including the filtering radius R~\tilde{R}, the structural function decay rate cc, and the constraint threshold ϵ\epsilon—see § 3 and Table 1), leading to a scheme that requires minimal hyperparameter tuning and straightforwardly achieves rapid convergence. Furthermore, our choice of hyperparameters leads to resolution-invariant constraints, which do not require further adjustment if resolution is increased. Initially, we focus on the case where a conic filtering scheme is used in the TO scheme (§ 4.1), but we also provide the analysis and recommended hyperparameters when a PDE filter (Lazarov and Sigmund 2011) is employed instead (§ 4.2 and Sec. B). While the PDE filter is convenient in unstructured meshes, we show that its singular Green’s function makes the geometric constraints much less robust in the presence of small features. To address this difficulty, we propose a simple solution: applying the PDE filter twice. This “bi-PDE” filter scheme is analyzed in § 4.2 and Sec. C.

Geometric constraints variablesConic filterPDE filterBi-PDE filter
ℓt\ell_ttarget lengthscaleuser-defined(same)(same)
R~\widetilde{R}filter radiusℓt\ell_t (or ∈[23ℓt,4ℓt]\in[\frac{2}{3}\ell_t,4\ell_t])(same)(same)
ccdecay rate64R~264\widetilde{R}^{2}10R~210\widetilde{R}^{2}64R~264\widetilde{R}^{2}
ϵ\epsilonconstraint threshold10−810^{-8}(γ(ℓtR~))−3⋅10−6\left(\gamma\left(\frac{\ell_t}{\widetilde{R}}\right)\right)^{-3}\cdot10^{-6}(γ(ℓtR~))−3⋅10−8\left(\gamma\left(\frac{\ell_t}{\widetilde{R}}\right)\right)^{-3}\cdot10^{-8}
γ(ℓtR~)\gamma\left(\frac{\ell_t}{\widetilde{R}}\right)correction-factor function–Eq. (50)Eq. (65)
ηe,d(ℓtR~)\eta_{e,d}\left(\frac{\ell_t}{\widetilde{R}}\right)solid/void-threshold functionsEq. (9)Eq. (45)Eq. (64)
Optimization aspectSpecificationNotes
Objective function fff∈[1,100]f \in[1,100]suggested scaling (§ 5)
Constraint function(s)ggeo−c:=g(ρ,ℓt)ϵ−1≤0g_{\mathrm{geo-c}}:=\frac{g(\rho,\ell_t)}{\epsilon}-1\leq0scaled by 1/ϵ1/\epsilon (§ 5)
Projection functionsubpixel smoothed projection (SSP)allows β=∞\beta=\infty
OptimizerCCSAQmany alternatives, e.g. Ipopt
StrategySee § 5 for details.
(i) Optimize an unconstrained design while ramping β\beta up to ∞\infty, until objective function is sufficiently low.
(ii) Impose geometric constraints with recommended hyperparameters and β=∞\beta=\infty; optimize constrained design until some stopping criteria is met (e.g., constraints are feasible and obj. fun. is sufficiently low).
(iii) In some instances, the imposed minimum lengthscales may be close to, but still less than, the desired target lengthscales. To further increase the imposed lengthscales, reduce ϵ\epsilon and continue optimizing.

Table 1. Summary of recommendations and hyperparameters for the conic, PDE, and Bi-PDE filters.

Our resulting TO algorithm (§ 5) consists of two stages: First, a design is optimized without imposing geometric constraints while rapidly increasing SSP’s β\beta up to β=∞\beta= \infty. Then, when the objective function reaches a satisfactory value, the geometric constraints are imposed (at β=∞\beta= \infty) with hyperparameter values determined analytically from the desired lengthscale, and the design is evolved until the constraints become feasible and the objective function attains an acceptable value (typically, this requires fewer iterations than the initial unconstrained optimization). Because geometric constraints are only a proxy for the true fabrication constraints (Zhou et al. 2014; Zheng et al. 2023), and in any case the precise definition of “minimum lengthscale” for freeform geometries is inherently ambiguous (especially at the scale of the spatial discretization) (Chen et al. [12]), some a posteriori threshold tuning is occasionally still required to tweak the resulting geometry. To demonstrate the applicability of our approach, we present four photonics TO examples and one heat-transport TO example in § 6, all of them showing good agreement between the obtained and imposed lengthscales. Our strategy and selection of hyperparameters for the three filter cases (conic, PDE, and bi-PDE filters) is summarized in Table 1. Since the resulting algorithm is simply a streamlined version of an existing geometric-constraints method, we believe that it will be attractive to adopt for many applications of TO (in conjunction with SSP binarization), as well as raising new questions for future research (§ 8).

Several alternative approaches to impose minimum lengthscales on TO designs have been proposed. The two-phase Heaviside projection method (HPM) ([11] (Guest et al. 2004; Guest 2009b)) is able to impose minimum lengthscales on both solid and void phases—without additional constraints and with minimal hyperparameter tuning; however, the resulting designs are not fully binarized. Gray pixels values are penalized using, e.g., the solid isotropic material with penalization (SIMP) ([5]) or the rational material penalization (RAMP) ((Stolpe and Svanberg 2001)) methods, which may still leave some gray pixels that could affect the imposed lengthscales. Sigmund (2007) employs differentiable morphology-based filters—such as erosion, dilation, opening, and closing operators—in conjunction with the SIMP method to impose minimum lengthscales on one or two phases, but again, a resulting binary design is not guaranteed. A robust TO formulation was proposed by Wang et al. (2011), which accounts for over/underetch variability while enforcing a quasi-minimum lengthscale. This is achieved by performing a worst-case optimization across three designs—nominal, eroded, and dilated—obtained either by tuning a projection parameter (Qian and Sigmund 2013) or, alternatively, through morphological operations (Hammond et al. 2021). For the method to be valid, the three designs must share the same topology (in Hammond et al. (2021), this is enforced via geometric constraints). In Zhang et al. (2014), the structural skeleton of the physical design is extracted and minimum lengthscales are imposed on the solid phase by enforcing pixels within a neighborhood of the skeleton to be solid; however, they do not present exact constraint derivatives: their gradient computation neglects changes in the skeleton. Hägg and Wadbro (2018) show that designs possessing a minimum lengthscale in the solid (void) phase are morphologically open (closed). Based on this fact, the authors propose a modified SIMP method for minimum compliance problems using differentiable open and close operators (Svanberg and Svärd 2013) to impose minimum lengthscale on both phases. In Schubert et al. (2022), the authors introduce an always-feasible TO method that guarantees a binary and lengthscale-compliant design. The method uses a non-differentiable conditional generator of feasible designs in conjunction with a straight-through gradient estimator. The problem of designing a lengthscale-constrained TO design is then cast as an unconstrained stochastic gradient-optimization problem. In Li et al. (2023), a condition to obtain lengthscale-compliant designs is derived—which is somewhat analogous to the morphological condition given in Hägg and Wadbro (2018). From this, two differentiable constraints are proposed to enforce minimum lengthscales on both phases. These constraints introduce new hyperparameters into the TO problem; however, the authors provide a heuristic choice and a continuation scheme. In general, methods based on morphological filters require a regularization parameter to make these filters differentiable, and this parameter introduces a tradeoff between binarization and convergence rate analogous to β\beta, and may also require additional penalty terms to discourage grayscale regions. On the other hand, methods based on non-differentiable constraints or approximate gradients may limit the applicability of optimization algorithms.

TO overview

In this section we briefly review a general TO design problem. The goal is to find a material distribution in a design region Ω⊂Rd\Omega\subset\mathbb{R}^{d}, with d=2d=2 or d=3d=3, parameterized by a latent density field ρ(x)\boldsymbol{\rho}(\boldsymbol{x}) at each point x∈Ω\boldsymbol{x} \in\Omega, such that an objective function ff is minimized. A typical formulation reads:

min⁡ρf(u)s.t.K(u,ρ)=0gk(ρ)≤0k∈{1,2,…,K}0≤ρ≤1(1)\begin{aligned} \min_{\boldsymbol{\rho}}\quad& f(\boldsymbol{u}) \\ \text{s.t.}\quad& \mathcal{K}(\boldsymbol{u},\boldsymbol{\rho}) = 0 \\ & g_k(\boldsymbol{\rho}) \le0 \qquad k \in\{1,2,\ldots,K\} \\ & 0 \le\boldsymbol{\rho} \le1 \tag*{(1)} \end{aligned}

where ff is the objective function, u\boldsymbol{u} is the system response and solution of K(u,ρ)\mathcal{K}(\boldsymbol{u},\boldsymbol{\rho}), where K\mathcal{K} models the physics of the problem and is parametrized by the latent density ρ\boldsymbol{\rho}, and gkg_k is the kkth constraint.

For a photonics TO problem, a common formulation reads:

min⁡ρf(E1,E2,…,EM)s.t.∇×1μ0∇×Em−ωm2ϵ0ϵr(ρ)Em=−iωmJmgk(ρ)≤00≤ρ≤1(2)\begin{aligned} \min_{\rho}\quad&f(\mathbf{E}_1,\mathbf{E}_2,\ldots,\mathbf{E}_M)\\ \mathrm{s.t.}\quad&\nabla\times\frac{1}{\mu_0}\nabla\times\mathbf{E}_m-\omega_m^2\epsilon_0\epsilon_r(\rho)\mathbf{E}_m=-\mathrm{i}\omega_m\mathbf{J}_m\\ &g_k(\rho)\leq0\\ &0\leq\rho\leq1 \tag*{(2)} \end{aligned}

where each electric-field response Em\mathbf{E}_m, m∈{1,2,…,M}m\in\{1,2,\ldots,M\}, depends on a given angular frequency ωm\omega_m and/or current density Jm\mathbf{J}_m, μ0\mu_0 is the vacuum permeability, ϵ0\epsilon_0 is the vacuum permittivity, and ϵr(ρ)\epsilon_r(\rho) is the point-wise relative permittivity parametrized by the latent density ρ\rho.

A well-established strategy to parametrize the material distribution is the so-called three-density scheme (Sigmund and Maute 2013; Wang et al. 2011). First, to regularize the TO problem and prevent the occurrence of checkerboard patterns and mesh-dependent solutions ([8, 9]), a low-pass filter is applied to the latent density ρ\rho, resulting in the filtered density field ρ~\widetilde{\rho}. There are two widely employed alternatives for filtering.

For a photonics TO problem, a common formulation reads:

A first alternative is to use a conic filter of radius R~\widetilde{R}, given by

k~R~(x)={a(1−∣x∣R~),∣x∣≤R~,0,otherwise,(3)\widetilde{k}_{\widetilde{R}}(\mathbf{x})= \begin{cases} a\left(1-\frac{|\mathbf{x}|}{\widetilde{R}}\right), & |\mathbf{x}|\leq\widetilde{R},\\ 0, & \text{otherwise}, \end{cases} \tag*{(3)}

where the constant aa is chosen such that ∫k~R~=1\int\widetilde{k}_{\widetilde{R}}=1. The filtered field is then obtained as the convolution ρ~=ρ∗k~R~\widetilde{\rho}=\rho\ast\widetilde{k}_{\widetilde{R}}, where ∗\ast denotes 2D or 3D convolution, depending on the problem. A second alternative—convenient for unstructured meshes and finite-element discretizations—is to use a PDE filter approach (Lazarov and Sigmund 2011), where the filtered density ρ~\widetilde{\rho} is obtained as the solution of the following “modified Helmholtz” equation (essentially, an exponentially damped diffusion process):

[−(R~23)2Δ+1]ρ~=ρ,(4)\left[-\left(\frac{\widetilde{R}}{2\sqrt{3}}\right)^2\Delta+1\right]\widetilde{\rho}=\rho, \tag*{(4)}

with Neumann (or Dirichlet Lazarov et al. 2011; Qian and Sigmund 2013) boundary conditions, where R~\tilde{R} plays a similar role as the conic filter radius. Despite its convenience, we have found that the PDE filter yields a filtered density with large spatial derivatives ∥∇xρ~(x)∥\lVert\nabla_{\mathbf{x}}\tilde{\rho}(\mathbf{x})\rVert—which are attributed to the singularity and unbounded derivatives of the 2D Green’s function of the PDE—and this causes difficulties with the application of geometric constraints (see details in § 4.2). In this work we propose a third alternative—termed “bi-PDE” filtering—which simply involves applying the PDE filter twice in succession, resulting in a well-behaved filtered density that is better suited for the geometric constraints. Throughout the rest of the paper we focus our attention on the conic filter case; the particular analyses for the PDE and bi-PDE filter cases are given in § 4.2.

Once the filtered density ρ~\tilde{\rho} is obtained, a projection function is applied to obtain a binary structure. This result in a projected density field ρ^\hat{\rho}, which determines the physical distribution of material or void in the design region. Typically, the following smooth tanh-projection (Xu et al. 2010; Wang et al. 2011) is employed:

ρ^=Pβ,η(ρ~)=tanh⁡(βη)+tanh⁡(β(ρ~−η))tanh⁡(βη)+tanh⁡(β(1−η)),(5)\hat{\rho}=P_{\beta,\eta}(\tilde{\rho})=\frac{\tanh(\beta\eta)+\tanh(\beta(\tilde{\rho}-\eta))}{\tanh(\beta\eta)+\tanh(\beta(1-\eta))}, \tag*{(5)}

where η\eta is the threshold (usually taken as η=1/2\eta=1/2; values of ρ~\tilde{\rho} greater than η\eta are projected towards one, lower values towards zero) and β>0\beta>0 is the steepness hyperparameter (β=0\beta=0 corresponds to the identity mapping ρ^=ρ~\hat{\rho}=\tilde{\rho}, whereas β=∞\beta=\infty corresponds to a Heaviside step function ρ^=H(ρ~−η)\hat{\rho}=H(\tilde{\rho}-\eta)). During optimization β\beta is gradually increased from lower values—allowing smooth transitions of topologies—towards higher values to enforce binarization. Finally, the material relative permittivities, for a photonics TO problem, are linearly interpolated (Andkjær et al. [4]) employing the projected density ρ^\hat{\rho} as:

ϵr(ρ^)=ϵmin⁡+ρ^(ϵmax⁡−ϵmin⁡),(6)\epsilon_r(\hat{\rho})=\epsilon_{\min}+\hat{\rho}(\epsilon_{\max}-\epsilon_{\min}), \tag*{(6)}

where ϵmin⁡\epsilon_{\min} and ϵmax⁡\epsilon_{\max} correspond to the relative permittivities of the void and solid region, respectively. Depending on the problem, other interpolating strategies might be employed, e.g., linearly interpolating the inverse of the permittivities (Wadbro and Engström 2015) or linearly interpolating the refraction indices (Christiansen et al. [16]).

Subpixel-smoothed projection

It has been noted that the tanh-projection (Eq. (5)) suffers from ill-conditioning as β→∞\beta\to\infty (Guest et al. 2011; Dunning and Wein 2025; Hammond et al. 2025). In the β→∞\beta\to\infty regime, the sensitivities of ρ^\hat{\rho} approach zero everywhere except at the interfaces where ρ~=η\tilde{\rho}=\eta. At these interfaces (a set of measure zero), the sensitivities diverge. Furthermore, even for finite but large β\beta, the second derivatives of ρ^\hat{\rho} become large, resulting in an ill-conditioned Hessian that slows down optimization convergence ([7] (Nocedal and Wright 2006)). In practice, to overcome the slow convergence, the β\beta step size must be manually tuned during optimization to obtain good designs in reasonable time, and β\beta must be capped to a predefined maximum value (often around β∼60\beta\sim60), which leads to designs that are not fully binary. (Additional penalties may be used to enforce further binarization, but they come with their own hyperparameters ([13] (Jensen and Sigmund 2005; Hansen et al. 2024)).)

In this work, instead of using the tanh-projection as projection function, we employ the recently introduced subpixel-smoothed projection (SSP) technique (Hammond et al. 2025). SSP is an attractive drop-in alternative that: 1) overcomes the finite-β\beta slow convergence, 2) leads to a projection that is twice differentiable with bounded second derivatives, and 3) allows the optimization of almost-everywhere binary designs (binary except for a 1-pixel gray layer adjacent to interfaces). In brief, SSP consists of replacing Eq. (5) with a function ρ^=SSP⁡β,η(ρ~,∥∇ρ~∥)\hat{\rho}=\operatorname{SSP}_{\beta,\eta}(\tilde{\rho},\lVert\nabla\tilde{\rho}\rVert), which remains twice differentiable even at β=∞\beta=\infty—except at changes in topology, where it falls back to the tanh-projection—while being almost-everywhere binary. The key idea is that the inclusion of ∇ρ~\nabla\tilde{\rho} information provides knowledge of a local neighborhood of ρ~\tilde{\rho}, not just a single point, allowing for a smooth dependence on the location of a nearby interface. To smoothly optimize changes in topology, one still optimizes at β\beta that increases in steps, but now β\beta can be increased much more rapidly, set to ∞\infty as soon as the topology stabilizes. In the present work, the lengthscale constraints are only imposed in this final β=∞\beta= \infty epoch, using analytically derived hyperparameters (§ 4), allowing us to rely on almost-everywhere binarization without sacrificing optimization convergence rate. We refer the reader to Hammond et al. (2025) for more technical details on SSP.

Geometric constraints

Here, we review the geometric constraints introduced in Zhou et al. (2015), which impose a minimum lengthscales in both the solid and void regions. To impose a minimum target lengthscale ℓt\ell_t on the solid region, the following constraint is employed:

gs(ρ,ℓt)=1N∑i=1N[Iismin⁡{ρ~i−ηe(ℓtR),0}]2≤ϵ,(7)g^s(\rho,\ell_t)=\frac{1}{N}\sum_{i=1}^{N}\left[I_i^s\min\left\{\tilde{\rho}_i-\eta_e\left(\frac{\ell_t}{R}\right),0\right\}\right]^2\leq\epsilon, \tag*{(7)}

where NN is the total number of pixels, IsI^s is the solid structural function, ηe\eta_e is a threshold that depends on the fraction ℓt/R\ell_t/R, and the constraint threshold ϵ\epsilon is a small number. The solid structural function IsI^s indicates the inflection region of the solid, given by Ωs={x∈Ω∣ρ^(x)=1 and ∇ρ~(x)=0}\Omega_s=\{x\in\Omega\mid\hat{\rho}(x)=1\text{ and }\nabla\tilde{\rho}(x)=0\}, and decays to zero outside of this region. This is achieved with

Is=ρ^⋅exp⁡(−c∣∇ρ~∣2),(8)I^s=\hat{\rho}\cdot\exp\left(-c\lvert\nabla\tilde{\rho}\rvert^2\right), \tag*{(8)}

where cc is a hyperparameter that determines the decay rate of IsI^s outside of the inflection region. On the other hand, if a conic filter of radius R~\widetilde{R} is used, the solid threshold function ηe\eta_e is given by Qian and Sigmund (2013):

ηe(ℓtR~)={14(ℓtR~)2+12,ℓtR~∈[0,1],−14(ℓtR~)2+ℓtR~,ℓtR~∈[1,2],1,ℓtR~∈[2,∞).(9)\eta_e\left(\frac{\ell_t}{\widetilde{R}}\right)= \begin{cases} \frac{1}{4}\left(\frac{\ell_t}{\widetilde{R}}\right)^2+\frac{1}{2}, & \frac{\ell_t}{\widetilde{R}}\in[0,1],\\ -\frac{1}{4}\left(\frac{\ell_t}{\widetilde{R}}\right)^2+\frac{\ell_t}{\widetilde{R}}, & \frac{\ell_t}{\widetilde{R}}\in[1,2],\\ 1, & \frac{\ell_t}{\widetilde{R}}\in[2,\infty). \end{cases} \tag*{(9)}

If a PDE or bi-PDE filter is used instead, the analytical expression of ηe\eta_e changes: see Eqs. (45) and (64), respectively. Analogously, to impose a minimum target lengthscale ℓt\ell_t on the void region, the following constrained is imposed:

gv(ρ,ℓt)=1N∑i=1N[Iivmin⁡{ηd(ℓtR~)−ρ~i,0}]2≤ϵ,(10)g^v(\rho,\ell_t)=\frac{1}{N}\sum_{i=1}^{N}\left[I_i^v\min\left\{\eta_d\left(\frac{\ell_t}{\widetilde{R}}\right)-\tilde{\rho}_i,0\right\}\right]^2\leq\epsilon, \tag*{(10)}

where IvI^v is the void structural function, which identifies the inflection of the void, i.e., Ωv={x∈Ω∣ρ^(x)=0 and ∇ρ~(x)=0}\Omega_v=\{x\in\Omega\mid\hat{\rho}(x)=0\text{ and }\nabla\tilde{\rho}(x)=0\}, and is given by

Iv=(1−ρ^)⋅exp⁡(−c∣∇ρ~∣2),(11)I^v=(1-\hat{\rho})\cdot\exp\left(-c\lvert\nabla\tilde{\rho}\rvert^2\right), \tag*{(11)}

whereas, using a conic filter, the void threshold function ηd\eta_d reads (Qian and Sigmund 2013):

ηd(ℓtR~)={12−14(ℓtR~)2,ℓtR~∈[0,1],1+14(ℓtR~)2−ℓtR~,ℓtR~∈[1,2],0,ℓtR~∈[2,∞).(12)\eta_d\left(\frac{\ell_t}{\widetilde{R}}\right)= \begin{cases} \frac{1}{2}-\frac{1}{4}\left(\frac{\ell_t}{\widetilde{R}}\right)^2, & \frac{\ell_t}{\widetilde{R}}\in[0,1],\\ 1+\frac{1}{4}\left(\frac{\ell_t}{\widetilde{R}}\right)^2-\frac{\ell_t}{\widetilde{R}}, & \frac{\ell_t}{\widetilde{R}}\in[1,2],\\ 0, & \frac{\ell_t}{\widetilde{R}}\in[2,\infty). \end{cases} \tag*{(12)}

It is illustrative to qualitatively examine how the constraint value varies as the minimum lengthscale of the projected density ρ^\hat{\rho} changes. Consider the 2D example presented in Figure 1a, in which a latent density ρ\rho, consisting of a binary strip of width hh and length L≫hL\gg h, is filtered with a conic filter of radius R~\widetilde{R} and then projected (using β=∞\beta=\infty), resulting in another binary strip of width w=w(h,R~)w=w(h,\widetilde{R}) and same length LL, where ww is the minimum lengthscale of the design. In Figure 1b we show the cross-sections of the densities ρ\rho, ρ~\tilde{\rho}, and ρ^\hat{\rho}, alongside a (scaled and shifted) cross-section of the conic filter k~R~\tilde{k}_{\widetilde{R}}. In Figure 1c we show the value of the solid constraint gs(ρ,ℓt)g^s(\rho,\ell_t), computed with Eq. (7), as a function of the physical width ww, for various target minimum lengthscales ℓt\ell_t. Each target ℓt\ell_t is denoted with a different color: vertical dashed lines indicate the (normalized) value of ℓt/R~\ell_t/\widetilde{R}, whereas solid lines indicate the constraint value. In this example, we use the suggested hyperparameter values of c=64R~c=64\widetilde{R} and ϵ=10−8\epsilon=10^{-8} for the conic filter, shown in Table 1 and derived in § 4.1, to show the correct behavior of the geometric constraint. Examining the ℓt/R~=1\ell_t/\widetilde{R}=1 case, we observe that when the physical lengthscale falls below the target lengthscale (i.e., w<ℓtw<\ell_t, indicating a lengthscale violation) the constraint gsg^s attains an almost-constant value (∼10−4\sim10^{-4} in this case). As ww approaches ℓt\ell_t, gsg^s decays rapidly and smoothly (note the log scale), and finally stabilizes at a small constant value (∼10−22\sim10^{-22} in this case) when w>ℓtw > \ell_t (i.e., the minimum lengthscale is satisfied). Ideally, when w=ℓtw = \ell_t, the value of the constraint should equal the threshold (i.e., gs=ϵg^s = \epsilon) since ϵ\epsilon determines the boundary between the allowed and excluded lengthscales. This is not the case here, however, due to numerical errors and other simplifications in our derivation (Sec. 4.1). Nevertheless, the true intersection has a small error Δw\Delta w less than 116R~\frac{1}{16}\widetilde{R}. Thus, this choice of parameter is adequate for imposing a minimum lengthscale of ℓt=R~\ell_t = \widetilde{R}, with some acceptable error. Importantly, a higher value of cc results in a sharper transition at w=ℓtw = \ell_t, but it could also lead to numerical inaccuracies. Our relatively high cc value ensures a sharp transition while avoiding numerical inaccuracies, resulting in a robust constraint with respect to variations of ϵ\epsilon in the same order of magnitude. Lastly, note that, for the same hyperparameters values, the constraint exhibits a similar behavior for other ratios of ℓt/R\ell_t/R, approximately in the range [0.25,1.5][0.25, 1.5]—or equivalently, R~∈[23ℓt,4ℓt]\widetilde{R} \in[\frac{2}{3}\ell_t, 4\ell_t]. On the other hand, higher ratios, such as ℓt/R=1.75\ell_t/R = 1.75, do not intersect with ϵ\epsilon, whereas lower ratios become overly sensitive to variations of ϵ\epsilon, and thus they are not adequate for imposing minimum lengthscales.

Figure 1. Simple 2D example. (a) Latent density ρ\rho consisting of a binary strip of width hh and length L≫hL \gg h, which is filtered with a conic filter of radius R~\widetilde{R} (i.e., ρ~=ρ∗k~R~\widetilde{\rho} = \rho* \widetilde{k}_{\widetilde{R}}), and then projected with β=∞\beta= \infty (i.e., ρ^=H(ρ~−0.5)\widehat{\rho} = H(\widetilde{\rho} - 0.5)), resulting in a binary strip of width w≤hw \le h and length LL. (b) Horizontal cross-section of ρ\rho, ρ~\widetilde{\rho}, ρ^\widehat{\rho}. A scaled and shifted conic filter kernel k~\widetilde{k} is depicted as a black dashed line. (c) Value of the solid geometric constraint gsg^{s} (Eq. (7)) as a function of the (normalized) physical width w/R~w/\widetilde{R}, for various (normalized) target lengthscales ℓt/R~\ell_{t}/\widetilde{R} represented with different colors. The vertical dashed lines indicate the value of ℓt/R~\ell_{t}/\widetilde{R}; the solid lines indicate the constraint value. We used hyperparameters c=64R~2c = 64\widetilde{R}^{2} and ϵ=10−8\epsilon= 10^{-8} (Table 1). The square design region of size L×LL \times L was discretized with 1024×10241024 \times1024 pixels, with L=1L = 1 and R~=0.3125\widetilde{R} = 0.3125.

Hyperparameter derivations

In this section we derive appropriate values for the hyperparameters R~\widetilde{R}, cc and ϵ\epsilon, in the limit of infinite resolution and full binarization (β=∞\beta= \infty), using a first-principles analysis of stripe/slab geometries. (The quasi-empirical hyperparameter suggestions from previous works, which typically required problem-specific tuning, are summarized in more detail in the Supplementary Information.)

Conic filters

For simplicity, we focus our attention on the solid constraint gs(ρ,ℓt)g^s(\rho,\ell_t) of Eq. (7), which depends on the target lengthscale ℓt\ell_t to be imposed. As a first requirement, the constraint must be resolution-invariant, i.e., for a fixed design ρ\rho, the value of gs−ϵg^s - \epsilon must be (approximately) the same irrespective of the sampling resolution (at least in the limit of high enough resolution). and, in fact, the constraint gsg^s must converge to a unique value at infinite resolution. A sufficient condition for this is that R~\widetilde{R}, cc, and ϵ\epsilon do not depend on the resolution Δx\Delta x. As a result, the sum in the constraint can be seen as a Riemann sum, and thus the infinite-resolution constraint value is given by replacing the sum in gsg^s with an integral, i.e., 1N∑i→1∣Ω∣∫Ω\frac{1}{N}\sum_i \to\frac{1}{|\Omega|}\int_{\Omega}, where ∣Ω∣|\Omega| is the area/volume of the design region Ω\Omega.

We now apply this idea to obtain a closed-form expression for ϵ\epsilon in the limit of infinite resolution. Note that, if the projected density ρ^\hat{\rho} contains features whose minimum lengthscale is less than ℓt\ell_t, then the constraint must be violated, i.e., gs(ρ,ℓt)>ϵg^s(\rho,\ell_t) > \epsilon. Conversely, if the minimum lengthscale is greater than ℓt\ell_t, the constraint must be feasible, implying gs(ρ,ℓt)<ϵg^s(\rho,\ell_t) < \epsilon. Therefore, by continuity of gsg^s, if the minimum lengthscale of ρ^\hat{\rho} is exactly ℓt\ell_t, then gs(ρ,ℓt)=ϵg^s(\rho,\ell_t) = \epsilon. It follows that the value of ϵ\epsilon, in the limit of infinite resolution, is given by evaluating gs(ρ,ℓt)g^s(\rho,\ell_t) when the projected density ρ^\hat{\rho} has a minimum lengthscale of ℓt\ell_t. This results in a formula for ϵ\epsilon involving the decay rate cc, the filter radius R~\widetilde{R}, and the imposed lengthscale ℓt\ell_t (we eliminate the ℓt\ell_t dependence by appropriately choosing R~\widetilde{R} and cc, see Eq. (19) below).

Following the same approach as Qian and Sigmund (2013); Trillet et al. (2021), we consider a simplified 1D setting where the latent density ρ\rho consists of a binary bump feature of width hh, given by

ρ(x)=rect⁡(xh)={1,∣xh∣≤120,otherwise(13)\rho(x) = \operatorname{rect}\left(\frac{x}{h}\right) = \begin{cases} 1, & \left|\frac{x}{h}\right| \le\frac{1}{2} \\ 0, & \text{otherwise} \end{cases} \tag*{(13)}

for x∈Rx \in\mathbb{R}, where rect is the rectangular function. The setting can be extended to 2D by considering a 2D binary strip instead, of width hh and length L≫hL \gg h, as shown in Figure 1a, where a horizontal cross-section of the strip corresponds to the 1D latent density. The same applies to 3D, where we consider instead a binary slab of thickness hh, length LL and width also LL (for simplicity). The simplified setting is not general: in practice, the latent density ρ\rho does not have to be binary and its features can have a combination of different geometries, not necessarily stripes or slabs, and this alters the final expression for ϵ\epsilon. Unfortunately, the geometric constraints apply, by construction, only to the simplified scenario, but in practice, they are also capable of imposing lengthscales on more general designs. Because of this, the final calculation of ϵ\epsilon is not definitive; in some cases it might require some problem-dependent adjustments.

Continuing with the calculation of ϵ\epsilon, we filter the 1D latent density ρ\rho using a 1D conic filter (Eq. (3)) of radius R~\widetilde{R} and normalization a=1/Ra = 1/R, yielding a filtered density ρ~\widetilde{\rho}, which is then projected with β=∞\beta= \infty, resulting in a projected density ρ^\widehat{\rho} consisting of a binary bump of width ww, as shown in Figure 1b. The closed-form expressions of ρ~\widetilde{\rho}, ρ^\widehat{\rho}, and ww are given in Sec. A. Since ww is the minimum lengthscale of ρ^\widehat{\rho}, we set the imposed lengthscale as ℓt=w\ell_{t} = w. We still have the freedom of choosing the filter radius R~\widetilde{R} to any value, as long as ℓt<2R~\ell_{t} < 2\widetilde{R} (higher values are indistinguishable, see Eq. (9)), but it turns out that considering R~=h\widetilde{R} = h is sufficient; any other choice of R~\widetilde{R} with R~≈h\widetilde{R} \approx h leads to essentially the same expression of ϵ\epsilon (see Sec. A, where we derive analogous expression for ϵ\epsilon for other choices of R~\widetilde{R}; we also justify this in Sec. B).

The choice R~=h\widetilde{R} = h leads to R~=h=w=ℓt\widetilde{R} = h = w = \ell_{t} according to Eqs. (33) and (34), and to ηe=0.75\eta_{\mathrm{e}} = 0.75, according to Eq. (9). Now, using the closed-form expressions of the filtered density ρ~\widetilde{\rho}, its gradient ∇ρ~\nabla\widetilde{\rho}, and the projected density ρ^\widehat{\rho} (refer to Sec. A), we compute the solid geometric constraint (Eq. (7)) in dimensions d=1,2,3d = 1, 2, 3 and in the limit of infinite resolution:

ϵ=gs(ρ,ℓt)(14)\epsilon= g^{s}(\rho,\ell_{t}) \tag*{(14)}
=lim⁡N→∞1N∑i=1NIis[min⁡{ρ~i−ηe(ℓtR~),0}]2(15)= \lim_{N \to\infty} \frac{1}{N} \sum_{i=1}^{N} I_{i}^{s}\left[\min\left\{\widetilde{\rho}_{i} - \eta_{\mathrm{e}}\left(\frac{\ell_{t}}{\widetilde{R}}\right),0\right\}\right]^{2} \tag*{(15)}
=1∣Ω∣∫Ωρ^(x)e−c∣∇ρ~(x)∣2[min⁡{ρ~(x)−ηe(ℓtR~),0}]2 dx(16)= \frac{1}{|\Omega|}\int_{\Omega}\widehat{\rho}(\mathbf{x})e^{-c|\nabla\widetilde{\rho}(\mathbf{x})|^{2}}\left[\min\left\{\widetilde{\rho}(\mathbf{x})-\eta_{\mathrm{e}}\left(\frac{\ell_{t}}{\widetilde{R}}\right),0\right\}\right]^{2}\,d\mathbf{x} \tag*{(16)}
=Ld−1R~∣Ω∣∫−∞∞ρ~(x~)e−cR~2∣ddx~ρ~(x~)∣2[min⁡{ρ~(x~)−0.75,0}]2 dx~(17)= \frac{L^{d-1}\widetilde{R}}{|\Omega|}\int_{-\infty}^{\infty}\widetilde{\rho}(\widetilde{x})e^{-\frac{c}{\widetilde{R}^{2}}\left|\frac{d}{d\widetilde{x}}\widetilde{\rho}(\widetilde{x})\right|^{2}}\left[\min\left\{\widetilde{\rho}(\widetilde{x})-0.75,0\right\}\right]^{2}\,d\widetilde{x} \tag*{(17)}
=Ld−1R~∣Ω∣[3π128c~5/2erf⁡(c~)−e−c~64c~(2+3c~)](18)= \frac{L^{d-1}\widetilde{R}}{|\Omega|}\left[\frac{3\sqrt{\pi}}{128\widetilde{c}^{5/2}}\operatorname{erf}\left(\sqrt{\widetilde{c}}\right)-\frac{e^{-\widetilde{c}}}{64\widetilde{c}}\left(2+\frac{3}{\widetilde{c}}\right)\right] \tag*{(18)}
≈Ld−1R~∣Ω∣3π128c~5/2,(19)\approx\frac{L^{d-1}\widetilde{R}}{|\Omega|}\frac{3\sqrt{\pi}}{128\widetilde{c}^{5/2}}, \tag*{(19)}

where the second line corresponds to the integral expression of gsg^{s}, in the third line we performed the integration along the extra d−1d-1 dimensions, yielding a factor of Ld−1L^{d-1}. We also replaced ηe=0.75\eta_{e}=0.75 and changed variables expressing everything in terms of the (scalar) normalized variable x~=x1/R~\widetilde{x}=x_{1}/\widetilde{R}, which yields the factor of R~\widetilde{R} in front of the integral and the factor 1/R~21/\widetilde{R}^{2} in the exponential. It turns out that ρ^\hat{\rho} and ρ^\hat{\rho} depend on x~\widetilde{x} rather than on xx, which simplifies the computation. Moreover, we extended the limits of the integral to ±∞\pm\infty since we can always extend ρ^\hat{\rho} to zero outside of the design region. In the fourth line we computed the integral symbolically in terms of the error function erf⁡\operatorname{erf} and the normalized decay rate c~=c/R~2\widetilde{c}=c/\widetilde{R}^{2}. Finally, in the last line we approximated erf⁡(c~)≈1\operatorname{erf}(\sqrt{\widetilde{c}})\approx1 and neglected the last term of the previous line, an approximation valid for large c~\widetilde{c}. This calculation suggests that an appropriate value for the threshold ϵ\epsilon is given by Eq. (19), which depends on the filter radius R~\widetilde{R}, the normalized hyperparameter c~\widetilde{c}, and the dimension dd. Unfortunately, we see that an appropriate value of ϵ\epsilon also depends on the total length LL of the features present in the design, which is specific to the problem and could potentially depend on the choice of radius R~\widetilde{R}. This underscores a limitation of the geometric constraints: the analytical choice of hyperparameters is problem-dependent. Nonetheless, we can still select appropriate hyperparameter values that perform well across a broad range of cases with minimal tuning.

We now briefly discuss an appropriate value for cc to then derive a value for ϵ\epsilon. Notice that cc appears in the term g~(x):=exp⁡(−c∣ddxρ^(x)∣2)\widetilde{g}(x):=\exp\left(-c\left|\frac{\mathrm{d}}{\mathrm{d}x}\hat{\rho}(x)\right|^{2}\right) of the structural function ISI^{S} (Eq. (8)), indicating that cc has units of [length]2[\mathrm{length}]^{2}. From the closed-form 1D expression of ρ^\hat{\rho} (Sec. A), we have that g~\widetilde{g} is a Gaussian g~(x)=exp⁡(−4cx2/R~4)\widetilde{g}(x)=\exp\left(-4cx^{2}/\widetilde{R}^{4}\right) for x≈0x\approx0. Thus, writing c=R~4/wc2c=\widetilde{R}^{4}/w_{c}^{2} for a new variable wcw_{c}, we see that wcw_{c} has units of [length][\mathrm{length}] and corresponds to the length of the interval {x∈R∣g~(x)≥e−1}\{x\in\mathbb{R}\mid\widetilde{g}(x)\ge e^{-1}\}. Therefore, wcw_{c} controls the width of the Gaussian term and, consequently, the width of the inflection region determined by ISI^{S} (Eq. (8)). This width cannot be arbitrarily small nor large. In particular, wcw_{c} cannot be much smaller than the pixel size Δx\Delta x; otherwise the Gaussian would be too narrow to be accurately discretized. On the other hand, it is difficult to impose a precise lengthscale ℓt\ell_{t} if the inflection region is too broad, as the imposed lengthscale become overly sensitive to ϵ\epsilon. Ideally, wcw_{c} should be fraction of ℓt≈R~\ell_{t}\approx\widetilde{R}, which, in turn, is of the order of a few pixels. It is advisable to set wcw_{c} proportional to R~\widetilde{R} so that the threshold ϵ\epsilon (Eq. (19)) depends linearly on R~\widetilde{R} and remains independent of ℓt\ell_{t}. In our numerical experiments, we found that wc=R~/8w_{c}=\widetilde{R}/8 yields good results in most cases, a choice that corresponds to a decay rate of c=64R~2c=64\widetilde{R}^{2} or c~=64\widetilde{c}=64. This value ensures a fast transition of the constraint at gs=ϵg^{s}=\epsilon—as shown in Figure 1c—making the constraint robust to slight variations of ϵ\epsilon. With this choice, and the reasonable estimates L/∣Ω∣1d≈1L/|\Omega|^{\frac{1}{d}}\approx1 and R~/∣Ω∣1d≈10−2\widetilde{R}/|\Omega|^{\frac{1}{d}}\approx10^{-2}, Eq. (19) yields ϵ≈10−8\epsilon\approx10^{-8} (we mostly care about the order of magnitude of ϵ\epsilon; small variations do not affect the constraint, as discussed above).

PDE and bi-PDE filters

PDE-based filtering is popular for unstructured meshes; it requires, however, a different set of analytical hyperparameter values. Furthermore, as described below, special difficulties arise due to the singular Green’s function of the modified Helmholtz PDE (4). The mathematical details of the hyperparameter derivations are deferred to Sec. B, proceeding analogously to the conic filter case. The resulting hyperparameters are summarized in Table 1. Compared to the conic filter case, a different threshold function ηe\eta_{e} must be employed (Eq. (45)), cc and ϵ\epsilon must be diminished, and ϵ\epsilon includes a correction factor γ(ℓt/R~)\gamma(\ell_{t}/\widetilde{R}) (Eq. (50)), for which γ(1)≈1.03\gamma(1)\approx1.03.

Originally, we attempted to use the same value of cc as the conic filter case (c=64R~2c=64\widetilde{R}^{2}), but it yielded poor results: in numerous instances, some small features were impossible to eliminate. This phenomenon is due to the presence of large singularity-induced spatial derivatives in the filtered density ∥∇ρ~(x)∥\lVert\nabla\widetilde{\rho}(x)\rVert—particularly in the vicinity of small features. A similar phenomenon was also reported in Christiansen et al. [15]. The large spatial derivatives are attributed to the Green’s function G~R~\widetilde{G}_{\widetilde{R}} of the modified Helmholtz PDE (Eq. (38)) with effective radius R~\widetilde{R}, which is singular and has unbounded derivatives ∥∇xG~R~∥\lVert\nabla_x\widetilde{G}_{\widetilde{R}}\rVert at the origin, in 2D and higher dimensions. Since the filtered density can be written as ρ~=G~R~∗ρ\widetilde{\rho}=\widetilde{G}_{\widetilde{R}} * \rho, we see that ρ~\widetilde{\rho} inherits large derivatives, which are more prominent in the neighborhood of small features. (Indeed, for a small feature centered at x0x_0, we have that the latent field is approximately proportional to a Dirac delta ρ∝δx0\rho\propto\delta_{x_0}. Thus, ∇xρ~(x)∝∇x(G~R~∗δx0)(x)=((∇xG~R~)∗δx0)(x)=∇xG~R~(x−x0)\nabla_x\widetilde{\rho}(x)\propto\nabla_x(\widetilde{G}_{\widetilde{R}} * \delta_{x_0})(x)=((\nabla_x\widetilde{G}_{\widetilde{R}})*\delta_{x_0})(x)=\nabla_x\widetilde{G}_{\widetilde{R}}(x-x_0), which exhibits large derivatives at x0x_0.) The solid (and) void structural functions IsI^{s} of Eq. (8), employs spatial derivative information of ρ~\widetilde{\rho}, weighted by the decay rate cc, to localize the inflection region where lengthscale violations occur. Thus, the presence of large spatial derivatives (or large numerical errors in their computation) in conjunction with a large cc value undermines the ability of the geometric constraints to detect small lengthscale violations. A simple workaround is to reduce the cc value: we have found that c=10R~2c=10\widetilde{R}^{2} works well in our numerical examples. Unfortunately, a disadvantage of having a lower decay rate cc is that lengthscales imposed by the geometric constraint are more sensitive to variations in ϵ\epsilon; therefore, one may require additional fine-tuning of ϵ\epsilon to impose the correct lengthscales.

To devise a more robust filtering approach to use with geometric constraints, we propose an alternative PDE filtering method—denoted “bi-PDE” filtering. Instead of applying the PDE filter with radius R~\widetilde{R}, we simply apply the PDE filter with radius rR~r\widetilde{R} twice in succession, where rr is a scaling factor that we adjust to make the effective radius of the bi-PDE filter similar to R~\widetilde{R} (see details in Sec. C and the chosen value of rr in Eq. (58)). With this, the filtered field is now ρ~=(ρ∗GrR~)∗GrR~\widetilde{\rho}=(\rho*G_{r\widetilde{R}})*G_{r\widetilde{R}}, or equivalently, ρ~=ρ∗(GrR~∗GrR~)\widetilde{\rho}=\rho*(G_{r\widetilde{R}}*G_{r\widetilde{R}}), where GrR~∗GrR~G_{r\widetilde{R}}*G_{r\widetilde{R}} is the bi-PDE Green’s function (Eq. (57)), which is well-behaved, has bounded derivatives and is free of singularity. Consequently, the filtered field does not exhibit large spatial derivatives, rendering the bi-PDE filter more robust under geometric constraints. In contrast to the bi-PDE filter, previous double-filtering techniques ([15] (Clausen et al. 2015a)) perform a nonlinear projection in between the two filters, making their effect more difficult to analyze. (Computationally, the cost of topology optimization is usually dominated by the physical PDEs, not the filtering step. Moreover, if explicit sparse-matrix factors are employed, the same factorization of the modified Helmholtz PDE can simply be applied twice.)

We provide in Sec. C the details of the bi-PDE filter and the derivation of adequate hyperparameters. The resulting hyperparameters (see Table 1) are similar to the conic filter case, but ηϵ\eta_{\epsilon} is different (Eq. (64)) and ϵ\epsilon includes a correction factor γ(ℓt/R~)\gamma(\ell_t/\widetilde{R}) (Eq. (65)), for which γ(1)≈0.973\gamma(1)\approx0.973.

Algorithm summary

In this section, we present our strategy to impose minimum lengthscales on a TO design by means of geometric constraints, in conjunction with SSP binarization and the analytically justified hyperparameter values from § 4.1.

Before starting the optimization, it is important to scale the objective function and constraints (e.g., using affine transformations) to an adequate range, which depends on the optimizer being used. Indeed, many optimization algorithms contain internal “dimensionful” parameters—such as initial step-sizes or trust-region radii or penalty strengths—that implicitly assume that all quantities are scaled to have magnitudes of order unity; thus, suboptimal performance is obtained for functions or parameters with inappropriate scalings. For instance, with the CCSA algorithm (Svanberg (2002)), Svanberg (Svanberg (2007)) suggests scaling the objective function to the range [1,100][1,100] and inequality constraints g(x)−c≤0g(x)-c\leq0 such that c∈[1,100]c\in[1,100]. For Ipopt—another gradient-based optimizer for constrained large-scale optimization—the effect of scaling has also been studied (Wächter and Biegler (2006)); by default, it employs a conservative scaling method, in which the objective function and constraints are scaled at the starting point such that the norm of their gradient (in the infinity norm) do not exceed 100. We employ the recommended objective function scalings for the CCSAQ and Ipopt optimizers in all of our examples of § 6. Hereafter, references to the objective function will refer to the unscaled version, assuming that the scaling is handled internally. On the other hand, instead of enforcing the geometric constraints as gs(ρ~,ℓt)g^{s}(\widetilde{\rho},\ell_t) ϵ≤0\epsilon\le0, we normalize them as gs(ρ,ℓt)ϵ−1≤0\frac{g^{s}(\rho,\ell_t)}{\epsilon}-1 \le0. We explored other constraint variations describing the same feasible set; however, none provided any advantage over the simple 1/ϵ1/\epsilon scaling (see Supplementary Information).

Our strategy to enforce a target minimum lengthscale ℓt\ell_t on a TO design proceeds as follows. We have two main stages:

  1. Unconstrained optimization: we set the filter radius to R~=ℓt\widetilde{R}=\ell_t (other options R~≈ℓt\widetilde{R}\approx\ell_t are also viable, see discussion at the end of § 3) and optimize a starting design (random, in our case) without imposing geometric constraints. We employ SSP binarization, which allows us to rapidly increase the projection steepness β\beta across epochs, up to β=∞\beta=\infty in the last epoch. As is typically the case in TO, the user is responsible for choosing an appropriate number of iterations, epochs, and β\beta-scheduling such that the resulting unconstrained design achieves a sufficiently good objective function value (OFV).

  2. Constrained optimization: we maintain β=∞\beta=\infty and impose geometric constraints with the suggested hyperparameter values given in Table 1. The resulting constrained design is optimized until a user-defined stopping criterion is met, which usually involves achieving both constraint feasibility and an acceptable OFV.

We have found that, upon successful termination, this strategy typically yields a constrained design that achieves a good OFV and complies with the minimum lengthscales imposed by the user, in a small number of iterations—usually converging in fewer iterations than the initial unconstrained optimization—and without requiring any hyperparameter tuning. There are two instances, however, where our strategy fails: when (i) the design fails to satisfy some external lengthscale requirement (such as a foundry design rule (Hammond et al. 2021)) even though the constraints are feasible, or when (ii) the optimization stalls in a local optimum, impeding further progress. Unfortunately, these cases require the user to rely on heuristic tuning of ϵ\epsilon to obtain a satisfactory design. Regarding the first case, as discussed in § 1 and § 8, it is a known shortcoming that different definitions of lengthscale constraints do not always precisely agree—usually the discrepancy is a fraction of the filter radius. To address this, the user can either: impose much larger lengthscales compared to the desired lengthscale from the beginning, or heuristically decrease ϵ\epsilon until the desired lengthscales are imposed, as done in our example of § 6.1. Regarding the second case, we found that temporarily imposing a higher threshold ϵ\epsilon for a few iterations may help the optimizer escape local minima—say, imposing ϵ=10−6\epsilon=10^{-6} for 100 iterations and then ϵ=10−8\epsilon=10^{-8} until our stopping criteria is met. This approach, however, should be applied judiciously: the constraints are driven out of the feasible region each time ϵ\epsilon is modified, requiring additional iterations to restore the constraints back to feasibility; consequently, repeated updates to ϵ\epsilon could significantly increase the total number of iterations required for convergence.

Examples

Here, we apply our strategy devised in § 5 to five different TO inverse-design challenges—four from photonics and one from the heat-transfer literature. In particular, we consider three photonics inverse problems introduced in Schubert et al. (2022)—the design of a mode converter (§ 6.1), a beam splitter (§ 6.2), and a wavelength demultiplexer (§ 6.3)—which we simulate using the open-source 2D finite differences frequency domain solver (FDFD) Ceviche (Hughes et al. 2019) via the open-source invrs-gym package (Schubert 2024). In addition, we consider the problem of optimizing the resonance of a photonic cavity via the local density of states (LDOS) (Liang and Johnson 2013; Işiklar et al. 2022); specifically, we apply our strategy to the 2D cavity design problem defined in Chen et al. [12] (§ 6.4), which we simulate using Ceviche. Our last example deals with the optimization of the thermal conductivity tensor of a 2D periodic structure (§ 6.5), as studied in Romano and Johnson (2022), which we simulate using an in-house implementation of the finite-volume method (FVM) (Romano et al. 2025). In each example, the methodology is as follows:

  1. Unconstrained optimization: we initialize the starting design as random, with the same starting design used for all the examples

within the same TO challenge. To optimize the unconstrained design we employ the quadratic approximate variation of the CCSA algorithm (CCSAQ) (Svanberg 2002), implemented in the open-source library NLopt (Johnson et al. 2014). The particular β\beta-scheduling used in each example is given in Sec. D.

  1. Constrained optimization: we impose geometric constraints. To study if the choice of optimizer affects the performance of the geometric constraints, we employ both CCSAQ and Ipopt (Wächter and Biegler 2006) as optimizers. Each optimizer yields an independent constrained design that have the same unconstrained design as starting point.

  1. Evaluation: We assess the performance of the geometric constraints on the final constrained designs, according to three evaluation metrics described below. The first two measure how far is the constrained design from meeting the desired lengthscales. The third metric is the number of iterations required for termination, with fewer iterations indicating faster convergence.

The evaluation metrics are as follows. First, we consider the solid and void minimum lengthscales—measured using the open-source package imageruler [12]—which are then compared against the imposed minimum lengthscale. Ideally, the measured lengthscales should be larger than or equal to the target lengthscale, though exact agreement is unlikely because imageruler employs a different definition of “lengthscale” based on (non-differentiable) morphological filters. Second, to quantitatively assess how far is a binary design ρ^\hat{\rho} from satisfying the imposed lengthscale constraints—in terms of how many pixels constitute a lengthscale violation—we introduce the solid violation metric Vs=100%⋅vs/tV_s = 100\% \cdot v_s/t, where vsv_s is number of lengthscale-violating solid pixels and tt total number of pixels in ρ^\hat{\rho}. The void violation metric VvV_v is defined analogously. We resort to the package imageruler to determine which solid (void) pixels constitute a lengthscale violation. Lastly, as a third metric we count the number of iterations, in the constrained optimization stage, required to achieve constraints feasibility and to attain an OFV sufficiently close to that of the unconstrained design; an efficient constraint would require a small number of iterations to achieve these conditions. Hence, we define our stopping criteria of the second stage as follows: letting fuf_u and fcf_c be the OFV of the unconstrained and constrained designs, respectively, which are assumed to be minimized, we optimize the constrained design until one of the following is satisfied: (i) both solid and void constraints are feasible and fc/fu≤1.25f_c/f_u \le1.25, or (ii) a defined maximum number of iterations M\mathcal{M} (M=400\mathcal{M} = 400, in our case) is reached. The value 1.25 for the objective function ratio fc/fuf_c/f_u (OFR) ensures that the performance has not been significantly degraded due to the introduction of the geometric constraints. In some challenging problems (such as the cavity example of § 6.4 [12]), where the objective function is extremely sensitive to both the minimum feature size and small changes in geometry, achieving an OFR close to or less than 1.0 may require numerous iterations—or may even be impossible—when sufficiently large minimum lengthscales are enforced.

For each TO example we consider three target minimum lengthscales: small, medium (twice the small value), and large (twice the medium value); the small value is specific to each example. In some examples, using the default hyperparameters causes the optimization to become trapped in a local minimum. To address this, we gradually decreased ϵ\epsilon to help the optimizer escape these local minima, as discussed in § 5; the affected examples are explicitly identified.

Importantly, we aggregate outer and inner iterations for both CCSAQ and Ipopt when reporting iterations. This explains why objective function histories may appear irregular and non-monotonic: in an inner iteration, the optimizer may take an aggressive step and subsequently backtrack by increasing some penalty. In Ipopt, the maximum iteration limit only affects the outer iterations; hence, some of the Ipopt examples may exceed the nominal maximum iteration count.

Mode converter

Following Schubert et al. (2022), we consider the problem of designing a 2D photonic mode-converter device that maximally converts the fundamental waveguide mode coming on the left (port 1) to the second order mode on the right (port 2), see Figure 2b. The design region is a 1.6×1.6 μm21.6 \times1.6\ \mu\mathrm{m}^{2} square discretized with 160×160160 \times160 pixels (pixel size Δx=10\Delta x = 10 nm) coupled to fixed and semi-infinite input and output waveguides to the left and right, respectively, having 400 nm width. The solid and void materials correspond to silicon (ϵmax⁡=12.25\epsilon_{\max} = 12.25) and silicon oxide (ϵmin⁡=2.25\epsilon_{\min} = 2.25), respectively. Given the incoming fundamental mode from port 1, the goal is to minimize backreflections into port 1 and maximize transmission of the second order mode into port 2, for six wavelengths: 1265, 1270, 1275, 1285, 1290, and 1295 nm. The precise definition of the objective function, which averages backreflection and transmission across all wavelengths, is given in Schubert et al. (2022).

Figure 2. Results for the mode converter example (Δx=10\Delta x = 10 nm) with medium target lengthscales (ℓt=8Δx\ell_t = 8\Delta x), using the conic filter (with default hyperparameters R~=ℓt\tilde{R} = \ell_t, c=64R~2c = 64\tilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}), and the CCSAQ optimizer. (a) Objective function history and constraint history (maximum of solid and void constraint) of both the unconstrained and constrained design; the horizontal dashed lines indicate the objective function and constraint thresholds of our stopping criteria. (b) Resulting unconstrained design. (c) Resulting constrained design. In (b) and (c) we indicate the value (in pixels) of the target and measured minimum lengthscales, for both solid and void, which we illustrate with circles whose diameters align with the respective lengthscale. The orange and green dashed circles on the design indicate solid and void lengthscale violations, respectively.

Our results employing the conic filter are shown in Table 2. We observe that all small (4 pixels) and medium (8 pixels) cases achieve a satisfactory constrained design, in less than 21 iterations in all cases, except in the medium/Ipopt case, which requires 66 iterations. We show the objective function and constraint history of the medium/CCSAQ case in Figure 2, showing that the constraint value decays exponentially with the number of iterations. For the large (16 pixels) cases, the obtained lengthscales fall short of the desired lengthscale by at least 3 pixels; however, the violation metrics indicate that the number of lengthscale-violating pixels is actually small (Vs,Vv<0.06%\mathcal{V}_{s}, \mathcal{V}_{v} < 0.06\%). We conducted an additional experiment in which we continue evolving the constrained large/CCSAQ case with a decreases threshold of ϵ=10−12\epsilon= 10^{-12}: the optimization took 15 extra iterations to meet our stopping criteria, and the resulting constrained design satisfied the minimum lengthscales. We had to decrease ϵ\epsilon by four orders of magnitude because our large cc-parameter (c~=64\tilde{c} = 64) renders the constraints relatively insensitive to values of ϵ\epsilon within the same order of magnitude.

Target lengthAlgorithmLengthscales (pix.)Violations (%)Results
OptimizerSolidVoidVsV_sVvV_vIter.Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ120.130.0541001 (obj. = 9.87e-2)
Constrained:CCSAQ4500211.14
IPOPT1^{1}4600191.02
Medium: 8 pix.
Unconstrained:CCSAQ110.210.49931 (9.88e-2)
Constrained:CCSAQ8800151.03
IPOPT10900660.99
Large: 16 pix.
Unconstrained:CCSAQ651.381.16741 (1.01e-1)
Constrained:CCSAQ15130.0390.059161.19
IPOPT15170.00780291.03

Table 2. Results using the conic filter for the mode converter example, using default hyperparameters R~=ℓt\widetilde{R} = \ell_t, c=64R~2c = 64\widetilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red). The unconstrained and constrained designs presented in Figure 2 are marked in bold for reference.

Results using the PDE filter are shown in Table 3. Most constrained designs do not satisfy the imposed minimum lengthscales—at most, they are four pixels short. However, the violation metrics indicate that the number of lengthscale-violating pixels is relatively small (Vs≤0.063%\mathcal{V}_s \le0.063\%, Vv≤0.16%\mathcal{V}_v \le0.16\%). The loss of precision of the geometric constraints could be attributable to the large spatial derivatives problems caused by singularities in the PDE filter (see Secs. B and 4.2). Even tuning the ϵ\epsilon hyperparameter did not cure all violations. The number of iterations in all cases is small—less than 30—similar to the conic filter results.

Target lengthAlgorithmLengthscales (pix.)Violations (%)Results
OptimizerSolidVoidVsV_sVvV_vIter.Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ130.0390.0078801 (obj. = 9.86e-2)
Constrained:CCSAQ220.00780.0078151.06
Medium: 8 pix.
Unconstrained:CCSAQ450.530.62901 (9.86e-2)
Constrained:CCSAQ7100.00390291.19
Large: 16 pix.
Unconstrained:CCSAQ373.284.07851 (9.95e-2)
Constrained:CCSAQ1^{1}12120.0630.16281.20

Table 3. Results using the PDE filter for the mode converter example, using default hyperparameters R~=ℓt\widetilde{R} = \ell_t, c=64R~2c = 64\widetilde{R}^{2}, and ϵ=(γ(1))−3⋅10−6\epsilon= (\gamma(1))^{-3} \cdot10^{-6}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red).

Results using the bi-PDE filter are shown in Table 4. Here, most constrained designs comply with the imposed lengthscales—except for the large target lengthscale (16 pixels) case, but even in that case the violation metrics are small (Vs=0%\mathcal{V}_s = 0\%, Vv=0.016%\mathcal{V}_v = 0.016\%). The number of iterations remains small—less than 40.

Target lengthAlgorithmLengthscales (pix.)Violations (%)Results
OptimizerSolidVoidVsV_sVvV_vIter.Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ350.00780921 (obj. = 9.85e−29.85\mathrm{e}{-2})
Constrained:CCSAQ6700171.07
Medium: 8 pix.
Unconstrained:CCSAQ430.100.20801 (9.84e−29.84\mathrm{e}{-2})
Constrained:CCSAQ8900171.11
Large: 16 pix.
Unconstrained:CCSAQ131.382.341601 (1.62e−11.62\mathrm{e}{-1})
Constrained:CCSAQ1^{1}171300.016381.00

Table 4. Results using the Bi-PDE filter for the mode converter example, using default hyperparameters R~=ℓt\tilde{R} = \ell_t, c=64R~2c = 64\tilde{R}^{2}, and ϵ=(γ(1))−3⋅10−8\epsilon= (\gamma(1))^{-3} \cdot10^{-8}. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red).

Beam splitter

We consider the design of the 2D photonics beam splitter defined in Schubert et al. (2022). The device has four ports, ports 1 and 3 to the left and ports 2 and 3 to the right, connected to fixed and semi-infinite waveguides of 400 nm width, see Figure 3b. The design region, at the center, is a 3.2×2.0 μm23.2 \times2.0\ \mu\mathrm{m}^{2} rectangle discretized with 320×200320 \times200 pixels (pixel size Δx=10\Delta x = 10 nm). An incoming fundamental mode into port 1 is divided equally in power into ports 2 and 3, while minimizing back-reflection into port 1 and transmission into port 4. Symmetry along the vertical and horizontal axis is imposed so that all ports have analogous behavior. The solid and void material permittivities, and the six considered wavelengths, are the same as the mode converter example of Sec. 6.1.

Figure 3. Results for the beam splitter example (Δx=10\Delta x = 10 nm) with medium target lengthscales (ℓt=8Δx\ell_t = 8\Delta x), using the conic filter (with default hyperparameters R~=ℓt\tilde{R} = \ell_t, c=64R~2c = 64\tilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}), and the CCSAQ optimizer. (a) Objective function history and constraint history (maximum of solid and void constraint) of both the unconstrained and constrained design; the horizontal dashed lines indicate the objective function and constraint thresholds of our stopping criteria. (b) Resulting unconstrained design. (c) Resulting constrained design. In (b) and (c) we indicate the value (in pixels) of the target and measured minimum lengthscales, for both solid and void, which we illustrate with circles whose diameters align with the respective lengthscale. The orange and green dashed circles on the design indicate solid and void lengthscale violations, respectively.

The results obtained with the conic filter are shown in Table 5. The small (4 pixels) cases comply with the imposed lengthscales, but the CCSAQ and Ipopt optimizers exhibit a large difference of the required number of iterations—39 and 288, respectively. For the medium (8 pixels) cases, all constrained designs comply with the imposed lengthscale in less than 72 iterations. In the objective function and constraint history of the medium/CCSAQ case (Figure 3), we note that the geometric constraints become feasible exponentially fast—in less than 20 iterations—but then, the CCSAQ optimizer requires ∼50\sim50 more iterations to recover the performance lost while driving the constraints to feasibility. The large

Target lengthOptimizerSolidVoidVs\mathcal{V}_sVv\mathcal{V}_vIter.Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ120.180.0381801 (obj. = 2.50e−12.50\mathrm{e}{-1})
Constrained:CCSAQ4500391.19
IPOPT45002880.8
Medium: 8 pix.
Unconstrained:CCSAQ530.330.01251801 (4.19e-1)
Constrained:CCSAQ91100721.02
IPOPT9900500.64
Large: 16 pix.
Unconstrained:CCSAQ612.430.632001 (3.49e0)
Constrained:CCSAQ111140.386.3e-33740.96
IPOPT14130.350.0253200.4

Table 5. Results using the conic filter for the beam splitter example, using default hyperparameters R~=ℓt\tilde{R}=\ell_t, c=64R~2c=64\tilde{R}^{2}, and ϵ=10−8\epsilon=10^{-8}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red). The unconstrained and constrained designs presented in Figure 3 are marked in bold for reference.

cases (16 pixels), on the other hand, do not comply with the target lengthscale—they fall short by five pixels, at most—whereas the violation metrics are small, but not negligible (Vs∼0.38%\mathcal{V}_s \sim0.38\%). The iteration count is considerable: it takes 374 iterations at most to meet the stopping criteria. This suggests that the beam splitter becomes a challenging example when geometric constraints with large lengthscales are imposed. We conducted an additional experiment in which we continue optimizing the large/CCSAQ constrained design with ϵ=10−13\epsilon= 10^{-13}: the resulting design has 16 and 15 pixels of solid and void lengthscales, respectively, with Vs=0%\mathcal{V}_s = 0\% and Vv=0.00625%\mathcal{V}_v = 0.00625\%, and it took 185 additional iterations to reach our stopping criteria.

Results using the PDE filter are shown in Table 6. Both the medium (8 pixels) and small (4 pixels) cases comply with the imposed target lengthscale, taking 76 and 15 iterations, respectively. For the large case (16 pixels), the void lengthscale falls short by four pixels—although Vv=0.025%\mathcal{V}_v = 0.025\% is small. It reached the maximum 400 iterations: the objective function decreased so slowly that it could not reach our stopping criteria, as evidenced in the resulting OFR of ∼40\sim40. This slow convergence was also observed in the conic filter results.

Target lengthOptimizerSolidVoidVs\mathcal{V}_sVv\mathcal{V}_vIter.Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ310.0250.0881801 (obj. = 2.10e−12.10\mathrm{e}{-1})
Constrained:CCSAQ5500151.15
Medium: 8 pix.
Unconstrained:CCSAQ430.110.0751801 (2.50e-1)
Constrained:CCSAQ9800761.24
Large: 16 pix.
Unconstrained:CCSAQ345.672.552001 (1.23e0)
Constrained:CCSAQ1201200.02540041.94

Table 6. Results using the PDE filter for the beam splitter example, using default hyperparameters R~=ℓt\tilde{R}=\ell_t, c=64R~2c=64\tilde{R}^{2}, and ϵ=(γ(1))−3⋅10−6\epsilon=(\gamma(1))^{-3}\cdot10^{-6}. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red).

Results using the bi-PDE filter are shown in Table 7. We observe similar results to those of the PDE filter. Notably, the medium and small cases take a few more iterations—133 and 57, respectively. Furthermore, for the large case the solid violation is much higher (Vs=0.24%\mathcal{V}_s = 0.24\%); however, by the end of the 400 maximum iterations, it achieved a lower OFR of 3.24.

Target lengthAlgorithm OptimizerLengthscales (pix.) SolidLengthscales (pix.) VoidViolations (%) Vs\mathcal{V}_sViolations (%) Vv\mathcal{V}_vResults Iter.Results Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ220.0750.01251801 (obj. = 0.21e-1)
Constrained:CCSAQ5500571.25
Medium: 8 pix.
Unconstrained:CCSAQ320.180.161801 (3.21e-1)
Constrained:CCSAQ1^{1}9700.0441331.04
Large: 16 pix.
Unconstrained:CCSAQ742.563.054191 (1.61e0)
Constrained:CCSAQ2^{2}11150.240.0944003.24

Table 7. Results using the Bi-PDE filter for the beam splitter example, using default hyperparameters R~=ℓt\widetilde{R}=\ell_t, c=64R~2c=64\widetilde{R}^{2}, and ϵ=(γ(1))−3⋅10−8\epsilon=(\gamma(1))^{-3}\cdot10^{-8}. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red).

Wavelength demultiplexer

In this example we consider the design of the 2D photonic wavelength demultiplexer defined in Schubert et al. (2022). The design region is a 6.4×6.4 μm26.4 \times6.4\ \mu\mathrm{m}^{2} square discretized with 640×640640 \times640 pixels (pixel size Δx=10\Delta x = 10 nm). The device is coupled to an input waveguide to the left (port 1) and two output waveguides to the right (port 2 and 3), of 400 nm width, see Figure 4b. Incoming excitations from port 1 are directed to port 2 for wavelengths 1265, 1270, and 1275 nm, and directed to port 3 for wavelengths 1285, 1290,

Figure 4. Results for the wavelength demultiplexer example (Δx=10\Delta x = 10 nm) with medium target lengthscales (ℓt=8Δx\ell_t = 8\Delta x), using the conic filter (with default hyperparameters R~=ℓt\widetilde{R} = \ell_t, c=64R~2c = 64\widetilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}), and the CCSAQ optimizer. (a) Objective function history and constraint history (maximum of solid and void constraint) of both the unconstrained and constrained design; the horizontal dashed lines indicate the objective function and constraint thresholds of our stopping criteria. (b) Resulting unconstrained design. (c) Resulting constrained design. In (b) and (c) we indicate the value (in pixels) of the target and measured minimum lengthscales, for both solid and void, which we illustrate with circles whose diameters align with the respective lengthscale. The orange and green dashed circles on the design indicate solid and void lengthscale violations, respectively.

and 1295 nm. The solid and void materials correspond to silicon (ϵmax⁡=12.25\epsilon_{\max} = 12.25) and silicon oxide (ϵmin⁡=2.25\epsilon_{\min} = 2.25), respectively.

The results using the conic filter are shown in Figure 4 and Table 8. All small (4 pixels) cases satisfy the imposed lengthscale. We note that CCSAQ required significantly fewer iterations than Ipopt—66 and 262, respectively—which was also observed in the beam-splitter example. The medium (8 pixels) cases require less than 124 iterations, but they fall short of the imposed lengthscale by at most two pixel. The violation metrics, however, show that the number of violating pixels is small (Vs,Vd<0.02%V_s,V_d < 0.02\%). Similar to the beam-splitter example, we observe in the constraint history (Figure 4a) that the constraints become feasible in less 20 iterations, but then CCSAQ takes an additional ∼70\sim70 iterations to meet our stopping criteria. For the large (16 pixels) cases, all final designs fail to comply with the desired lengthscale

Target lengthAlgorithm OptimizerLengthscales (pix.) SolidLengthscales (pix.) VoidViolations (%) Vs\mathcal{V}_sViolations (%) Vv\mathcal{V}_vResults Iter.Results Obj. fun. ratio
Small: 4 pix.
Unconstrained:CCSAQ110.110.0592671 (obj. = 1.97e-1)
Constrained:CCSAQ4400661.20
IPOPT44002621.01
Medium: 8 pix.
Unconstrained:CCSAQ111.111.03001 (1.97e-1)
Constrained:CCSAQ760.0130.016921.21
IPOPT8700.000491241.06
Large: 16 pix.
Unconstrained:CCSAQ221.931.133001 (2.35e-1)
Constrained:CCSAQ11130.0370.009781.24
IPOPT14150.0130.016560.88

Table 8. Results using the conic filter for the wavelength demultiplexer example, using default hyperparameters R~=ℓt\widetilde{R}=\ell_t, c=64R~2c=64\widetilde{R}^{2}, and ϵ=10−8\epsilon=10^{-8}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red). The unconstrained and constrained designs presented in Figure 4 are marked in bold for reference.

by at most four pixels; however, the violation metrics are small (VsV_s, Vd<0.04%V_d < 0.04\%), and our stopping criteria was met in a small number of iterations—less than 80. It is surprising that the wavelength demultiplexer requires significantly fewer iterations than the beam splitter (§ 6.2) for the same target lengthscale, despite its higher resolution and seemingly greater design complexity with many small features. We conducted an additional experiment in which we continue optimizing the large/CCSAQ constrained design with ϵ=10−15\epsilon= 10^{-15}: the resulting design required 94 additional iterations to satisfy our stopping criteria and meets the imposed lengthscale of 16 pixels.

Cavity design

In this example, we consider the maximization of the local density of states (LDOS) of a 2D photonic cavity, corresponding to the power emitted by a point-dipole source. This TO problem is challenging due to its extreme sensitivity to the imposed minimum lengthscale and small geometric changes (Chen et al. [12])—especially for resonances with long lifetimes, corresponding to a high “quality factor” QQ (Joannopoulos et al. (2008)). As a result, the optimization is ill-conditioned and “stiff”, causing many algorithms to converge slowly (Liang and Johnson (2013)). This challenge is thus useful for testing the geometric constraints performance.

In particular, we consider the cavity design problem defined in Chen et al. [12]. The goal is to maximize the LDOS produced by an unit electric dipole with in-plane electric field polarization, for a wavelength of λ=1.55\lambda= 1.55 μ\mum. The dipole is placed at the center of the design region, consisting of a 2.005×2.0052.005 \times2.005 μm2\mu\mathrm{m}^{2} square discretized with 401×401401 \times401 pixels (pixel size Δx=5\Delta x = 5 nm). The solid and void materials have permittivities ϵmax⁡=12.11\epsilon_{\max} = 12.11 and ϵmin⁡=1\epsilon_{\min} = 1, respectively. The cavity is surrounded by void material with outgoing boundary conditions, implemented via perfectly matched layers (PML) (Taflove and Hagness (2005)). As done in Chen et al. [12], instead of directly maximizing the cavity LDOS, we equivalently minimize the

non-dimensionalized objective function:

f=vacuum LDOScavity LDOS,(20)f=\frac{\text{vacuum LDOS}}{\text{cavity LDOS}}, \tag*{(20)}

where the cavity LDOS depends on the material distribution determined by ρ\rho, whereas the vacuum LDOS is numerically computed with the same discretization and ρ=0\rho=0 everywhere. This objective function is more suitable for optimizing high-QQ cavities, resulting in faster convergence (Liang and Johnson 2013). Due to the inherent slow convergence of this example, we increased the maximum number of iterations for the constrained optimization to M=800M=800.

In Figure 5, we show the objective function and constraint history of the medium/CCSAQ (6 pixels) case, using a conic filter. The slow convergence of the cavity LDOS optimization is evident during the unconstrained optimization: In the first ∼15\sim15 iterations the objective function achieves a value of ∼2×10−4\sim2\times10^{-4}, but then it takes ∼250\sim250 additional iterations to decrease by one order of magnitude, to a value of ∼5×10−5\sim5\times10^{-5}. When geometric constraints are imposed and the constrained optimization begins, the constraints achieve feasibility

Figure 5. Results for the cavity example (Δx=5\Delta x = 5 nm) with medium target lengthscales (ℓt=6Δx\ell_t = 6\Delta x), using the conic filter (with default hyperparameters R~=ℓt\widetilde{R} = \ell_t, c=64R~2c = 64\widetilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}), and the CCSAQ optimizer. (a) Objective function history and constraint history (maximum of solid and void constraint) of both the unconstrained and constrained design; the horizontal dashed lines indicate the objective function and constraint thresholds of our stopping criteria. (b) Resulting unconstrained design. (c) Resulting constrained design. In (b) and (c) we indicate the value (in pixels) of the target and measured minimum lengthscales, for both solid and void, which we illustrate with circles whose diameters align with the respective lengthscale. The orange and green dashed circles on the design indicate solid and void lengthscale violations, respectively.

exponentially fast in only ∼20\sim20 iteration; however, this fast decrease of the constraint comes at the expense of degrading the objective function, which increased by one order of magnitude to a value of ∼5×10−4\sim5\times10^{-4}. The CCSAQ optimizer then required ∼250\sim250 additional iterations to decrease the objective function back to its unconstrained value and meet our stopping criteria. Although the constrained optimization required approximately the same number of iterations as the unconstrained case, we note that the inclusion of geometric constraints did not affect the convergence rate of the objective function, which remained similar to that of the unconstrained optimization.

Our results using the conic filter are shown in Table 9. For the small (3 pixels) target lengthscale, both the CCSAQ and Ipopt cases comply with the imposed lengthscale, but they require vastly different numbers of iterations—21 and 1745, respectively. For the medium (6 pixels) target, the CCSAQ case satisfies the imposed lengthscale, requiring 287 iterations to meet our stopping criteria. On the other hand, the Ipopt case reaches the maximum number of iterations without satisfying the geometric constraints and falls below the imposed solid target by 3 pixels; however, the solid violation is small (Vs=0.0044%\mathcal{V}_s = 0.0044\%). For the large (12 pixels) target, the CCSAQ case requires 717 iterations but exhibits a small void lengthscale violation (Vv=0.017%\mathcal{V}_v = 0.017\%), whereas the Ipopt case complies with the imposed lengthscale but reaches the maximum number of iterations without meeting our stopping criteria.

Target lengthOptimizerSolidVoidVsV_sVvV_vIter.Obj. fun. ratio
Small: 3 pix.
Unconstrained:CCSAQ230.0102701 (obj.=5.12e−5\mathrm{obj.}=5.12\mathrm{e}{-5})
Constrained:CCSAQ3400210.65
IPOPT¹430017450.76
Medium: 6 pix.
Unconstrained:CCSAQ310.110.032701 (5.43e-5)
Constrained:CCSAQ66002871.19
IPOPT²370.0044012610.53
Large: 12 pix.
Unconstrained:CCSAQ3100.0080.0212701 (8.03e-5)
Constrained:CCSAQ131000.0177171.23
IPOPT15140013380.49

Table 9. Results using the conic filter for the cavity example, using default hyperparameters Rˉ=ℓt\bar{R}=\ell_t, c=64Rˉ2c=64\bar{R}^{2}, and ϵ=10−8\epsilon=10^{-8}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red). The unconstrained and constrained designs presented in Figure 4 are marked in bold for reference.

Heat transfer

In this section, we apply our framework to optimize a 2D periodic thermal metamaterial with a prescribed effective thermal conductivity tensor, κˉD\bar{\kappa}_D. The transport model is the standard heat-conduction equation

∇⋅[κ(ρ)∇T]=0,(21)\nabla\cdot[\kappa(\rho)\nabla T] = 0, \tag*{(21)}

which we solve using the finite-volume method Gersborg-Hansen et al. 2006. The design region is a square of size LL divided into 150×150150 \times150 pixels, see Figure 6b. Details about the discretization of Eq. (21) can be found in Eq. (21) in Romano and Johnson (2022). The thermal metamaterial is composed of a solid and a void phase, the latter with negligible thermal conductivity. In Eq. (21), the local thermal conductivity is interpolated via

Figure 6. Results for the heat-transfer example with medium target lengthscales (ℓt=6 Δx\ell_t = 6\,\Delta x), using the conic filter (with default hyperparameters R~=ℓt\tilde{R} = \ell_t, c=64R~2c = 64\tilde{R}^{2}, and ϵ=10−8\epsilon= 10^{-8}), and the CCSAQ optimizer. (a) Objective function history and constraint history (maximum of solid and void constraint) of both the unconstrained and constrained design; the horizontal dashed lines indicate the objective function and constraint thresholds of our stopping criteria. (b) Resulting unconstrained design. (c) Resulting constrained design. In (b) and (c) we indicate the value (in pixels) of the target and measured minimum lengthscales, for both solid and void, which we illustrate with circles whose diameters align with the respective lengthscale. The orange and green dashed circles on the design indicate solid and void lengthscale violations, respectively.

κ(ρ^)=δ+(κbulk−δ)ρ^,(22)\kappa(\hat{\rho}) = \delta+ (\kappa_{\mathrm{bulk}} - \delta)\hat{\rho}, \tag*{(22)}

where κbulk=1 Wm−1K−1\kappa_{\mathrm{bulk}} = 1\ \mathrm{Wm}^{-1}\mathrm{K}^{-1} is the bulk thermal conductivity of the solid phase and δ=10−10\delta= 10^{-10} Wm−1K−1\mathrm{Wm}^{-1}\mathrm{K}^{-1} is a regularization parameter. The goal is to find ρ\rho such that the effective thermal conductivity tensor κˉ(ρ^)\bar{\kappa}(\hat{\rho}) approaches the desired one, which we set to

κˉD=[0.2000.3] Wm−1K−1.(23)\bar{\kappa}_{D} = \begin{bmatrix} 0.2 & 0 \\ 0 & 0.3 \end{bmatrix} \ \mathrm{Wm}^{-1}\mathrm{K}^{-1}. \tag*{(23)}

To reconstruct κˉ(ρ^)\bar{\kappa}(\hat{\rho}), we solve Eq. (21) for three different directions of applied temperature ΔTextn^i\Delta T_{\mathrm{ext}}\hat{\mathbf{n}}_i, with ΔText=1 K\Delta T_{\mathrm{ext}} = 1\ \mathrm{K}, n^1=x^\hat{\mathbf{n}}_1 = \hat{\mathbf{x}}, n^2=y^\hat{\mathbf{n}}_2 = \hat{\mathbf{y}}, and n^3=22(x^+y^)\hat{\mathbf{n}}_3 = \frac{\sqrt{2}}{2}(\hat{\mathbf{x}} + \hat{\mathbf{y}}). For each direction i=1,2,3i = 1,2,3, we compute the effective directional thermal conductivity κi=ΔText−1Pi⋅n^i\kappa_i = \Delta T_{\mathrm{ext}}^{-1}\mathbf{P}_i \cdot\hat{\mathbf{n}}_i, where Pi=[P(i,x),P(i,y)]\mathbf{P}_i = [P_{(i,x)}, P_{(i,y)}] is the vector of power collected along two orthogonal faces of the simulation domain. For example,

the component along xx is computed by

P(i,x)=∫−L/2L/2Ji(L/2,y)⋅x^ dy,(24)P_{(i,x)} = \int_{-L/2}^{L/2} \mathbf{J}_i(L/2,y) \cdot\hat{\mathbf{x}}\,\mathrm{d}y, \tag*{(24)}

where J=−κ∇T\mathbf{J} = -\kappa\nabla T is the heat flux. The three independent components κˉxx\bar{\kappa}_{xx}, κˉyy\bar{\kappa}_{yy}, and κˉxy\bar{\kappa}_{xy} of the symmetric 2×22 \times2 tensor κˉ\bar{\kappa} are then obtained by solving the linear system κi=n^iTκˉn^i=n^i,x2κˉxx+n^i,y2κˉyy+2n^i,xn^i,yκˉxy\kappa_i = \hat{\mathbf{n}}_i^{\mathsf{T}}\bar{\kappa}\hat{\mathbf{n}}_i = \hat{n}_{i,x}^{2}\bar{\kappa}_{xx} + \hat{n}_{i,y}^{2}\bar{\kappa}_{yy} + 2\hat{n}_{i,x}\hat{n}_{i,y}\bar{\kappa}_{xy}, leading to κˉxx=κ1\bar{\kappa}_{xx} = \kappa_1, κˉyy=κ2\bar{\kappa}_{yy} = \kappa_2, and κˉxy=12κ1−12κ2+κ3\bar{\kappa}_{xy} = \frac{1}{2}\kappa_1 - \frac{1}{2}\kappa_2 + \kappa_3. Once κˉ(ρ^)\bar{\kappa}(\hat{\rho}) is reconstructed, the objective function is computed as f(ρ^)=∥κˉ(ρ^)−κˉD∥f(\hat{\rho}) = \lVert\bar{\kappa}(\hat{\rho}) - \bar{\kappa}_D\rVert, where we used the Frobenius norm.

End-to-end differentiability is ensured by automatic differentiation, which is the engine behind

the thermal solver. The code has recently been validated against Ansys on three-dimensional structures (Romano et al. 2025), and is planned for public release in the near future. We note that the use of three different directions generalizes our previous approach (Romano and Johnson 2022), where only the diagonal components of κˉ\bar{\kappa} were considered. In contrast, here, the third direction is used to enforce zero off-diagonal elements. In principle, a diagonal tensor for κˉ\bar{\kappa} can also be achieved by enforcing symmetry. However, our approach allows for a wider range of optimal configurations, while also potentially enabling non-zero off-diagonal components.

Our results using the conic filter are shown in Figure 6. Only two final designs do not satisfy the imposed lengthscales; however, their number of lengthscale-violating pixels is small (VsV_s, Vv<0.05%V_v < 0.05\%). All examples meet our stopping conditions in less than 150 iterations. For the small case, Ipopt requires more than triple number of iterations compared to CCSAQ (141 and 43 iterations, respectively). For the medium and large cases, Ipopt only requires a few extra iterations compared to CCSAQ. In Figure 6 we present the objective function and constraint history of the medium/CCSAQ case, which exhibit rapid convergence.

Discussion

Our strategy is able to, either, impose the desired minimum lengthscale ℓt\ell_t, or yield a design whose lengthscale falls slightly below the ℓt\ell_t but with only a few lengthscale-violating pixels—as measured by VsV_s and VvV_v.

Usually, for small and medium target lengthscales, the geometric constraints successfully enforce the desired lengthscale, in a small number of iterations—typically, less than that of the unconstrained optimization—and without degrading the objective function value. On the other hand, the large target lengthscale cases are more challenging: often, lengthscales are not satisfied and it takes numerous iterations to meet our stopping criteria. A possible reason for this is that, since the perimeter of 2D features are longer for large target lengthscales, there are more pixels that can constitute a possible lengthscale violation, and thus it is more difficult to perfectly agree with lengthscale measuring tools. The resulting violation metrics, however, are small (often Vs,Vv<0.1%V_s,V_v < 0.1\%), and we have shown that they can be further reduced, potentially to zero, by decreasing ϵ\epsilon. A possible cause for the increased number of iterations is that larger lengthscales—which require a larger filter radius Rˉ\bar{R}—have a slower convergence rate. Indeed, we observe that, for the same number of iterations, the unconstrained large-lengthscale designs attain a less-optimal objective function compared to unconstrained medium-lengthscale cases. Furthermore, it is usually the case that the optimizer cannot recover the same objective function value as the unconstrained design when sufficiently large lengthscales are imposed, thus leading to an increased number of iterations to meet our stopping conditions. We note that the constraints rapidly become feasible within a few iterations, which initially worsens the objective function value; a large number of subsequent iterations are then needed to restore its performance. Notably, when small or medium target lengthscales are imposed, the geometric constraints do not appear to degrade the convergence rate relative to the unconstrained case, as evidenced in the challenging cavity example shown in Figure 5a.

Target lengthAlgorithmLengthscales (pix.)Violations (%)Results
OptimizerSolidVoidVs\mathcal{V}_sVv\mathcal{V}_vIter.Obj. fun. ratio
Small: 6 pix.
Unconstrained:CCSAQ112.141.131201 (obj. = 2.65e−62.65\mathrm{e}{-6})
Constrained:CCSAQ550.00440.018431.17
IPOPT76001410.95
Medium: 12 pix.
Unconstrained:CCSAQ531.420.351201 (6.03e−66.03\mathrm{e}{-6})
Constrained:CCSAQ131200430.81
IPOPT161500671.19
Large: 18 pix.
Unconstrained:CCSAQ454.550.851201 (5.29e−45.29\mathrm{e}{-4})
Constrained:CCSAQ201400.044670.80
IPOPT212300853.8e−33.8\mathrm{e}{-3}

Table 10. Results using the conic filter for the heat-transfer example, using default hyperparameters Rˉ=ℓt\bar{R}=\ell_t, c=64Rˉ2c=64\bar{R}^{2}, and ϵ=10−8\epsilon=10^{-8}, where ℓt\ell_t is the target lengthscale in physical units. Measured lengthscales that comply (do not comply) with the target lengthscale are indicated in green (red). The unconstrained and constrained designs presented in Figure 6 are marked in bold for reference.

Comparing the performance of the optimizers, we find that CCSAQ usually requires fewer iterations than Ipopt to meet our stopping criteria, which can be attributed to differences in their constrained optimization approaches. On one hand, when the starting point is infeasible, the CCSAQ implementation of the NLopt library (Johnson et al. 2014) employs an aggressive strategy that essentially disregards the objective function value and prioritize constraint feasibility instead, potentially leading to fewer iterations but also becoming more susceptible to converging to local minima. On the other hand, Ipopt employs a conservative

approach: by default, it allows some constraint infeasibility while prioritizing objective function improvement; this enhances robustness but could lead to a higher iteration count.

Regarding the conic, PDE, and bi-PDE filters, they exhibit similar performance. It is important to emphasize, however, that lengthscales imposed by geometric constraints become more sensitive to ϵ\epsilon when the PDE filter is employed—as discussed in § 4.2; therefore, users might expect additional fine-tuning of ϵ\epsilon to enforce strict minimum lengthscales. The conic and bi-PDE filters, on the other hand, do not encounter this issue, as their filter kernels are bounded.

Conclusions

In this work we provided a comprehensive analysis of the geometric constraints and the analytical derivation of adequate and resolution-invariant hyperparameters, for the case of full binarization (β=∞\beta=\infty) and infinite resolution. We proposed a simple but effective strategy to impose minimum lengthscales on a TO design via geometric constraints, based on our analytically derived hyperparameters and the use of subpixel-smooth projection (SSP), which allows the rapidly-converging optimization of almost-binary designs. We illustrated and evaluated the performance of our strategy using four photonics and one heat-transfer TO examples, each constrained by three distinct target lengthscales, while employing different combination of filters (conic, PDE, and bi-PDE) and optimizers (CCSAQ and Ipopt). We believe that our streamlined algorithm will be attractive to adopt in many TO applications. Lastly, we identified that the PDE filter poses difficulties to the geometric constraints due to its singular Green’s function. We proposed the bi-PDE filter scheme, which is a simple and attractive alternative that alleviates the aforementioned issues due to its well-behaved Green’s function.

There are many directions of future research. For example, one could apply a similar analysis (in the full-binarization and infinite-resolution limit) to other types of fabrication constraints, such as maximum lengthscales (Guest 2009a; Lazarov and Wang 2017; Carstensen and Guest [11]), minimum area and minimum enclosed area (Hammond et al. 2021), and connectivity (Li et al. 2016; Christiansen [14]). Another challenge is that the hyperparameter ϵ\epsilon (Eq. (19)) has a weak dependence on the total volume of the small features due to the integrated nature of the constraint, which sometimes still requires manual tuning of ϵ\epsilon. One possible way to eliminate this problem-dependence is to impose the constraints not just globally but locally. Although this would require thousands of additional pointwise constraints, the sparsity of their gradients could be exploited by efficient large-scale optimization algorithms (e.g., Wächter and Biegler 2006; Gill et al. 2005; Byrd et al. [10]). We must emphasize, however, that imposing an even-stricter minimum lengthscale may not necessarily improve the manufacturability of a design, because lengthscale constraints are generally approximations. The definition of a minimum lengthscale is inherently somewhat ambiguous for freeform geometries, especially at the scale of the discretization (Chen et al. [12]), so 1–2 pixel violations are not necessarily meaningful. More fundamentally, however, minimum lengthscales are generally only a proxy for the true manufacturing constraints of a process like lithography or 3D printing. In practice, additional calibration steps—such as proximity error correction (PEC)—are required to make TO designs manufacturable; nonetheless, these steps often produce output patterns that deviate from the original TO design, leading to reduced performance (Zhou et al. 2014).

One approach to improve fidelity is to incorporate an explicit model of the fabrication physics into the design framework (Zhou et al. 2014, 2017; Zheng et al. 2023), which has the drawback of requiring extensive theory and calibration for a particular manufacturing method.

Derivations: conic filters

Here we derive closed-form expressions of ρ~\tilde{\rho} and ρ^\hat{\rho} for the simplified 1D setting presented in § 4.1, in the limit of infinite resolution and full binarization (β=∞\beta= \infty). Consider a latent density ρ\rho that consists of a 1D binary bump of width hh, ρ(x)=rect⁡(x/h)\rho(x) = \operatorname{rect}(x/h), for x∈Rx \in\mathbb{R}, as done in Eq. (13). For filtering, we employ the 1D conic filter (Eq. (3)) of radius R~\tilde{R} and normalization a=1/R~a = 1/\tilde{R}, which can be written as

k~R~(x)=1R~Λ(xR~),\tilde{k}_{\tilde{R}}(x) = \frac{1}{\tilde{R}} \Lambda\left(\frac{x}{\tilde{R}}\right),

in terms of the triangular function Λ(x)=max⁡{1−∣x∣,0}\Lambda(x) = \max\{1-|x|,0\}. It is convenient to work with normalized units x~=x/R~\tilde{x} = x/\tilde{R} and h~=h/R~\tilde{h} = h/\tilde{R}. In the limit of infinite resolution, the filtered field is:

ρ~(x)=(k~R~∗ρ)(x)(25)\tilde{\rho}(x) = \left(\tilde{k}_{\tilde{R}} * \rho\right)(x) \tag*{(25)}
=∫Rk~R~(x−t)ρ(t) dt(26)= \int_{\mathbb{R}} \tilde{k}_{\tilde{R}}(x-t)\rho(t)\,\mathrm{d}t \tag*{(26)}
=∫R1R~Λ(x−tR~)rect⁡(th) dt(27)= \int_{\mathbb{R}} \frac{1}{\tilde{R}} \Lambda\left(\frac{x-t}{\tilde{R}}\right)\operatorname{rect}\left(\frac{t}{h}\right)\,\mathrm{d}t \tag*{(27)}
=∫−h2h21R~Λ(x−tR~) dt(28)= \int_{-\frac{h}{2}}^{\frac{h}{2}} \frac{1}{\tilde{R}} \Lambda\left(\frac{x-t}{\tilde{R}}\right)\,\mathrm{d}t \tag*{(28)}
=∫−h~2h~2Λ(x~−t~) dt~(29)= \int_{-\frac{\tilde{h}}{2}}^{\frac{\tilde{h}}{2}} \Lambda\left(\tilde{x}-\tilde{t}\right)\,\mathrm{d}\tilde{t} \tag*{(29)}

where in the last line we changed variables t~=t/R~\tilde{t} = t/\tilde{R}. From the last expression we see that ρ~\tilde{\rho} depends on x~\tilde{x} and h~\tilde{h} rather than on xx and hh. Calculating this in closed-form yields a piecewise quadratic polynomial whose expression depends on h~\tilde{h}. For the case 0<h~≤10 < \tilde{h} \le1 we have:

ρ~(x)=\tilde{\rho}(x) =
ρ~(x~)={−∣x~∣2+h~4(4−h~),∣x~∣∈[0,h~2),h~(1−∣x~∣),∣x~∣∈[h~2,1−h~2),12(1−(∣x~∣−h~2)2),∣x~∣∈[1−h~2,1+h~2),0,∣x~∣∈[1+h~2,∞),(30)\tilde{\rho}(\tilde{x}) = \begin{cases} -|\tilde{x}|^2+\frac{\tilde{h}}{4}(4-\tilde{h}), & |\tilde{x}|\in\left[0,\frac{\tilde{h}}{2}\right),\\ \tilde{h}(1-|\tilde{x}|), & |\tilde{x}|\in\left[\frac{\tilde{h}}{2},1-\frac{\tilde{h}}{2}\right),\\ \frac{1}{2}\left(1-\left(|\tilde{x}|-\frac{\tilde{h}}{2}\right)^2\right), & |\tilde{x}|\in\left[1-\frac{\tilde{h}}{2},1+\frac{\tilde{h}}{2}\right),\\ 0, & |\tilde{x}|\in\left[1+\frac{\tilde{h}}{2},\infty\right), \end{cases} \tag*{(30)}

and for the case 1<h~≤21<\tilde{h}\leq2:

ρ~(x)={−∣x~∣2+h~4(4−h~),∣x~∣∈[0,1−h~2),−18((h~−2(1+∣x~∣))2−8),∣x~∣∈[1−h~2,h~2),12(1−(∣x~∣−h~2)2),∣x~∣∈[h~2,1+h~2),0,∣x~∣∈[1+h~2,∞).(31)\tilde{\rho}(x)= \begin{cases} -|\tilde{x}|^2+\frac{\tilde{h}}{4}(4-\tilde{h}), & |\tilde{x}|\in\left[0,1-\frac{\tilde{h}}{2}\right),\\ -\frac{1}{8}\left((\tilde{h}-2(1+|\tilde{x}|))^2-8\right), & |\tilde{x}|\in\left[1-\frac{\tilde{h}}{2},\frac{\tilde{h}}{2}\right),\\ \frac{1}{2}\left(1-\left(|\tilde{x}|-\frac{\tilde{h}}{2}\right)^2\right), & |\tilde{x}|\in\left[\frac{\tilde{h}}{2},1+\frac{\tilde{h}}{2}\right),\\ 0, & |\tilde{x}|\in\left[1+\frac{\tilde{h}}{2},\infty\right). \end{cases} \tag*{(31)}

The case h~>2\tilde{h}>2 is not of interest, since the geometric constraint can only impose lengthscales up to 2R~2\tilde{R} when employing the conic filter, but we show its expression here for completeness:

ρ~(x)={1,∣x~∣∈[0,h~2−1),−18((h~−2(1+∣x~∣))2−8),∣x~∣∈[h~2−1,h~2),12(1−(∣x~∣−h~2)2),∣x~∣∈[h~2,1+h~2),0,∣x~∣∈[1+h~2,∞).(32)\tilde{\rho}(x)= \begin{cases} 1, & |\tilde{x}|\in\left[0,\frac{\tilde{h}}{2}-1\right),\\ -\frac{1}{8}\left((\tilde{h}-2(1+|\tilde{x}|))^2-8\right), & |\tilde{x}|\in\left[\frac{\tilde{h}}{2}-1,\frac{\tilde{h}}{2}\right),\\ \frac{1}{2}\left(1-\left(|\tilde{x}|-\frac{\tilde{h}}{2}\right)^2\right), & |\tilde{x}|\in\left[\frac{\tilde{h}}{2},1+\frac{\tilde{h}}{2}\right),\\ 0, & |\tilde{x}|\in\left[1+\frac{\tilde{h}}{2},\infty\right). \end{cases} \tag*{(32)}

Now, the projected density is computed as a Heaviside projection (β=∞\beta=\infty), that is ρ^=H(ρ~−1/2)\hat{\rho}=H(\tilde{\rho}-1/2), and it can be shown that it corresponds to a binary bump of width ww, ρ^(x)=rect⁡(x/w)\hat{\rho}(x)=\operatorname{rect}(x/w). The (normalized) width w~=w/R~\tilde{w}=w/\tilde{R} can be computed in closed-form (by solving ρ~(w~/2)=1/2\tilde{\rho}(\tilde{w}/2)=1/2) as a function of the (normalized) latent width h~\tilde{h} (Qian and Sigmund 2013):

w~(h~)={0,h~∈[0,2−2),4h~−h~2−2,h~∈[2−2,1),h~,h~∈[1,∞),(33)\tilde{w}(\tilde{h})= \begin{cases} 0, & \tilde{h}\in[0,2-\sqrt{2}),\\ \sqrt{4\tilde{h}-\tilde{h}^2-2}, & \tilde{h}\in[2-\sqrt{2},1),\\ \tilde{h}, & \tilde{h}\in[1,\infty), \end{cases} \tag*{(33)}

whereas the the inverse relation is:

h~(w~)={2−2−w~2,w~∈(0,1),w~,w~∈[1,∞).(34)\tilde{h}(\tilde{w})= \begin{cases} 2-\sqrt{2-\tilde{w}^2}, & \tilde{w}\in(0,1),\\ \tilde{w}, & \tilde{w}\in[1,\infty). \end{cases} \tag*{(34)}

In Sec. 4.1 we derived an asymptotic approximation of the threshold ϵ\epsilon (Eq. (19)) for the case R~=ℓt\tilde{R}=\ell_t, where ℓt\ell_t is the target lengthscale. We note, however, that this approximation also holds for cases R~≈ℓt\tilde{R}\approx\ell_t. We can verify that the exact expression of ϵ\epsilon for the case R~=23ℓt\tilde{R}=\frac{2}{3}\ell_t is:

ϵ=Ld−1R~∣Ω∣1256c~5/2[π(c~2−8c~+48)erf⁡(c~)−π(c~2−8c~+42)erf⁡(c~2)−e−c~/4(c~−42)c~−48e−c~(c~+2)c~],(35)\epsilon=\frac{L^{d-1}\tilde{R}}{|\Omega|}\frac{1}{256\tilde{c}^{5/2}}\left[ \sqrt{\pi}(\tilde{c}^2-8\tilde{c}+48)\operatorname{erf}(\sqrt{\tilde{c}}) -\sqrt{\pi}(\tilde{c}^2-8\tilde{c}+42)\operatorname{erf}\left(\frac{\sqrt{\tilde{c}}}{2}\right) -e^{-\tilde{c}/4}(\tilde{c}-42)\sqrt{\tilde{c}}-48e^{-\tilde{c}}(\tilde{c}+2)\sqrt{\tilde{c}} \right], \tag*{(35)}

whereas for R~=2ℓt\tilde{R}=2\ell_t it is:

ϵ=Ld−1R~∣Ω∣1256c~5/2(6πerf⁡(c~2)−c~(c~+6)e−c~/4),(36)\epsilon=\frac{L^{d-1}\tilde{R}}{|\Omega|}\frac{1}{256\tilde{c}^{5/2}}\left(6\sqrt{\pi}\operatorname{erf}\left(\frac{\sqrt{\tilde{c}}}{2}\right)-\sqrt{\tilde{c}}(\tilde{c}+6)e^{-\tilde{c}/4}\right), \tag*{(36)}

where c~=c/R~2\tilde{c}=c/\tilde{R}^2. All three Eqs. (35), (A12) and (18) have the same asymptotic approximation for large c~\tilde{c} given in Eq. (19), as seen in Figure A1. In the discussion at the end of Sec. B we show that the value of ϵ\epsilon is insensitive to the target lengthscale ℓt\ell_t using an asymptotic calculation argument.

Figure A1. Comparison of the analytical (normalized) threshold ϵ∣Ω∣/(LR~)\epsilon\lvert\Omega\rvert/(L\tilde{R}) as a function of the (normalized) decay rate c~=c/R~2\tilde{c}=c/\tilde{R}^{2}, in 2D, using the conic filter, for the cases R~=ℓt\tilde{R}=\ell_t in blue (Eq. (18)), R~=23ℓt\tilde{R}=\frac{2}{3}\ell_t in orange (Eq. (35)}), and $\tilde{R}=2\ell_t$ in green (Eq. (A12)}), where ℓt\ell_t is the target lengthscale. The asymptotic approximation from Eq. (19) is shown as a red dashed line.

Derivations: PDE filters

In this section we derive the closed-form expressions of the thresholds ηe\eta_e and ηd\eta_d, the filtered and projected densities, and the asymptotic value of the geometric constraint threshold ϵ\epsilon, when the PDE filtering procedure (Lazarov and Sigmund 2011) is employed. Here, the filtered density ρ~\tilde{\rho} is obtained by solving the following modified

Helmholtz PDE:

[−(R~23)2Δ+1]ρ~=ρ,(37)\left[-\left(\frac{\tilde{R}}{2\sqrt{3}}\right)^2\Delta+1\right]\tilde{\rho}=\rho, \tag*{(37)}

where the parameter R~\tilde{R} plays a similar role as the filter radius of the conic filter. The resulting filtered density ρ~\tilde{\rho} can be written in terms of the free-space Green’s function k~R~\tilde{k}_{\tilde{R}} as the convolution ρ~=k~R~∗ρ\tilde{\rho}=\tilde{k}_{\tilde{R}}*\rho, where

k~R~(x)={3R~e−23R~∣x∣,in 1D,6πR~2K0(23R~∣x∣),in 2D,3πR~2∣x∣e−23R~∣x∣,in 3D,(38)\tilde{k}_{\tilde{R}}(x)= \begin{cases} \frac{\sqrt{3}}{\tilde{R}}e^{-\frac{2\sqrt{3}}{\tilde{R}}\lvert x\rvert}, & \text{in 1D},\\ \frac{6}{\pi\tilde{R}^{2}}K_0\left(\frac{2\sqrt{3}}{\tilde{R}}\lvert x\rvert\right), & \text{in 2D},\\ \frac{3}{\pi\tilde{R}^{2}\lvert x\rvert}e^{-\frac{2\sqrt{3}}{\tilde{R}}\lvert x\rvert}, & \text{in 3D}, \end{cases} \tag*{(38)}

where K0K_0 is the modified Bessel function of the second kind of order zero, which satisfies K0(r)∼−log⁡(r)K_0(r)\sim-\log(r) as r→0+r\to0^+ and K0(r)∼π2re−rK_0(r)\sim\sqrt{\frac{\pi}{2r}}e^{-r} as r→∞r\to\infty, and the normalization ensures that ∫k~R~=1\int\tilde{k}_{\tilde{R}}=1. The expression for ρ~\tilde{\rho} has an additional contribution coming from the boundary of the design region—due to boundary conditions, usually chosen as homogeneous Neumann boundary conditions—that we can neglect due to the exponential decay of the free-space Green’s function.

We now consider the simplified 1D setting presented in § 4.1 and in Figure 1a, in which the latent density ρ\rho consists of a 1D binary bump of width hh: ρ(x)=rect⁡(x/h)\rho(x)=\operatorname{rect}(x/h). This latent density is filtered using the 1D Green’s function of the PDE filter, k~R~(x)=3e−23R~∣x∣/R~\tilde{k}_{\tilde{R}}(x)=\sqrt{3}e^{-\frac{2\sqrt{3}}{\tilde{R}}\lvert x\rvert}/\tilde{R}, resulting in the filtered field:

ρ~(x)=(k~R~∗ρ)(x)(39)\tilde{\rho}(x)=\left(\tilde{k}_{\tilde{R}}*\rho\right)(x) \tag*{(39)}
=∫−h~/2h~/23e−23∣x~−t~∣ dt~(40)=\int_{-\tilde{h}/2}^{\tilde{h}/2}\sqrt{3}e^{-2\sqrt{3}\lvert\tilde{x}-\tilde{t}\rvert}\,\mathrm{d}\tilde{t} \tag*{(40)}
={1−e−3h~cosh⁡(23∣x~∣),∣x~∣∈[0,h~2),sinh⁡(3h~)e−23∣x~∣,∣x~∣∈[h~2,∞),(41)= \begin{cases} 1-e^{-\sqrt{3}\tilde{h}}\cosh\left(2\sqrt{3}\lvert\tilde{x}\rvert\right), & \lvert\tilde{x}\rvert\in\left[0,\frac{\tilde{h}}{2}\right),\\ \sinh\left(\sqrt{3}\tilde{h}\right)e^{-2\sqrt{3}\lvert\tilde{x}\rvert}, & \lvert\tilde{x}\rvert\in\left[\frac{\tilde{h}}{2},\infty\right), \end{cases} \tag*{(41)}

where we employed normalized units x~=x/R~\tilde{x}=x/\tilde{R} and h~=h/R~\tilde{h}=h/\tilde{R}. Now, we compute the projected density as a Heaviside projection (β=∞\beta=\infty), this is ρ^=H(ρ~−1/2)\hat{\rho}=H(\tilde{\rho}-1/2), which corresponds to a binary bump of width ww, ρ^(x)=rect⁡(x/w)\hat{\rho}(x)=\operatorname{rect}(x/w), where the (normalized) width w~=w/R~\tilde{w}=w/\tilde{R} can be computed in closed-form (by solving ρ~(w/2)=1/2\tilde{\rho}(w/2)=1/2) as a function of the (normalized) latent width h~\tilde{h}:

w~(h~)={0,h~∈[0,log⁡(2)3),13arccosh⁡(e3h~2),h~∈[log⁡(2)3,∞)(42)\tilde{w}(\tilde{h})= \begin{cases} 0, & \tilde{h}\in\left[0,\frac{\log(2)}{\sqrt{3}}\right),\\ \frac{1}{\sqrt{3}}\operatorname{arccosh}\left(\frac{e^{\sqrt{3}\tilde{h}}}{2}\right), & \tilde{h}\in\left[\frac{\log(2)}{\sqrt{3}},\infty\right) \end{cases} \tag*{(42)}

whereas the inverse relation is:

h~(w~)=13log⁡(2cosh⁡(3w~)),w~∈(0,∞).(43)\tilde{h}(\tilde{w})=\frac{1}{\sqrt{3}}\log\left(2\cosh\left(\sqrt{3}\tilde{w}\right)\right),\qquad\tilde{w}\in(0,\infty). \tag*{(43)}

We now proceed to derive the thresholds ηe\eta_e and ηd\eta_d, which differ from the thresholds of the conic filter case given in Eqs. (9) and (12). To compute the threshold ηe\eta_e of the solid constraint (Qian and Sigmund (2013)), we assume that the physical lengthscale ww of the feature equals the target lengthscale ℓt\ell_t to be imposed—this is w~=w/R~=ℓt/R~\tilde{w}=w/\tilde{R}=\ell_t/\tilde{R}—and then compute the maximum value of ρ~\tilde{\rho}, which occurs at x~=0\tilde{x}=0 and is given by

η~e(h~):=ρ~(0)=1−e−3h~,h~∈[0,∞),(44)\tilde{\eta}_e(\tilde{h}):=\tilde{\rho}(0)=1-e^{-\sqrt{3}\tilde{h}},\qquad\tilde{h}\in[0,\infty), \tag*{(44)}

where we employed Eq. (41). The threshold ηe\eta_e is then given by Eq. (44) but as a function of the physical width w~\tilde{w}, this is ηe(w~)=η~e(h~(w~))\eta_e(\tilde{w})=\tilde{\eta}_e\left(\tilde{h}(\tilde{w})\right), where h~(w~)\tilde{h}(\tilde{w}) is given in Eq. (43). This yields

ηe(ℓtR~)=1−12sech⁡(3ℓtR~),ℓtR~∈[0,∞).(45)\eta_e\left(\frac{\ell_t}{\tilde{R}}\right)=1-\frac{1}{2}\operatorname{sech}\left(\sqrt{3}\frac{\ell_t}{\tilde{R}}\right), \qquad\frac{\ell_t}{\tilde{R}}\in[0,\infty). \tag*{(45)}

Note that for the typical choice R~=ℓt\tilde{R}=\ell_t we have ηe≈0.8284\eta_e\approx0.8284, which is slightly different from the value ηe=0.75\eta_e=0.75 of the conic filter case (Eq. (9)). In Figure C2 we show a comparison between ηe(w~)\eta_e(\tilde{w}) for the conic and PDE filter cases. An analogous calculation for the void threshold leads to ηd=1−ηe\eta_d=1-\eta_e; explicitly,

Figure C2. Comparison of the threshold ηe\eta_e for the conic (Eq. (9)), PDE (Eq. (45)), and bi-PDE (Eq. (64)) filter cases, as a function of (normalized) target lengthscale ℓt/R~\ell_t/\widetilde{R}.

ηd(ℓtR~)=12sech⁡(3ℓtR~),ℓtR~∈[0,∞).(46)\eta_d\left(\frac{\ell_t}{\tilde{R}}\right)=\frac{1}{2}\operatorname{sech}\left(\sqrt{3}\frac{\ell_t}{\tilde{R}}\right), \qquad\frac{\ell_t}{\tilde{R}}\in[0,\infty). \tag*{(46)}

Given the correct thresholds, we proceed to derive ϵ\epsilon, where again we assume w~=w/R~=ℓt/R~\tilde{w}=w/\tilde{R}=\ell_t/\tilde{R}. Unlike the conic filter case, the expression for ϵ\epsilon cannot be written in closed-form, such as the one given in Eq. (18); instead, we provide an asymptotic expression, similar to Eq. (19) of the conic filter case, derived as follows. The solid structural function IsI^s of Eq. (8) indicates that the largest contribution of the constraint value comes from a neighborhood of x=0x=0, the point at which ρ~\tilde{\rho} achieves its maximum value. Expanding ρ~\tilde{\rho} (Eq. (41)) up to second order around this point yields

ρ~(x)=1−e−3h~cosh⁡(23∣x~∣)(47)\tilde{\rho}(x)=1-e^{-\sqrt{3}\tilde{h}}\cosh\left(2\sqrt{3}| \tilde{x}|\right) \tag*{(47)}
=(1−e−3h~)⏟η~e(h~)−6e−3h~⏟γ~(h~)x~2+O(x~4)(48)=\underbrace{\left(1-e^{-\sqrt{3}\tilde{h}}\right)}_{\tilde{\eta}_e(\tilde{h})}-\underbrace{6e^{-\sqrt{3}\tilde{h}}}_{\tilde{\gamma}(\tilde{h})}\tilde{x}^{2}+O(\tilde{x}^{4}) \tag*{(48)}
=ηe(w~)−3sech⁡(3w~)x~2+O(x~4),(49)=\eta_e(\tilde{w})-3\operatorname{sech}\left(\sqrt{3}\tilde{w}\right)\tilde{x}^{2}+O(\tilde{x}^{4}), \tag*{(49)}

for x≈0x\approx0, where we defined γ~(h~):=−12d2dx~2ρ~(0)=6e−3h~\tilde{\gamma}(\tilde{h}):=-\frac{1}{2}\frac{\mathrm{d}^{2}}{\mathrm{d}\tilde{x}^{2}}\tilde{\rho}(0)=6e^{-\sqrt{3}\tilde{h}} in the second line, and in the last line we replaced h~=h~(w~)\tilde{h}=\tilde{h}(\tilde{w}) using Eq. (43) and defined the correction factor γ(w~):=γ~(h~(w~))\gamma(\tilde{w}):=\tilde{\gamma}\left(\tilde{h}(\tilde{w})\right), given by

γ(ℓtR~)=3sech⁡(3ℓtR~),ℓtR~∈[0,∞),(50)\gamma\left(\frac{\ell_t}{\tilde{R}}\right)=3\operatorname{sech}\left(\sqrt{3}\frac{\ell_t}{\tilde{R}}\right), \qquad\frac{\ell_t}{\tilde{R}}\in[0,\infty), \tag*{(50)}

which will result relevant in the computation of ϵ\epsilon.

The value of ϵ\epsilon is given by the value of the geometric constraint when w=ℓtw=\ell_t (see § 4.1). Starting from Eq. (17), we have

ϵ=gs(ρ,ℓt)(51)\epsilon=g^s(\rho,\ell_t) \tag*{(51)}
=Ld−1R~∣Ω∣∫−∞∞ρ^(x~)e−c~2∣ddx~ρ~(x~)∣2[min⁡{ρ~(x~)−ηe(w~),0}]2dx~(52)=\frac{L^{d-1}\tilde{R}}{|\Omega|}\int_{-\infty}^{\infty}\hat{\rho}(\tilde{x})e^{-\frac{\tilde{c}}{2}\left|\frac{\mathrm{d}}{\mathrm{d}\tilde{x}}\tilde{\rho}(\tilde{x})\right|^2}\left[\min\{\tilde{\rho}(\tilde{x})-\eta_e(\tilde{w}),0\}\right]^2\mathrm{d}\tilde{x} \tag*{(52)}
≈Ld−1R~∣Ω∣∫−∞∞e−4c~(γ(w~))2x~2(γ(w~))2x~4dx~(53)\approx\frac{L^{d-1}\tilde{R}}{|\Omega|}\int_{-\infty}^{\infty}e^{-4\tilde{c}(\gamma(\tilde{w}))^2\tilde{x}^2}(\gamma(\tilde{w}))^2\tilde{x}^4\mathrm{d}\tilde{x} \tag*{(53)}
=Ld−1R~∣Ω∣3π128c~5/21(γ(w~))3,(54)=\frac{L^{d-1}\tilde{R}}{|\Omega|}\frac{3\sqrt{\pi}}{128\tilde{c}^{5/2}}\frac{1}{(\gamma(\tilde{w}))^3}, \tag*{(54)}

where in the second line we used normalized variables x~=x/R~\tilde{x}=x/\tilde{R} and c~=c/R~2\tilde{c}=c/\tilde{R}^{2}, in the third line we approximated ρ~\tilde{\rho} with its second-order expression around x=0x=0 (Eq. (49)) and ρ^(x~)=1\hat{\rho}(\tilde{x})=1, which is valid if c~\tilde{c} is large since then the most important contribution of the integral comes from a neighborhood around x~=0\tilde{x}=0, and finally, we performed the integration in the last line. This yields the approximation

ϵ≈Ld−1R~∣Ω∣3π128c~5/21(γ(ℓtR~))3,(55)\epsilon\approx\frac{L^{d-1}\tilde{R}}{|\Omega|}\frac{3\sqrt{\pi}}{128\tilde{c}^{5/2}}\frac{1}{\left(\gamma\left(\frac{\ell_t}{\tilde{R}}\right)\right)^3}, \tag*{(55)}

which is analogous to Eq. (19) for the conic filter case except for a correction factor (γ(ℓt/R~))−3\left(\gamma\left(\ell_t/\tilde{R}\right)\right)^{-3}, which is close to unity in the typical case R~=ℓt\tilde{R}=\ell_t since γ(1)≈1.03\gamma(1)\approx1.03. Note that a similar asymptotic analysis could have been used to derive the expression for ϵ\epsilon for the conic filter case in Eq. (19); it can be shown that this expression does not include a correction factor γconic(w~)=1\gamma_{\mathrm{conic}}(\tilde{w})=1 for w~<2\tilde{w}<2, as seen from Eqs. (30) and (31)—this explains why, in the conic filter case, the threshold ϵ\epsilon is insensitive to the target lengthscale ℓt\ell_t.

As discussed in § 4.2, we have found that the decay rate c=10R~2c=10\tilde{R}^{2} works well in our numerical examples, which is similar to the value suggested in Yang et al. (2019). This choice—and the estimates L/∣Ω∣1d≈1L/|\Omega|^{\frac{1}{d}}\approx1 and R~/∣Ω∣1d≈10−2\tilde{R}/|\Omega|^{\frac{1}{d}}\approx10^{-2} made in § 4.1—leads to ϵ≈(γ(ℓt/R~))−3⋅10−6\epsilon\approx\left(\gamma\left(\ell_t/\tilde{R}\right)\right)^{-3}\cdot10^{-6} according to Eq. (55).

Derivations: bi-PDE filters

As discussed in § 4.2, employing the PDE filter results in a filtered density that exhibits large spatial derivatives ∥∇xρ~(x)∥\lVert\nabla_{\mathbf{x}}\tilde{\rho}(\mathbf{x})\rVert—caused by the singular PDE Green’s function—and this poses challenges to the geometric constraints as well as to robust optimization [15]. It is desirable to have a PDE filtering scheme that alleviates these issues; this requires a higher-order and rotationally symmetric PDE with a well-behaved Green’s function. Analytically, our proposed “bi-PDE” filtering scheme consists of obtaining the filtered density ρ~\tilde{\rho} by solving the following fourth-order PDE:

[−(rR~)2Δ+1]2ρ~=ρ.(56)\left[-(r\tilde{R})^{2}\Delta+1\right]^{2}\tilde{\rho}=\rho. \tag*{(56)}

This is the composition of two modified Helmholtz PDEs, where R~\tilde{R} plays a similar role as the conic filter radius and rr is a dimensionless parameter used to adjust the spread of the Green’s function. Its Green’s function is given by Lazar et al. (2006):

k~R~(x)={rR~+∣x∣4r2R~2e−∣x∣rR~,in 1D,14πr3R~3K1(∣x∣rR~),in 2D,18πr3R~3e−∣x∣rR~,in 3D,(57)\tilde{k}_{\tilde{R}}(x)= \begin{cases} \dfrac{r\tilde{R}+|x|}{4r^{2}\tilde{R}^{2}}e^{-\frac{|x|}{r\tilde{R}}}, & \text{in 1D},\\ \dfrac{1}{4\pi r^{3}\tilde{R}^{3}}K_{1}\left(\dfrac{|x|}{r\tilde{R}}\right), & \text{in 2D},\\ \dfrac{1}{8\pi r^{3}\tilde{R}^{3}}e^{-\frac{|x|}{r\tilde{R}}}, & \text{in 3D}, \end{cases} \tag*{(57)}

where K1K_{1} is the modified Bessel function of the second kind of order one. We note that it is more regular than the Green’s function of the PDE filter (Eq. (38)): it is finite at the origin—indeed, k~R~(0)=(4πr2R~2)−1\tilde{k}_{\tilde{R}}(0)=(4\pi r^{2}\tilde{R}^{2})^{-1} in the 2D case—and all its derivatives are bounded; thus, the spatial derivatives of ρ~\tilde{\rho} are bounded as well. (As discussed in § 4.2, the convolution of two singular PDE Green’s functions leads to the smoother bi-PDE Green’s function.) We show a comparison between the conic, PDE and bi-PDE filters in Figure C3. The bi-PDE filter is the double application of the PDE filter of Sec. B with a different scaling. As such, in practice, the user may reuse existing PDE solver code by first solving

Figure C3. Comparison of the conic filter (Eq. (3)), the PDE filter (Eq. (38)), and the bi-PDE filter (Eq. (57)), as functions of radial distance ∣x∣|x|, for R~=1\widetilde{R}=1 and dimensions one and two. The 2D PDE filter exhibits a logarithmic singularity at the origin.

[−(rR~)2Δ+1]ρ~int=ρ\left[-(r\tilde{R})^{2}\Delta+1\right]\tilde{\rho}_{\mathrm{int}}=\rho

and then

[−(rR~)2Δ+1]ρ~=ρ~int,\left[-(r\tilde{R})^{2}\Delta+1\right]\tilde{\rho}=\tilde{\rho}_{\mathrm{int}},

where ρ~int\tilde{\rho}_{\mathrm{int}} is an intermediate variable. In all of our examples we employed the value r=r0r=r_{0} where

r0:=0.262266719739401,(58)r_{0}:=0.262266719739401, \tag*{(58)}

which we obtained numerically by minimizing the L2L^{2} error over R2\mathbb{R}^{2} between the 2D Green’s function of Eq. (57) and the 2D conic filter of Eq. (3).

We now proceed to derive the thresholds η~e\tilde{\eta}_{e} and ηd\eta_{d}, and the geometric constraint threshold ϵ\epsilon, as done in Sec. B. We consider the simplified 1D setting presented in § 4.1 and Figure 1a, in which the latent density ρ\rho is a 1D binary bump of width hh, ρ(x)=rect⁡(x/h)\rho(x)=\operatorname{rect}(x/h), which is filtered using the 1D Green’s function of Eq. (57), resulting in the filtered field:

ρ~(x)=(k~R~∗ρ)(x)={18re−h~+2∣x~∣2r(−h~−4r+8eh~2rr−e2∣x~∣r(h~+4r−2∣x~∣)−2∣x~∣),for ∣x~∣∈[0,h~2),18re−h~+2∣x~∣2r(−(1+eh~/r)h~+2(−1+eh~/r)(2r+∣x~∣)),for ∣x~∣∈[h~2,∞),(59)\tilde{\rho}(x)=\left(\tilde{k}_{\tilde{R}}*\rho\right)(x)= \begin{cases} \dfrac{1}{8r}e^{-\frac{\tilde{h}+2|\tilde{x}|}{2r}}\left(-\tilde{h}-4r+8e^{\frac{\tilde{h}}{2r}}r-e^{\frac{2|\tilde{x}|}{r}}(\tilde{h}+4r-2|\tilde{x}|)-2|\tilde{x}|\right), & \text{for }|\tilde{x}|\in\left[0,\dfrac{\tilde{h}}{2}\right),\\ \dfrac{1}{8r}e^{-\frac{\tilde{h}+2|\tilde{x}|}{2r}}\left(-(1+e^{\tilde{h}/r})\tilde{h}+2(-1+e^{\tilde{h}/r})(2r+|\tilde{x}|)\right), & \text{for }|\tilde{x}|\in\left[\dfrac{\tilde{h}}{2},\infty\right), \end{cases} \tag*{(59)}

where we are using normalized units x~=x/R~\tilde{x}=x/\tilde{R} and h~=h/R~\tilde{h}=h/\tilde{R}. The projected density is computed as a Heaviside projection (β=∞\beta=\infty), this is ρ~^=H(ρ~−1/2)\hat{\tilde{\rho}}=H(\tilde{\rho}-1/2), resulting in a binary bump with width ww, ρ~^(x)=rect⁡(x/w)\hat{\tilde{\rho}}(x)=\operatorname{rect}(x/w). There is no closed-form expression for the (normalized) latent width h~\tilde{h} as a function of the physical width w~\tilde{w}—it can only be obtained numerically. We have found, however, that the equation for h~(w~)\tilde{h}(\tilde{w}) of the PDE filter (Eq. (43)) plus a Gaussian correction term is a good approximation when r=r0r=r_{0}:

h~(w~)≈13log⁡(2cosh⁡(3w~))+Ae−Bw~2,(60)\tilde{h}(\tilde{w})\approx\frac{1}{\sqrt{3}}\log\left(2\cosh\left(\sqrt{3}\tilde{w}\right)\right)+Ae^{-B\tilde{w}^{2}}, \tag*{(60)}

for w~∈(0,∞)\tilde{w}\in(0,\infty) and r=r0r=r_{0}, where A=0.197548650630786A=0.197548650630786 and B=1.53827125650406B=1.53827125650406, which we fitted numerically. This approximation has a maximum absolute error of 10−310^{-3} over the range w~∈(0,2)\widetilde{w} \in(0,2), compared to an exact numerical computation.

To compute the thresholds ηe\eta_e and ηd\eta_d and the correction factor γ\gamma, we expand ρ~\widetilde{\rho} to second order around x=0x=0:

ρ~(x)=−18re−h~2r(2h~+8r−8eh~2r)−18r3e−h~2rh~ x~2+O(x~4),x≈0,(61)\widetilde{\rho}(x)=-\frac{1}{8r}e^{-\frac{\widetilde{h}}{2r}}\left(2\widetilde{h}+8r-8e^{\frac{\widetilde{h}}{2r}}\right)-\frac{1}{8r^3}e^{-\frac{\widetilde{h}}{2r}}\widetilde{h}\,\widetilde{x}^{2}+\mathcal{O}\left(\widetilde{x}^{4}\right),\qquad x\approx0, \tag*{(61)}

hence,

η~e(h~)=ρ~(0)=−18re−h~2r(2h~+8r−8eh~2r),(62)\widetilde{\eta}_e(\widetilde{h})=\widetilde{\rho}(0)=-\frac{1}{8r}e^{-\frac{\widetilde{h}}{2r}}\left(2\widetilde{h}+8r-8e^{\frac{\widetilde{h}}{2r}}\right), \tag*{(62)}
γ~(h~)=−12d2dx~2ρ~(0)=18r3e−h~2rh~.(63)\widetilde{\gamma}(\widetilde{h})=-\frac{1}{2}\frac{\mathrm{d}^{2}}{\mathrm{d}\widetilde{x}^{2}}\widetilde{\rho}(0)=\frac{1}{8r^{3}}e^{-\frac{\widetilde{h}}{2r}}\widetilde{h}. \tag*{(63)}

Then,

ηe(ℓtR~)=η~e(h~(ℓtR~)),(64)\eta_e\left(\frac{\ell_t}{\widetilde{R}}\right)=\widetilde{\eta}_e\left(\widetilde{h}\left(\frac{\ell_t}{\widetilde{R}}\right)\right), \tag*{(64)}
γ(ℓtR~)=γ~(h~(ℓtR~)),(65)\gamma\left(\frac{\ell_t}{\widetilde{R}}\right)=\widetilde{\gamma}\left(\widetilde{h}\left(\frac{\ell_t}{\widetilde{R}}\right)\right), \tag*{(65)}

and ηd=1−ηe\eta_d=1-\eta_e, where ℓt\ell_t is the target lengthscale and h~\widetilde{h} is approximated with Eq. (60) for the case r=r0r=r_0 from Eq. (58). For the typical case R~=ℓt\widetilde{R}=\ell_t we have ηe(1)≈0.733\eta_e(1)\approx0.733 and γ(1)≈0.973\gamma(1)\approx0.973, which are similar to the conic filter case values. In Figure C2 we show a comparison between ηe(w~)\eta_e(\widetilde{w}) of the conic, PDE, and bi-PDE filters.

Following the same derivation of Sec. B, the asymptotic expression for the geometric constraint threshold ϵ\epsilon is given in Eq. (55), with the correction factor γ\gamma given in Eq. (65). In all our numerical examples we employ the decay rate c=64R~2c=64\widetilde{R}^{2}, the same as in the conic filter case, and the approximation ϵ≈(γ(ℓtR~))−3⋅10−8\epsilon\approx\left(\gamma\left(\frac{\ell_t}{\widetilde{R}}\right)\right)^{-3}\cdot10^{-8}, obtained with the asymptotic approximation of ϵ\epsilon and the estimates L/∣Ω∣1d≈1L/|\Omega|^{\frac{1}{d}}\approx1 and R~/∣Ω∣1d≈10−2\widetilde{R}/|\Omega|^{\frac{1}{d}}\approx10^{-2} made in § 4.1.

Optimization details

In our examples of § 6, in the unconstrained optimization stage, we employed the CCSAQ algorithm to optimize the unconstrained designs. All examples in the same TO challenge (e.g., mode converter) share the same randomly initialized starting design. The filter radius was set equal to the target lengthscale of each example (R~=ℓt\widetilde{R}=\ell_t). In tables D1 and D2, we show the β\beta-scheduling that we used during the unconstrained optimization for each TO challenge—which includes the number of epochs, number of iterations per epoch, and projection steepness parameter β\beta used in each epoch. For the cavity example of § 6.4, we employed 25 epochs—each with 10 iterations, with a starting β=24\beta= 24 that is multiplied by 1.2 in each epoch—and a final 26th epoch of 20 iterations with β=∞\beta= \infty. Importantly, in the optimizer settings we set a relative tolerance of 10−610^{-6}, which causes some examples to terminate their unconstrained optimization early, before reaching the prescribed number of iterations indicated in this section.

Supplementary Information

This work includes supplementary material.

Declarations

Conflict of interest

The authors declare that they have no conflict of interest.

Funding

This work was supported in part by the U.S. Army Research Office through the Institute for Soldier Nanotechnologies (Award No. W911NF-23-2-0121) and by the Simons Foundation through the Simons Collaboration on Extreme Wave Phenomena Based on Symmetries.

Ethics approval

The authors declare that there are no ethical issues involved in this research.

The authors declare that they all consented to participate in this research.

Data availability

All data are included in the article and its supplementary materials.

Replication of results

Detailed descriptions of the simulations and computational methods are included to ensure reproducibility. The differentiable thermal solver employed in the heat-transfer example is planned for public release in the near future.

Author Contributions

Computational simulations and derivations were carried out by Rodrigo Arrieta. Giuseppe Romano was responsible for the numerical simulation of the heat-transfer example. Steven G. Johnson supervised the research. Rodrigo Arrieta prepared the initial draft of the manuscript. All authors contributed to manuscript revision and approved the final version.

References

Table D1 Continuation scheme of β\beta used in the unconstrained optimization stage, for the mode converter § 6.1, wavelength demultiplexer § 6.3, and heat-transfer problem § 6.5 examples.

ExampleParameter01234567
Mode converterβ\beta81630∞\infty
No. of iter.202020100
Wavelength demultiplexerβ\beta4816306090∞\infty
No. of iter.252525255050100
Heat-transfer problemβ\beta8163264
No. of iter.30303030

Table D1. Continuation scheme of β\beta used in the unconstrained optimization stage, for the mode converter (Sec. 6.1), wavelength demultiplexer (Sec. 6.3), and heat-transfer problem (Sec. 6.5) examples.

Table D2 Continuation scheme of β\beta used in the unconstrained optimization stage, for the beam splitter example § 6.2.

Beam splitter exampleParameter01234567
Defaultβ\beta8163060∞\infty
No. of iter.20202020100
Conic and PDE filters, large lengthscale (16 pix.)β\beta8163060120240∞\infty
No. of iter.20202030303050
PDE filter, medium lengthscale (8 pix.)β\beta8163060∞\infty
No. of iter.20202020200
Bi-PDE filter, large lengthscale (16 pix.)β\beta8163060120240∞\infty
No. of iter.202030505050200

Table D2. Continuation scheme of β\beta used in the unconstrained optimization stage, for the beam splitter example (Sec. 6.2).

References

  1. [1]Martinez de Aguirre Jokisch B, Christiansen RE, Sigmund O (2024a) Topology optimization framework for designing efficient thermo-optical phase shifters. J Opt Soc Am B 41(2):A18–A31. https://doi.org/10.1364/JOSAB.499979
  2. [4]Andkjær J, Johansen VE, Friis KS, Sigmund O (2014) Inverse design of nanostructured surfaces for color effects. JOSA B 31(1):164–174. https://doi.org/10.1364/JOSAB.31.000164, publisher: Optica Publishing Group
  3. [5]Bendsøe MP (1989) Optimal shape design as a material distribution problem. Structural optimization 1(4):193–202. https://doi.org/10.1007/BF01650949
  4. [6]Bendsøe MP, Kikuchi N (1988) Generating optimal topologies in structural design using a homogenization method. Computer Methods in Applied Mechanics and Engineering 71(2):197–224. https://doi.org/10.1016/0045-7825(88)90086-2
  5. [7]Bertsekas D (2016) Nonlinear programming. Athena Scientific
  6. [8]Bourdin B (2001) Filters in topology optimization. International Journal for Numerical Methods in Engineering 50(9):2143–2158. https://doi.org/10.1002/nme.116
  7. [9]Bruns TE, Tortorelli DA (2001) Topology optimization of non-linear elastic structures and compliant mechanisms. Computer Methods in Applied Mechanics and Engineering 190(26):3443–3459. https: //doi.org/10.1016/S0045-7825(00)00278-4
  8. [10]Byrd RH, Nocedal J, Waltz RA (2006) Knitro: An Integrated Package for Nonlinear Optimization, Springer US, Boston, MA, pp 35–59. https://doi.org/10.1007/0-387-30065-1_4
  9. [11]Carstensen JV, Guest JK (2018) Projection-based two-phase minimum and maximum length scale control in topology optimization. Structural and Multidisciplinary Optimization 58(5):1845–1860. https://doi.org/10.1007/s00158-018-2066-4
  10. [12]Chen M, Christiansen RE, Fan JA, Işıklar G, Jiang J, Johnson SG, Ma W, Miller OD, Oskooi A, Schubert MF, Wang F, Williamson IAD, Xue W, Zhou Y (2024) Validation and characterization of algorithms and software for photonics inverse design. Journal of the Optical Society of America B 41(2):A161. https://doi.org/10.1364/JOSAB.506412
  11. [13]Chen M, Chan KF, Hammond AM, Chan CH, Johnson SG (2025) Inverse design of 3d-printable metalenses with complementary dispersion for terahertz imaging. ACS Photonics https://doi.org/10.1021/acsphotonics.5c00366
  12. [14]Christiansen RE (2023) Inverse design of optical mode converters by topology optimization: tutorial. Journal of Optics 25(8):083501. https://doi.org/10.1088/2040-8986/accbdbd
  13. [15]Christiansen RE, Lazarov BS, Jensen JS, Sigmund O (2015) Creating geometrically robust designs for highly sensitive problems using topology optimization. Structural and Multidisciplinary Optimization 52(4):737–754. https://doi.org/10.1007/s00158-015-1265-5
  14. [16]Christiansen RE, Vester-Petersen J, Madsen SP, Sigmund O (2019) A non-linear material interpolation for design of metallic nano-particles using topology optimization. Computer Methods in Applied Mechanics and Engineering 343:23–39. https://doi.org/10.1016/j.cma.2018.08.034

Paper details

vlnc:W_hsvur45c
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 8

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents