This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Singularity swap quadrature for nearly singular line integrals on closed curves in two dimensions

Ludvig af Klinteberg E-mail: [email protected] Department of Mathematics and Physics,
Mälardalen University,
Västerås, Sweden
Abstract

This paper presents a quadrature method for evaluating layer potentials in two dimensions close to periodic boundaries, discretized using the trapezoidal rule. It is an extension of the method of singularity swap quadrature, which recently was introduced for boundaries discretized using composite Gauss-Legendre quadrature. The original method builds on swapping the target singularity for its preimage in the complexified space of the curve parametrization, where the source panel is flat. This allows the integral to be efficiently evaluated using an interpolatory quadrature with a monomial basis. In this extension, we use the target preimage to swap the singularity to a point close to the unit circle. This allows us to evaluate the integral using an interpolatory quadrature with complex exponential basis functions. This is well-conditioned, and can be efficiently evaluated using the fast Fourier transform. The resulting method has exponential convergence, and can be used to accurately evaluate layer potentials close to the source geometry. We report experimental results on a simple test geometry, and provide a baseline Julia implementation that can be used for further experimentation.

1 Introduction

In integral equation methods, one of the long-standing challenges is the evaluation of layer potentials for targets points close to the source geometry. The integrals by which these layer potentials are computed are referred to as nearly singular, since the integrand is evaluated close to a singularity. This near singularity reduces the smoothness of the integrand, thereby severely reducing the accuracy of common quadrature rules such as Gauss-Legendre and the trapezoidal rule. To tackle this, many specialized quadrature methods have been proposed for the case of the domain being a one-dimensional line. For panel-based Gauss-Legendre quadrature in the plane, the high-order method of [7] (often referred to as the Helsing-Ojala method) is efficient and well-established. For the trapezoidal rule, which is exponentially convergent on a closed curve, several fixed-order methods have been proposed that reduce the impact of the near singularity by means of a local correction, see e.g. [5, 6, 8]. In addition, exponentially convergenent near evaluation is available through the “globally compensated” quadrature method introduced in [7] and extended in [3].

Recently, the method of singularity swap quadrature (SSQ) was proposed in [1]. The method evaluates nearly singular line quadratures in two and three dimensions by first “swapping” the singularity from the target point in the plane to the preimage of the target point in the curve’s parameterization. After the swap, the integral can be evaluated using interpolatory quadrature with a monomial basis, following the method of [7]. This was shown to improve the accuracy for curved panels compared to [7], and allowed the method to be extended to line integrals in three dimensions.

The SSQ method was in [1] described for curves discretized using panel-based Gauss-Legendre quadrature. In this brief follow-up, we show how the method can be extended to closed curves in the plane that have been discretized using the trapezoidal rule, resulting in a global correction with exponential convergence. In doing so, we assume that the reader has at least some familiarity with the original method.

2 Method

Since we are considering the problem in two dimensions, let us identify 2\mathbb{R}^{2} with \mathbb{C}, and let Γ\Gamma be a closed curve parameterized by a smooth function γ(t)=g1(t)+ig2(t)\gamma(t)=g_{1}(t)+ig_{2}(t), with t[0,2π)t\in[0,2\pi). Furthermore, let σ\sigma be a smooth function defined on Γ\Gamma, which we will refer to as the density. For a point zz\in\mathbb{C}, typically lying close to Γ\Gamma, our integrals of interest are here

IL\displaystyle I_{L} =IL(z):=Γσlog|τz||dτ|,\displaystyle=I_{L}(z)\mathrel{\mathop{\mathchar 58\relax}}=\oint_{\Gamma}\sigma\log\mathinner{\!\left\lvert\tau-z\right\rvert}\mathinner{\!\left\lvert\operatorname{d\!}\tau\right\rvert}, (1)
Im\displaystyle I_{m} =Im(z):=Γσdτ(τz)m,m=1,2,.\displaystyle=I_{m}(z)\mathrel{\mathop{\mathchar 58\relax}}=\oint_{\Gamma}\frac{\sigma\operatorname{d\!}\tau}{(\tau-z)^{m}},\qquad m=1,2,\dots. (2)

Being periodic, these integrals are suitable for discretization using an N-point trapezoidal rule, due to its exponential convergence [9]. The quadrature nodes are then γ(tj)\gamma(t_{j}), j=0,,N1j=0,\dots,N-1, with tj=2πj/Nt_{j}=2\pi j/N and the quadrature weights wj=2π/Nw_{j}=2\pi/N. We will now outline how these discretized integrals can be evaluated using SSQ. Throughout, we will assume that we only have access to the discrete values of the functions σ\sigma, γ\gamma and γ\gamma^{\prime} at the nodes, and not to their analytic definitions.

2.1 The Cauchy integral

We begin with the simplest (and perhaps most common) case, the Cauchy integral,

I1(z)\displaystyle I_{1}(z) =Γσdττz=02πσ(t)γ(t)dtγ(t)z.\displaystyle=\oint_{\Gamma}\frac{\sigma\operatorname{d\!}\tau}{\tau-z}=\int_{0}^{2\pi}\frac{\sigma(t)\gamma^{\prime}(t)\operatorname{d\!}t}{\gamma(t)-z}. (3)

Let us now assume that zz is close to Γ\Gamma, which corresponds to the integrand in (3) having a singularity close to the real line at the preimage tt^{*}\in\mathbb{C} such that

γ(t)=z.\displaystyle\gamma(t^{*})=z. (4)

In [4] and [2], it is shown that this significantly reduces the convergence rate of the trapezoidal rule, with the error being proportional to eN|Imt|e^{-N|\operatorname{Im}{t^{*}}|}. In order to reduce the error for small Imt\operatorname{Im}t^{*}, we will now show how to evaluate I1(z)I_{1}(z) using SSQ.

Step one is to find the preimage tt^{*}, using Newton’s method applied to a Fourier expansion of γ\gamma. We apply a Fast Fourier Transform (FFT) to the node values γ(t0),,γ(tN1)\gamma(t_{0}),\dots,\gamma(t_{N-1}) to get the truncated Fourier series

γ(t)\displaystyle\gamma(t) k=KKγ^keikt,\displaystyle\approx\sum_{k=-K}^{K}\hat{\gamma}_{k}e^{ikt}, (5)
γ(t)\displaystyle\gamma^{\prime}(t) k=KKikγ^keikt,\displaystyle\approx\sum_{k=-K}^{K}ik\hat{\gamma}_{k}e^{ikt}, (6)

where K=N12K=\frac{N-1}{2}, assuming NN odd, and γ^k=[γ](k)\hat{\gamma}_{k}=\mathcal{F}[\gamma](k) are the Fourier coefficients of γ\gamma. This has a one-time cost of 𝒪(NlogN)\mathcal{O}(N\log N), for a given discretization. Substituting this expansion into (4), we can find tt^{*} at an 𝒪(N)\mathcal{O}(N) cost using Newton’s method (assuming 𝒪(1)\mathcal{O}(1) iterations to convergence). A good initial guess for tt^{*} is the corresponding tt-value of the grid point on Γ\Gamma that is closest to zz,

targmintj|γ(tj)z|.\displaystyle t^{*}\approx\underset{t_{j}}{\operatorname{arg\,min}}\mathinner{\!\left\lvert\gamma(t_{j})-z\right\rvert}. (7)

We assume that Γ\Gamma is parametrized in a counter-clockwise direction, so that Imt>0\operatorname{Im}t^{*}>0 implies zz interior to Γ\Gamma, and vice versa.

Step two is to swap out the singularity using a function that regularizes the integrand, and leads to an integrable singularity. Contrary to the Gauss-Legendre panel case, we can not regularize the denominator (γ(t)γ(t))1\left(\gamma(t)-\gamma(t^{*})\right)^{-1} using the factor (tt)(t-t^{*}), as the latter is not periodic. Instead, we use (eiteit)(e^{it}-e^{it^{*}}), which corresponds to swapping the singularity to a point close to the unit circle (this will be evident shortly). Then,

I1(z)\displaystyle I_{1}(z) =02πσ(t)γ(t)(eiteit)γ(t)γ(t)f(t,t)dteiteit.\displaystyle=\int_{0}^{2\pi}\underbrace{\frac{\sigma(t)\gamma^{\prime}(t)\left(e^{it}-e^{it^{*}}\right)}{\gamma(t)-\gamma(t^{*})}}_{f(t,t^{*})}\frac{\operatorname{d\!}t}{e^{it}-e^{it^{*}}}. (8)

The function ff is now the original integrand with the singularity at tt^{*} removed, and we expect it to be smooth. Since its values are known at the equidistant nodes t0,,tN1t_{0},\dots,t_{N-1}, we use an FFT to compute its truncated Fourier series (at an 𝒪(NlogN)\mathcal{O}(N\log N) cost), such that

I1(z)\displaystyle I_{1}(z) k=KKf^k(t)02πeiktdteiteitpk(t)=𝒇^𝒑.\displaystyle\approx\sum_{k=-K}^{K}\hat{f}_{k}(t^{*})\underbrace{\int_{0}^{2\pi}\frac{e^{ikt}\operatorname{d\!}t}{e^{it}-e^{it^{*}}}}_{p_{k}(t^{*})}=\bm{\hat{f}}\cdot\bm{p}. (9)

This can be interpreted as our integral being approximated by an interpolatory quadrature on the unit circle, which we can evaluate to high accuracy as long as the coefficients f^k\hat{f}_{k} decay sufficiently fast. The integrals pkp_{k} can be evaluated analytically (at an 𝒪(N)\mathcal{O}(N) cost) by rewriting them as contour integrals on the unit circle SS. Let

ξ(t)\displaystyle\xi(t) =eit,\displaystyle=e^{it}, (10)
ξ(t)\displaystyle\xi^{\prime}(t) =ieit,\displaystyle=ie^{it}, (11)
ζ\displaystyle\zeta =eit.\displaystyle=e^{it^{*}}. (12)

Then eikt=ξ(t)ke^{ikt}=\xi(t)^{k} and

pk(t)\displaystyle p_{k}(t^{*}) =1i02πei(k1)tieitdteiteit\displaystyle=\frac{1}{i}\int_{0}^{2\pi}\frac{e^{i(k-1)t}ie^{it}\operatorname{d\!}t}{e^{it}-e^{it^{*}}} (13)
=1i02πξ(t)k1ξ(t)dtξ(t)ζ\displaystyle=\frac{1}{i}\int_{0}^{2\pi}\frac{\xi(t)^{k-1}\xi^{\prime}(t)\operatorname{d\!}t}{\xi(t)-\zeta} (14)
=1iSξk1dξξζ.\displaystyle=\frac{1}{i}\oint_{S}\frac{\xi^{k-1}\operatorname{d\!}\xi}{\xi-\zeta}. (15)

We can evaluate this integral using the residue theorem. If |ζ|<1|\zeta|<1 (or equivalently Imt>0\operatorname{Im}t^{*}>0, corresponding to zz being an interior point), then the integrand has a simple pole at ζ\zeta, with residue

Res[ξk1ξζ,ζ]=ζk1, if |ζ|<1.\displaystyle\operatorname{Res}\left[\frac{\xi^{k-1}}{\xi-\zeta},\zeta\right]=\zeta^{k-1},\quad\mbox{ if }|\zeta|<1. (16)

In addition, if k0k\leq 0, then the integrand has a pole of order 1k1-k at the origin, with residue

Res[ξk1ξζ,0]=ζk1, if k0.\displaystyle\operatorname{Res}\left[\frac{\xi^{k-1}}{\xi-\zeta},0\right]=-\zeta^{k-1},\quad\mbox{ if }k\leq 0. (17)

The two residues cancel for k0k\leq 0 and |ζ|<1|\zeta|<1 (i.e. Imt>0\operatorname{Im}t^{*}>0), so we get

pk(t)=2πei(k1)t{1,if Imt>0 and k1,1,if Imt<0 and k0,0,otherwise.\displaystyle p_{k}(t^{*})=2\pi e^{i(k-1)t^{*}}\begin{cases}1,&\text{if }\operatorname{Im}t^{*}>0\text{ and }k\geq 1,\\ -1,&\text{if }\operatorname{Im}t^{*}<0\text{ and }k\leq 0,\\ 0,&\text{otherwise}.\end{cases} (18)

This completes the method, which has a total cost of 𝒪(N+NlogN)\mathcal{O}(N+N\log N) per target point.

The method can perhaps be understood in terms of Fourier coefficents. The accuracy of the trapezoidal rule depends on the regularity of the integrand, which in term is reflected in the decay of the Fourier coefficients of the integrand. As seen in fig. 1, these appear to decay as e|kImt|e^{-|k\operatorname{Im}t^{*}|}. In constrast, the coefficients f^k(t)\hat{f}_{k}(t^{*}) decay rapidly and with a rate that stays nearly constant as zΓz\to\Gamma.

Refer to caption
(a) t=1+0.05it^{*}=1+0.05i
Refer to caption
(b) t=1+0.005it^{*}=1+0.005i
Figure 1: Example results for the Cauchy integral on the starfish geometry and density from section 3.2, for two different tt^{*}. The Fourier coefficients of the integrand in (3) decay approximately as ρ|k|\rho^{-|k|}, where ρ=e|Imt0|\rho=e^{|\operatorname{Im}t_{0}|}, which gets very slow as zΓz\to\Gamma. On the other hand, the coefficients of the regularized function ff in (9) decay with a rate that changes little as zΓz\to\Gamma.

A weakness of the method is that in order to find tt^{*}, one must evaluate the analytic continuation of γ\gamma using a truncated Fourier series, which naturally is most accurate close to Γ\Gamma. For zz far away from Γ\Gamma the rootfinding process will struggle, and the accuracy of SSQ can deteriorate. However, this happens at ranges where the base trapezoidal rule is sufficiently accurate.

Remark 1

The reader may note that one could in fact apply a variant of the Helsing-Ojala quadrature directly to (3). First solve interpolation problem

k=KKckτik=σi,i=0,,N1,\displaystyle\sum_{k=-K}^{K}c_{k}\tau_{i}^{k}=\sigma_{i},\quad i=0,\dots,N-1, (19)

where τi=γ(ti)\tau_{i}=\gamma(t_{i}) and σi=γ(ti)\sigma_{i}=\gamma(t_{i}). Then evaluate the layer potential as

I1(z)=k=KKckΓτkdττz,\displaystyle I_{1}(z)=\sum_{k=-K}^{K}c_{k}\oint_{\Gamma}\frac{\tau^{k}\operatorname{d\!}\tau}{\tau-z}, (20)

where the integrals can be exactly evaluated using residue calculus, just as is done above for the unit circle. This will in fact work perfectly fine for some geometries (the unit circle in particular), but the interpolation problem can be severely ill-conditioned in a way that is hard to control, since it depends on the geometry itself. This could potentially be investigated further, but that is deemed beyond the scope of this work.

2.2 Higher order integrals

For higher order integrals (m>1m>1), we have

Im(z)\displaystyle I_{m}(z) =Γσdτ(τz)m=02πσ(t)γ(t)dt(γ(t)z)m,m+.\displaystyle=\oint_{\Gamma}\frac{\sigma\operatorname{d\!}\tau}{\left(\tau-z\right)^{m}}=\int_{0}^{2\pi}\frac{\sigma(t)\gamma^{\prime}(t)\operatorname{d\!}t}{(\gamma(t)-z)^{m}},\quad m\in\mathbb{Z}^{+}. (21)

Evaluating this integral with SSQ is completely analogous to the case when m=1m=1, with the difference that we instead regularize with (eiteit)m(e^{it}-e^{it^{*}})^{m}, such that

f(t,t)=σ(t)γ(t)(eiteitγ(t)γ(t))m.\displaystyle f(t,t^{*})=\sigma(t)\gamma^{\prime}(t)\left(\frac{e^{it}-e^{it^{*}}}{\gamma(t)-\gamma(t^{*})}\right)^{m}. (22)

We then need expressions for the integrals

pkm(t)=1iSξk1dξ(ξζ)m.\displaystyle p_{k}^{m}(t^{*})=\frac{1}{i}\oint_{S}\frac{\xi^{k-1}\operatorname{d\!}\xi}{\left(\xi-\zeta\right)^{m}}. (23)

Evaluating the residues in the same way as for the m=1m=1 case, we get the general expression for integer m1m\geq 1,

pk(t)=2πj=1m1(kj)(m1)!ei(km)t{1,if Imt>0 and km,1,if Imt<0 and k0,0,otherwise.\displaystyle p_{k}(t^{*})=2\pi\frac{\prod_{j=1}^{m-1}(k-j)}{(m-1)!}e^{i(k-m)t^{*}}\begin{cases}1,&\text{if }\operatorname{Im}t^{*}>0\text{ and }k\geq m,\\ -1,&\text{if }\operatorname{Im}t^{*}<0\text{ and }k\leq 0,\\ 0,&\text{otherwise}.\end{cases} (24)

2.3 Log kernel

Consider now the log integral, also known as the Laplace single-layer potential, for a real-valued density σ\sigma,

IL(z)\displaystyle I_{L}(z) =Γσlog|τz||dτ|\displaystyle=\oint_{\Gamma}\sigma\log|\tau-z|\>|\operatorname{d\!}\tau| (25)
=02πσ(t)|γ|f(t)log|γ(t)z|dt,\displaystyle=\int_{0}^{2\pi}\underbrace{\sigma(t)|\gamma^{\prime}|}_{f(t)}\log|\gamma(t)-z|\operatorname{d\!}t, (26)

where ff is assumed to be a smooth function. Proceeding in a similar fashion as before, we find tt^{*} and separate the integral as

IL(z)=02πf(t)(log|γ(t)z|log|eiteit|)dt+02πf(t)log|eiteit|dt.\displaystyle I_{L}(z)=\int_{0}^{2\pi}f(t)\left(\log|\gamma(t)-z|-\log|e^{it}-e^{it^{*}}|\right)\operatorname{d\!}t+\int_{0}^{2\pi}f(t)\log|e^{it}-e^{it^{*}}|\operatorname{d\!}t. (27)

The first integral is now regularized, and can be evaluated using the trapezoidal rule. The second integral we rewrite using a truncated Fourier series and the relation log|r|=Relogr\log|r|=\operatorname{Re}\log r, such that we can evaluate it using SSQ,

02πf(t)log|eiteit|dtRek=N/2N/2f^k02πeiktlog(eikteikt)dtqk(t)=𝒇^𝒒.\displaystyle\int_{0}^{2\pi}f(t)\log|e^{it}-e^{it^{*}}|\operatorname{d\!}t\approx\operatorname{Re}\sum_{k=-N/2}^{N/2}\hat{f}_{k}\underbrace{\int_{0}^{2\pi}e^{ikt}\log(e^{ikt}-e^{ikt^{*}})\operatorname{d\!}t}_{q_{k}(t^{*})}=\bm{\hat{f}}\cdot\bm{q}. (28)

Just as with pkp_{k}, the integrals qkq_{k} can be transformed into integrals on the unit circle,

qk(t)=1iSξk1log(ξζ)dξ.\displaystyle q_{k}(t^{*})=\frac{1}{i}\int_{S}\xi^{k-1}\log(\xi-\zeta)\operatorname{d\!}\xi. (29)

Note that this is not necessarily a closed contour integral, as there is a branch cut in the complex logarithm that needs to be taken into account. We will now show to evaluate qk(t)q_{k}(t^{*}) depending on the sign of Imt\operatorname{Im}t^{*}.

2.3.1 Imt<0\operatorname{Im}t^{*}<0

Beginning with the case |ζ|>1|\zeta|>1 (or Imt<0\operatorname{Im}t^{*}<0), we note that ξζ0\xi-\zeta\neq 0 on the entire unit disc. We can therefore choose the branch cut of the complex logarithm such that it never intersects the unit circle. This choice allows us to evaluate the integral in (29) as a contour integral on the unit circle, with a possible pole of order 1k1-k at the origin,

12πiSξk1log(ξζ)dξ=Res[ξk1log(ξζ),0]={ζk/k if k<0,log(ζ) if k=0,0 if k>0.\displaystyle\frac{1}{2\pi i}\oint_{S}\xi^{k-1}\log(\xi-\zeta)\operatorname{d\!}\xi=\operatorname{Res}\left[\xi^{k-1}\log(\xi-\zeta),0\right]=\begin{cases}\zeta^{k}/k&\text{ if }k<0,\\ \log(-\zeta)&\text{ if }k=0,\\ 0&\text{ if }k>0.\end{cases} (30)

Since f^0\hat{f}_{0}\in\mathbb{R}, we only need the real part of qkq_{k} at k=0k=0. We then have that 𝒒\bm{q} is for Imt<0\operatorname{Im}t^{*}<0 computed as

qk(t)=2π{1keikt if k<0,Imt if k=0,0 if k>0.\displaystyle q_{k}(t^{*})=2\pi\begin{cases}\frac{1}{k}e^{ikt^{*}}&\text{ if }k<0,\\ -\operatorname{Im}t^{*}&\text{ if }k=0,\\ 0&\text{ if }k>0.\end{cases} (31)

2.3.2 Imt>0\operatorname{Im}t^{*}>0

We are now left with the case |ζ|<1|\zeta|<1 (or Imt>0\operatorname{Im}t^{*}>0). Here, ξζ=0\xi-\zeta=0 at at point on the unit disk, so the integral of log(ξζ)\log(\xi-\zeta) on the unit circle must intersect the branch cut in the ξ\xi plane going from ζ\zeta to infinity. We choose the branch cut such that it passes through the point ξ=1\xi=1. We define 1+1^{+} and 11^{-} to be the limits approaching 11 from above and below in the plane, such that

log(1ζ)=log(1+ζ)+2πi.\displaystyle\log(1^{-}-\zeta)=\log(1^{+}-\zeta)+2\pi i. (32)

Then the integral on the unit circle SS is,

qk(t)=1i1+1ξk1log(ξζ)dξ.\displaystyle q_{k}(t^{*})=\frac{1}{i}\int_{1^{+}}^{1^{-}}\xi^{k-1}\log(\xi-\zeta)\operatorname{d\!}\xi. (33)

In order to evaluate this, we let CC be the closed contour following the unit circle from 1+1^{+} to 11^{-}, then going from 11^{-} to ζ\zeta on the negative side of the branch cut, and then going from ζ\zeta to 1+1^{+} on the positive side of the branch cut,

C=1+1+1ζ+ζ1+.\displaystyle\oint_{C}=\int_{1^{+}}^{1^{-}}+\int_{1^{-}}^{\zeta}+\int_{\zeta}^{1^{+}}. (34)

The integrand is analytic inside CC, except for a pole of order 1k1-k at the origin when k0k\leq 0, with residue given by (30). The integrals along the branch cut are

1ζ+ζ1+\displaystyle\int_{1^{-}}^{\zeta}+\int_{\zeta}^{1^{+}} =1ζξk1(log(ξζ)+2πi)dξ+ζ1ξk1log(ξζ)dξ\displaystyle=\int_{1}^{\zeta}\xi^{k-1}\left(\log(\xi-\zeta)+2\pi i\right)\operatorname{d\!}\xi+\int_{\zeta}^{1}\xi^{k-1}\log(\xi-\zeta)\operatorname{d\!}\xi (35)
=2πi{log(ζ) if k=0,(ζk1)/k otherwise.\displaystyle=2\pi i\begin{cases}\log(\zeta)&\text{ if }k=0,\\ (\zeta^{k}-1)/k&\text{ otherwise}.\end{cases} (36)

Combining the results, and just as before keeping only the real part of the k=0k=0 integral, we arrive at the final results for Imt>0\operatorname{Im}t^{*}>0,

qk(t)=2πk{1 if k<0,0 if k=0,(1eikt) if k>0.\displaystyle q_{k}(t^{*})=\frac{2\pi}{k}\begin{cases}1&\text{ if }k<0,\\ 0&\text{ if }k=0,\\ (1-e^{ikt^{*}})&\text{ if }k>0.\end{cases} (37)

3 Experiments

In order to demonstrate the method outlined above, we here report experimental results for the by now well-known “starfish” geometry γ(t)=(1+0.3cos5t)eit\gamma(t)=(1+0.3\cos 5t)e^{it}. The method has been implemented in Julia, and is available online as open source together with the scripts that produce the numerical in this manuscript111https://github.com/ludvigak/TrapzSSQ.jl.

3.1 Laplace double layer potential

As a first demonstration, we reuse the Laplace test problem from [1]. That is, we evaluate the solution to the Laplace equation Δu=0\Delta u=0 in the domain bounded by Γ\Gamma, with boundary condition u=ue(z)=log|3+3iz|u=u_{e}(z)=\log\mathinner{\!\left\lvert 3+3i-z\right\rvert}. The solution to this problem can be represented using the Laplace double layer potential (DLP) u(z)=ImI1(z)u(z)=\operatorname{Im}I_{1}(z), which leads to a second-kind integral equation in the real-valued density σ\sigma. Once this integral equation is solved, the layer potential u(z)u(z) can be evaluated in the domain using quadrature, and compared to the exact solution ue(z)u_{e}(z).

Refer to caption
(a) Trapezoidal rule, Emax=𝒪(1)E_{\max}=\mathcal{O}(1)
Refer to caption
(b) SSQ, Emax=71013E_{\max}=7\cdot 10^{-13}
Figure 2: Error in the Laplace double layer potential on a domain with N=400N=400 points on the boundary, comparison between the trapezoidal rule and SSQ.

In fig. 2 we show results for the Laplace DLP when Γ\Gamma is discretized using N=400N=400 points that are equidistant in the parametrization tt. The layer potential is evaluated using the trapezoidal rule on a 400×400400\times 400 grid inside the domain, but for points close to the boundary we also evaluate using SSQ and compare the results. As expected, evaluation using the trapezoidal rule leads to 𝒪(1)\mathcal{O}(1) errors near the boundary, while SSQ is accurate at all points where it is used. However, full machine precision accuracy is not recovered; the maximum error in SSQ close to the boundary is 𝒪(1013)\mathcal{O}(10^{-13}).

3.2 Convergence

For a more systematic investigation of the method, we create the following setup. Let Γ\Gamma be the starfish domain from the previous section, and discretize it using NN points. We then create 100 evaluation points as z=γ(t)z=\gamma(t^{*}), where Ret[0,2π)\operatorname{Re}t^{*}\in[0,2\pi) and Imt=d\operatorname{Im}t^{*}=d. In order to test points both interior and exterior to Γ\Gamma, we use d={±0.01,±0.02,±0.04}d=\{\pm 0.01,\pm 0.02,\pm 0.04\}. For a range of NN, we then compute the integrals IL,I1,I2,I3I_{L},I_{1},I_{2},I_{3} using both trapezoidal and singularity swap quadrature, and for each NN save the maximum error across all zz. The density σ\sigma and reference solution used are:

Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Refer to caption
(d)
Refer to caption
(e)
Refer to caption
(f)
Refer to caption
(g)
Refer to caption
(h)
Figure 3: Convergence of the trapezoidal rule and SSQ for the log kernel and m=1,2,3m=1,2,3, measured as the maximum error on a set of target points such that Imt=d\operatorname{Im}t^{*}=d. Left column shows interior points, right column shows exterior points.
  • For ILI_{L} we use the σ(t)=g1(t)g2(t)\sigma(t)=g_{1}(t)g_{2}(t) and compute the reference solution using adaptive Gauss-Kronrod quadrature.

  • For ImI_{m} and interior points (Imt>0\operatorname{Im}t^{*}>0) we use σ(τ)=τ3+τ\sigma(\tau)=\tau^{3}+\tau, with reference solution Im(z)=2πiσ(m)(z)/(m1)!I_{m}(z)=2\pi i\sigma^{(m)}(z)/(m-1)!.

  • For ImI_{m} and exterior points (Imt<0\operatorname{Im}t^{*}<0) we use σ(τ)=τ1\sigma(\tau)=\tau^{-1}, with reference solution Im(z)=2πizmI_{m}(z)=2\pi iz^{-m}.

The results of this investigation are shown in fig. 3. As expected, the convergence rate of the trapezoidal rule depends strongly on the distance to the boundary, which is not the case for SSQ. There appears to be a weak dependence on the rate for interior points, but that could be an effect of the chosen test problem. More concerning is that lowest attainable error appears to increase for smaller dd when m>1m>1. It is unclear what causes this effect, although in experiments there appears to be an upper bound to the error growth.

4 Conclusions

We have extended the singularity swap quadrature (SSQ, [1]) method to closed 2D curves discretized using the trapezoidal rule. This extension builds on the simple observation that interpolatory quadrature can be used on a periodic integrand if the problem is first swapped to the unit circle. The method relies on representing quantities as Fourier expansions, and as a consquence the domintaing cost of the method is that of applying the fast Fourier transform (FFT).

The method is accurate, exponentially convergent, and relatively simple to implement (and we provide source code). The fact that the cost is 𝒪(NlogN)\mathcal{O}(N\log N) per target point makes the method unfeasible for large problems, but that is a consequence of the underlying trapezoidal rule being global (and exponentially convergent). For maximum efficiency, composite Gauss-Legendre quadrature with the original SSQ likely remains the better option.

In the original SSQ paper, it was shown that the method can be applied to line integrals in 3D by finding the singularity preimage through analytic continuation of the squared-distance function. The same technique can be applied to the present method, for closed curves in three dimensions. What remains is analytical evaluation of the integrals of the interpolatory quadrature. This is straightforward for the logarithmic kernel, but the integrals corresponding to power-law kernels are more challenging. Deriving expressions for these is currently work in progress.

Acknowledgements

The key contributions of this work were made with support from the Knut and Alice Wallenberg Foundation, under grant no. 2016.0410.

References

  • af Klinteberg and Barnett [2020] L. af Klinteberg and A. H. Barnett. Accurate quadrature of nearly singular line integrals in two and three dimensions by singularity swapping. BIT Numer. Math., 2020. doi:10.1007/s10543-020-00820-5.
  • af Klinteberg et al. [2022] L. af Klinteberg, C. Sorgentone, and A. K. Tornberg. Quadrature error estimates for layer potentials evaluated near curved surfaces in three dimensions. Comput. Math. Appl., 111:1–19, 2022. doi:10.1016/j.camwa.2022.02.001.
  • Barnett et al. [2015] A. Barnett, B. Wu, and S. Veerapaneni. Spectrally Accurate Quadratures for Evaluation of Layer Potentials Close to the Boundary for the 2D Stokes and Laplace Equations. SIAM J. Sci. Comput., 37(4):B519–B542, 2015. doi:10.1137/140990826.
  • Barnett [2014] A. H. Barnett. Evaluation of Layer Potentials Close to the Boundary for Laplace and Helmholtz Problems on Analytic Planar Domains. SIAM J. Sci. Comput., 36(2):A427–A451, 2014. doi:10.1137/120900253.
  • Beale and Lai [2001] J. T. Beale and M.-C. Lai. A Method for Computing Nearly Singular Integrals. SIAM J. Numer. Anal., 38(6):1902–1925, 2001. doi:10.1137/S0036142999362845.
  • Carvalho et al. [2018] C. Carvalho, S. Khatri, and A. D. Kim. Asymptotic analysis for close evaluation of layer potentials. J. Comput. Phys., 355:327–341, 2018. doi:10.1016/j.jcp.2017.11.015.
  • Helsing and Ojala [2008] J. Helsing and R. Ojala. On the evaluation of layer potentials close to their sources. J. Comput. Phys., 227(5):2899–2921, 2008. doi:10.1016/j.jcp.2007.11.024.
  • Nitsche [2022] M. Nitsche. Corrected trapezoidal rule for near-singular integrals in axi-symmetric Stokes flow. Adv. Comput. Math., 48(5):57, 2022. doi:10.1007/s10444-022-09973-z.
  • Trefethen and Weideman [2014] L. N. Trefethen and J. A. C. Weideman. The Exponentially Convergent Trapezoidal Rule. SIAM Rev., 56(3):385–458, 2014. doi:10.1137/130932132.