Two-dimensional Fourier Continuation and applications
Oscar P. Bruno
†
and Jagabandhu Paul
†
†
Computing and Mathematical Sciences, Caltech, Pasadena, CA 91125
Abstract
This paper presents a “two-dimensional Fourier Continuation” method (2D-FC) for construction of
bi-periodic extensions of smooth non-periodic functions defined over general two-dimensional smooth
domains. The approach can be directly generalized to domains of any given dimensionality, and even
to non-smooth domains, but such generalizations are not considered here. The 2D-FC extensions are
produced in a two-step procedure. In the first step the
one-dimensional
Fourier Continuation method
is applied along a discrete set of outward boundary-normal directions to produce, along such directions,
continuations that vanish outside a narrow interval beyond the boundary. Thus, the first step of the
algorithm produces “blending-to-zero along normals” for the given function values. In the second step,
the extended function values are evaluated on an underlying Cartesian grid by means of an efficient,
high-order boundary-normal interpolation scheme. A Fourier Continuation expansion of the given func-
tion can then be obtained by a direct application of the two-dimensional Fast Fourier Transform (FFT).
Algorithms of arbitrarily high order of accuracy can be obtained by this method. The usefulness and
performance of the proposed two-dimensional Fourier Continuation method are illustrated with appli-
cations to the Poisson equation and the time-domain wave equation within a bounded domain. As part
of these examples the novel “Fourier Forwarding” solver is introduced which,
propagating plane waves
as they would in free space
and relying on certain boundary corrections, can solve the time-domain wave
equation and other hyperbolic partial differential equations
within general domains
at computing costs
that grow
sublinearly
with the size of the spatial discretization.
Keywords
: Two-dimensional Fourier Continuation, Poisson Equation, Wave Equation, FC Solver, Fourier
Forwarding, FFT.
1 Introduction
This paper presents a “two-dimensional Fourier Continuation” method (2D-FC) for construction of bi-
periodic extensions of smooth non-periodic functions defined over general two-dimensional smooth domains.
The approach can be directly generalized to domains of any given dimensionality, and even to non-smooth
domains, but such generalizations are not considered here. The usefulness and performance of the proposed
two-dimensional Fourier Continuation method are illustrated with applications to the Poisson equation and
the time-domain wave equation within a bounded domain. As part of these examples the novel “Fourier
Forwarding” solver is introduced which,
propagating plane waves as they would in free space
and relying
on certain boundary corrections, can solve the time-domain wave equation and other constant-coefficient
hyperbolic partial differential equations
within general domains
at computing costs that grow
sublinearly
with the size of the spatial discretization.
The periodic-extension problem has actively been considered in the recent literature, in view, in par-
ticular, of its applicability to the solution of various types of Partial Differential Equations (PDE) [1, 3,
4, 6, 8, 13, 16, 20, 23]. The contributions [3, 4, 8, 20], in particular, utilize the Fourier Continuation (FC)
method in one dimension in conjunction with dimensional splitting for the treatment of multidimensional
1
arXiv:2010.03901v2 [math.NA] 15 Oct 2020
PDE problems. The dimensional splitting is also used in [11] to produce Fourier extensions to rectangular
domains in two dimensions, where the Fourier Continuation is effected by separately applying the one-
dimensional FC-Gram method [3, 4, 8] first to the columns and then to the rows of a given data matrix
of function values. The method does assume that the given smooth function is known on a rectangular
region containing the domain for which the continuation is sought.
The approach to periodic function extension presented in [6, 23] is based on the solution of a high-
order PDE, where the extension shares the values and normal derivatives along the domain boundary.
Reference [13], in turn, presents a function-extension method based on use of radial basis functions. In
that approach, overlapping circular partitions, or patches, are placed along the physical boundary of the
domain, and a local extension is defined on each patch by means of Radial Basis Functions (RBFs). A
second layer of patches is placed outside the first, on which the local values are set to vanish. The zero
patches are used in conjunction with a partition of unity function to blend the local extensions into a global
counterpart. The choice of functions used to build-up the partition of unity determines the regularity of
the extended function.
The 2D-FC extensions proposed in this paper are produced in a two-step procedure. In the first step
the
one-dimensional
Fourier Continuation method [4] is applied along a discrete set of outward boundary-
normal directions to produce, along such directions, continuations that vanish outside a narrow interval
beyond the boundary. Thus, the first step of the algorithm produces “blending-to-zero along normals” for
the given function values. In the second step, the extended function values are evaluated on an underlying
Cartesian grid by means of an efficient, high-order boundary-normal interpolation scheme. A Fourier
Continuation expansion of the given function can then be obtained by a direct application of the two-
dimensional FFT algorithm. Algorithms of arbitrarily high order of accuracy can be obtained by this
method. Since the continuation-along-normals procedure is a fixed cost operation, the cost of the method
grows only linearly with the size of the boundary discretization.
As mentioned above, this paper demonstrates the usefulness of the proposed general-domain 2D-FC
technique via applications to both, the Poisson problem for the Laplace equation and the time-domain
wave equation. In the Poisson case the 2D-FC method is utilized to obtain a
particular solution
for a
given right hand side; the boundary conditions are then made to match the prescribed boundary data by
adding a solution of the Laplace equation which is produced by means of boundary-integral methods. The
Fourier Forwarding approach, in turn, uses the 2D-FC method to solve the spatio-temporal PDE in the
interior of the domain and it then corrects the solution values near the boundary by means of a classical
time-stepping solver. The overall procedure, which utilizes large time-steps for the interior solver and small
CFL-constrained time-steps for the near-boundary solver, runs in computing times that grow
sublinearly
with the size of the spatial discretization mesh.
It is interesting to note that the primary continuation device in the 2D-FC method, namely, continuation
along normals to the domain boundary, is a
one-dimensional procedure
. This one-dimensional continuation
procedure can be utilized in a generalization of the method to
n
-dimensional domains with
n >
2
. This
is in contrast with other extension methods mentioned above. For example, the RBF-based extension
method [13] requires solution of boundary problems of increasing dimensionality as the spatial dimension
grows, which, given the method’s reliance on dense-matrix linear algebra for the local-extension process,
could have a significant impact on computing costs. Similar comments apply to PDE-based extension
methods such as [23].
The proposed 2D-FC algorithm performs favorably in the context of existing related approaches. Spe-
cific comparisons with results presented in [13] are provided in Section 4.1.1 for a Poisson problem con-
sidered in that reference. The recent contribution [12], in turn, presents an FFT-based high-order solver
for the Poisson problem for
rectangular
domains, namely, Cartesian products of one-dimensional intervals
in either two- or three-dimensional space. The present 2D-FC based Poisson solver achieves,
for general
domains
, a similar performance (similar accuracy and computing time) to that demonstrated in [12, Tables
3 and 4] under the Cartesian-domain assumption.
2
This paper is organized as follows. After a brief review of the 1D-FC method presented in Section 2,
the proposed 2D-FC method is introduced in Section 3. The two main applications considered, namely,
solution of the Poisson and Fourier-Forwarding for the wave equation, are presented in Sections 4.1 and 4.2.
Finally our conclusions are presented in Section 5.
(a) Demonstration of the 1D-FC method. The continuation values are computed as the sum of the
blended-to-zero rightward and leftward extensions.
(b) Inset of Figure 1a.
(c) Numbers
E
of leftward and rightward extra ze-
roes.
Figure 1:
Illustration of the 1D-FC procedure. Figure 1a depicts the Fourier Continuation of the non-periodic function
φ
: [0
,
1]
→
R
given by
φ
(
x
) = exp(sin(5
.
4
πx
−
2
.
7
π
)
−
cos(2
πx
))
−
sin(2
.
5
πx
) + 1
. Figure 1b presents a close up of the right
continuation region
[1
−
(
d
−
1)
k,b
]
. Subsequently Figure 1c illustrates the use of a number
E
of extra zeroes in the blending
to zero process, to yield a continuation mesh containing FFT-friendly numbers (products of powers small prime numbers) of
point values.
2 Background: 1D “blending-to-zero” FC algorithm
This section presents a brief review of the one-dimensional Fourier Continuation (1D-FC) method [3, 4],
with an emphasis on one of its key components, the
blending-to-zero
procedure—which is employed in
the normal-direction continuation portion of the proposed two-dimensional Fourier Continuation (2D-FC)
approach presented in Section 3.
2.1 1D-FC algorithm: Outline
Given the vector
φ
D
= (
φ
0
,...,φ
N
−
1
)
t
of values of a smooth function
φ
: [0
,
1]
→
C
on the equispaced
grid
D
=
{
x
j
=
jk
: 0
≤
j
≤
N
−
1
}
of step-size
k
= 1
/
(
N
−
1)
, the 1D-FC method [3,4] of order
d
(with,
e.g.,
4
≤
d
≤
12
) produces, at first, an (
N
+
C
)-dimensional vector
φ
c
of discrete continuation function
3
values (including the
N
given function values) over an extended interval
[0
,b
]
,b >
1
. To do this, the
algorithm utilizes the
d
-dimensional vectors
φ
`
= (
φ
0
,...,φ
d
−
1
)
t
and
φ
r
= (
φ
N
−
d
,...,φ
N
−
1
)
t
of values of
the function
φ
on the left and right “matching-point” sets
D
`
=
{
x
0
,...,x
d
−
1
}
and
D
r
=
{
x
N
−
d
,...,x
N
−
1
}
,
respectively, each one of which is contained in a small subinterval of length
(
d
−
1)
k
near the corresponding
endpoint of the containing interval
[0
,
1]
. In order to obtain the
C
necessary continuation values, the 1D-
FC method blends
φ
`
and
φ
r
to zero (see Section 2.2), towards the left and right, respectively, resulting
in two zero-blending vectors of length
C
. The sum of these two vectors is then utilized as a rightward
discrete continuation to the set
D
c
=
{
x
j
= 1 +
jk
: 1
≤
j
≤
C
}}
of points in the interval
(1
,b
]
—as
described in Section 2.3. As indicated in that section, the overall 1D-FC procedure is then completed
via an application of the FFT algorithm to the (
N
+
C
)-dimensional vector
φ
c
(cf. equation (2.7) below)
of “smoothly-periodic” discrete continued function values. The following two subsections describe the
blending-to-zero and 1D-FC approaches, respectively.
2.2 Blending-to-zero Algorithm
In our description of the order-
d
blending-to-zero algorithm [4] we only present details for the
rightward
blending-to-zero technique, since the leftward blending-to-zero problem can easily be reduced to the right-
ward problem. Thus, given the column vector
F
D
= (
F
0
,...,F
d
−
1
)
t
of values of a complex-valued function
F
on the set
D
=
{
x
0
,x
1
,...,x
d
−
1
}
, the rightward blending-to-zero approach starts by producing a poly-
nomial interpolant for
F
over the interval
[
x
0
,x
d
−
1
]
relying on the Gram polynomial basis
G
d
=
{
g
0
(
x
)
,g
1
(
x
)
,...,g
d
−
1
(
x
)
}
(2.1)
for this interval. The functions
g
j
(
x
)
(
j
= 0
,...,d
−
1
) are the polynomials with real coefficients that are
obtained as the Gram-Schmidt orthogonalization procedure is applied, in order of increasing degree, to the
polynomials in the set
{
1
,x,x
2
,...,x
d
−
1
}
, with respect to the discrete scalar product
(
g,h
) =
d
−
1
∑
j
=0
g
(
x
j
)
h
(
x
j
)
.
Discrete values of the Gram polynomials on the set
D
can be computed on the basis of the
QR
factoriza-
tion [14]
P
=
QR
of the matrix
P
= (
x
i
j
−
1
)
0
≤
i,j
≤
d
−
1
.
(2.2)
(Note that the
j
th
column of
Q
contains the values of the
j
th
Gram polynomial on the set
D
.) Following [4]
we obtain the necessary
QR
factorization by applying the stabilized Gram-Schmidt orthogonalization
method to the matrix
P
.
In order to closely approximate each one of the Gram polynomials in
G
d
, throughout the continuous
interval
[0
,
(
d
−
1)
k
]
containing
D
, by corresponding trigonometric polynomials, as described below, we use a
certain “oversampled matching” method. According to this method the polynomials in
G
d
are oversampled
to an equispaced set of discretization points with stepsize
k/n
os
(containing
n
os
(
d
−
1) + 1
points) where
n
os
denotes the oversampling factor, and where the oversampled values are used as part of a certain Singular
Value Decomposition (SVD) matching procedure described in what follows. Note that the aforementioned
oversampled values on the refined grid
D
os
:
=
{
̃
x
j
=
jk/n
os
: 0
≤
j
≤
n
os
(
d
−
1)
}
coincide with the columns
of the matrix
Q
os
=
P
os
R
−
1
,
(2.3)
where
P
os
is the Vandermonde matrix of size
(
n
os
(
d
−
1) + 1)
×
d
corresponding to the oversampled
discretization
D
os
, and where
R
is the upper triangular matrix in equation (2.2).
4
The aforementioned SVD matching procedure, which is one of the crucial steps in the FC approach [4],
produces a band-limited Fourier series of the form
g
c
j
(
x
) =
M
∑
m
=
−
M
a
j
m
e
2
πimx
(
d
+2
C
+
Z
−
1)
k
(2.4)
for each polynomial
g
j
∈
G
d
(
0
≤
j
≤
d
−
1
), where
C
is the number of blending-to-zero values to be
produced, and
Z
being the number of “zero-matching” points. The Fourier coefficients are selected so as to
match, in the least square sense, both the oversampled polynomial values over the interval
[0
,
(
d
−
1)
k
]
, and
identically zero values on an equally fine discretization of the “zero matching” interval
[(
d
+
C
)
k,
(
d
+
C
+
Z
−
1)
k
]
of length
(
Z
−
1)
k
. The coefficients in (2.4) are taken to equal the solution
a
of the minimization
problem
min
a
=(
a
−
M
,...,a
M
)
T
∥
∥
∥
∥
∥
B
os
a
−
(
q
j
os
0
)
∥
∥
∥
∥
∥
2
,
(2.5)
where
B
os
is a matrix whose entries are values of (2.4) at all points in the set
D
os
as well as all the set of
k/n
os
-spaced points in the “zero matching” interval mentioned above (which, in particular, contains the
endpoints
(
d
+
C
)
k
and
(
d
+
C
+
Z
−
1)
k
)
. The minimizing Fourier coefficients
a
are then found via an
SVD-based [14] least-squares approach. Once the coefficients
a
have been obtained, the resulting Fourier
expansions (2.4) are used to produce a certain “continuation matrix”
A
∈
C
C
×
d
, whose columns equal the
values of the expression (2.4) at the
C
(unrefined)
k
-discretization points in the interval
[
dk,
(
d
+
C
−
1)
k
]
(cf. Remark 2.2 below). The desired vector
F
r
of rightward blending-to-zero function values at the
C
continuation points in the interval
[
dk,
(
d
+
C
−
1)
k
]
is then given by the expression
F
r
=
AQ
T
F
.
(2.6)
2.3 1D-FC Algorithm
As outlined in section 2.1, the 1D-FC algorithm requires use of a certain rightward (resp. leftward) blending-
to-zero vector
φ
r
r
(resp.
φ
`
`
) for a given matching-point vector
φ
r
(resp.
φ
`
). In view of equation (2.6) we
define
φ
r
r
=
AQ
T
φ
r
. To obtain the leftward extension
φ
`
`
, in turn, we first introduce the “order reversion”
matrix
R
e
∈
C
e
×
e
(
e
∈
N
) by
R
e
(
g
0
,g
1
...,g
e
−
2
,g
e
−
1
)
t
= (
g
e
−
1
,g
e
−
2
,...,g
1
,g
0
)
t
,
and we then define
φ
`
`
=
R
C
AQ
T
R
d
φ
`
. A vector
φ
c
containing both the
N
given values in the vector
φ
= (
φ
0
,φ
1
,...,φ
N
−
1
)
t
as well as the
C
“continuation” function values is constructed by appending the
sum
φ
`
`
+
φ
r
r
at the end of the vector
φ
, so that we obtain
φ
c
j
=
φ
j
for
0
≤
j
≤
N
−
1
(
φ
`
`
+
φ
r
r
)
(
j
−
N
)
for
N
≤
j
≤
N
+
C
−
1
.
(2.7)
Following the various stages of the construction of the vector
φ
c
it is easy to check that, up to numerical
error, this vector contains point values of a smoothly periodic function defined over the interval
[0
,b
]
. An
application of the FFT algorithm to this vector therefore provides the desired continuation function in the
form of a trigonometric polynomial,
φ
c
(
x
) =
(
N
+
C
)
/
2
∑
`
=
−
(
N
+
C
)
/
2
ˆ
φ
c
`
e
2
πi`x
b
,
(2.8)
5
which closely approximates
φ
in the interval
[0
,
1]
. In fact, as demonstrated in previous publications
(including [3,4]), for sufficiently smooth functions
φ
, the corresponding 1D-FC approximants converge to
φ
with order
O
(
k
d
)
—so that, as expected, the number
d
of points used in the blending-to-zero procedures
determines the convergence rate of the algorithm. (As discussed in these publications, further, in view of
its spectral character the 1D-FC approach enjoys excellent dispersion characteristics as well.) The 2D-FC
algorithm introduced in the following section also relies on the one-dimensional blending-to-zero procedure
described in section 2.2, and its convergence in that case is once again of the order
O
(
k
d
)
.
It is important to note that, for a given order
d
, the matrices
A
and
Q
can be computed once and
permanently stored on disc for use whenever an application of the blending-to-zero algorithm is required—
as these matrices do not depend on the point spacing
k
. A graphical demonstration of various elements of
the 1D-FC procedure is presented in Figure 1.
Remark 2.1 (Extra vanishing values).
The 1D-FC implementations [3, 4] allow for an additional
number
E
≥
0
of identically zero “Extra” function values to be added on a (unrefined)
k
-discretization of
the interval
[(
d
+
C
)
k,
(
d
+
C
+
E
−
1)
k
]
, as illustrated in Figure 1c, to obtain a desired overall number of
discrete function values (including the given function values and the continuation values produced) such as
e.g., a power of two or a product of powers of small prime numbers, for which the subsequent application
of the fast Fourier transform is particularly well suited. The corresponding use of extra vanishing values
for the 2D continuation problem is mentioned in Remark 3.2.
Remark 2.2 (Blending to zero on a refined grid).
As indicated above in the present section, the
two-dimensional Fourier continuation procedure introduced in Section 3 utilizes the 1D blending-to-zero
strategy described above in this section to extend a function given on a two-dimensional domain
Ω
along
the normal direction to
Γ
; the continuation values obtained at all normals are then utilized to obtain the
continuation function on the Cartesian grid by interpolation. As detailed in Section 3.4, in order to prevent
accuracy loss in the 2D interpolation step we have found it necessary to use 1D normal-direction grids finer
than the grids inherent in the blending-to-zero process itself. To easily provide the necessary fine-grid
values, a modified fine-grid continuation matrix
A
r
∈
C
C
r
×
d
is constructed, where
C
r
> C
denotes the
number of fine-grid points utilized. The modified continuation matrix
A
r
can be built on the basis of the
minimizing coefficients
a
in (2.5): the corresponding columns of the fine-grid continuation matrix
A
r
are
obtained by evaluating (2.4) on the given fine-grid points in the interval
((
d
−
1)
k,
(
d
+
C
−
1)
k
]
. The
necessary blending-to-zero function values at the
C
r
fine-grid points are given by
A
r
Q
T
φ
D
.
3 Two-dimensional Fourier Continuation Method
This section presents the proposed volumetric Fourier continuation method on two-dimensional domains
Ω
⊂
R
2
with a smooth boundary
Γ =
Ω
\
Ω
, some elements of which are illustrated in Figure 2. Let a smooth
function
f
:
Ω
→
C
be given; we assume that values of
f
are known on a certain uniform Cartesian grid
within
Ω
as well as a grid of points on the boundary
Γ
. The 2D-FC algorithm first produces one-dimensional
“blending-to-zero” values for the function
f
along directions normal to the boundary
Γ
, yielding continuation
values on a certain two-dimensional tangential-normal curvilinear grid around
Γ
, as detailed in Sections 3.1
and 3.2 and illustrated in Figure 2. These continuation values, which are produced on the basis of the
corresponding blending-to-zero procedure presented in section 2.2 in the context of the 1D-FC method,
are then interpolated onto a Cartesian grid around the domain boundary, to produce a two-dimensional
blending-to-zero continuation of the function
f
. The necessary interpolation from the curvilinear grid to
the Cartesian grid is accomplished by first efficiently obtaining the foot of the normal that passes through
a given Cartesian grid point
r
= (
x,y
)
exterior to
Ω
and near the boundary
Γ
(Section 3.3), and then
using a local two-dimensional interpolation procedure to produce the corresponding continuation value at
the point
r
(Section 3.4). Once the interpolated values have been obtained throughout the Cartesian mesh
6
around
Γ
, the desired two-dimensional Fourier continuation function
f
c
(
x,y
) =
N
x
/
2
∑
`
=
−
N
x
/
2+1
N
y
/
2
∑
m
=
−
N
y
/
2+1
ˆ
f
c
`,m
e
2
πi
(
`x
L
x
+
my
L
y
)
(3.1)
(where
L
x
and
L
y
denotes the period in the
x
and
y
directions, respectively) is obtained by means of a
2D FFT. Following the algorithmic prescriptions presented in Sections 3.1 through 3.4, a summary of the
overall 2D-FC approach is presented in Section 3.5.
3.1 Two-dimensional tangential-normal curvilinear grid
The necessary curvilinear grids around
Γ
can be produced on the basis of a (smooth) parametrization
r
=
q
(
θ
) = (
x
(
θ
)
,y
(
θ
))
,
0
≤
θ
≤
2
π,
(3.2)
of the boundary
Γ
. In view of their intended application (blending to zero along the normal direction in
accordance with section 2.2), the curvilinear grids are introduced within interior and exterior strips
V
−
and
V
+
(illustrated in Figure 2) given by
{
V
−
=
{
q
(
θ
)
−
n
(
θ
)
γ
: 0
≤
θ
≤
2
π
and
0
≤
γ
≤
(
d
−
1)
k
1
}
,
V
+
=
{
q
(
θ
) +
n
(
θ
)
γ
: 0
≤
θ
≤
2
π
and
0
≤
γ
≤
Ck
1
}
,
(3.3)
where
n
(
θ
) = (
n
x
(
θ
)
,n
y
(
θ
))
denotes the unit normal to the boundary
Γ
at
q
(
θ
)
, and where
d
,
C
and
k
1
denote, respectively, the number of matching points, the number of blending-to-zero points, and the
stepsize used, in the present application of the 1D blending-to-zero procedure described in Section 2.2.
Using, in addition, the uniform discretization
I
B
=
{
θ
p
=
pk
2
: 0
≤
p < B
}
, k
2
=
2
π
B
,
(3.4)
of the interval
[0
,
2
π
]
, we then construct a curvilinear two-dimensional discretization
V
−
B,d
=
{
r
p,q
:
r
p,q
=
q
(
θ
p
) +
n
(
θ
p
)(
q
−
d
+ 1)
k
1
; 0
≤
p < B
and
0
≤
q
≤
d
−
1
}
(3.5)
V
+
B,C
r
=
{
s
p,q
:
s
p,q
=
q
(
θ
p
) +
n
(
θ
p
)
qk
1
/n
r
; 0
≤
p < B
and
0
≤
q
≤
C
r
}
,
(3.6)
within
V
−
and
V
+
respectively, for the given stepsize
k
1
where
C
r
=
Cn
r
for certain integer (refinement
factor)
n
r
; note that the points in
V
−
B,d
for
q
=
d
−
1
and the points in
V
+
B,C
r
for
q
= 0
coincide and
that they lie on
Γ
. Here the constants
d
,
C
and
n
r
are independent of
B
. The continuation function is
constructed so as to vanish at all points
s
p,q
∈
V
+
B,C
r
with
q
=
C
r
. Let now
R
= [
a
0
,a
1
]
×
[
b
0
,b
1
]
denote
the smallest closed rectangle containing
Ω
∪
V
+
, and consider the equispaced Cartesian grid of stepsize
h
,
H
=
{
z
i,j
= (
x
i
,y
j
) :
x
i
=
a
0
+
ih
;
y
j
=
b
0
+
jh
: 0
≤
i < N
x
,
0
≤
j < N
y
}
(3.7)
on
R
, where the two-dimensional continuation function values are to be computed. We note that the size
of the rectangle
R
along with the strips
V
−
and
V
+
decrease as the stepsize
k
2
is decreased.
3.2 Computation of FC values on
V
+
B,C
r
A continuation of the function
f
to the exterior of
Ω
is obtained via application of the blending-to-zero
procedure presented in Section 2.2 (cf. Remark 2.2) along each one of the normal directions inherent in
the definition of the set
V
+
B,C
r
. For given
p
, the
d
equidistant points
s
p,q
∈
V
−
B,d
(0
≤
q
≤
d
−
1)
, which
7
Figure 2:
Geometrical constructions underlying the 2D-FC procedure, with reference to the various regions defined in Sec-
tion 3.1.
are indicated by the solid circles in Figure 3, constitute a set
D
p
of matching points that are used to
effect the blending-to-zero procedure per the prescriptions presented in Section 2.2. To obtain the desired
continuation function values it is necessary to first obtain the vector
f
D
p
of the values of the function
f
(or
suitable approximations thereof) on the set
D
p
. In the proposed method, the needed function values
f
D
p
are computed on the basis of a two-step polynomial interpolation scheme, using polynomials of a certain
degree (
M
−
1
), as briefly described in what follows.
With reference to the right image of Figure 3, and considering first the case
|
n
x
(
θ
p
)
| ≥ |
n
y
(
θ
p
)
|
, the
algorithm initially interpolates vertically the function values at
M
open-circle Cartesian points selected as
indicated in the figure, onto the points of intersection, shown as red-stars, of the normal line and the vertical
Cartesian grid lines. For intersection (red-star) points close enough to the boundary, boundary function
values at boundary points shown as squares in the figure, are utilized in the one-dimensional interpolation
process as well. Once the red-star function values are acquired, the function value at the matching solid-
black point is effected by interpolation from the
M
red-star point values previously obtained, on the basis
of a polynomial of degree (
M
−
1
).
The case
|
n
x
(
θ
p
)
|
<
|
n
y
(
θ
p
)
|
is treated similarly, substituting the initial interpolation along vertical
Cartesian lines, by interpolation along horizontal Cartesian lines; the algorithm then proceeds in an entirely
analogous fashion.
Figure 3:
Interpolation scheme for evaluation of
f
D
p
in the case
|
n
x
(
θ
p
)
| ≥ |
n
y
(
θ
p
)
|
. Left: Black solid circles indicate the
matching points that define the set
D
p
. Right: Known function values at the Cartesian points (denoted by the empty circles)
and, in some cases, at the point of intersection (represented by an empty square) of the vertical grid lines with
Γ
, are used
to interpolate the matching function values at the red-star intersection points of the normal with the vertical grid lines. The
function values at the red-points are then used to obtain, by interpolation, the function values at the matching points.
8
3.3 Proximity map
As described below in Section 3.4, the 2D FC algorithm interpolates the Fourier continuation values on
V
+
B,C
r
onto the Cartesian mesh
H
. The interpolation algorithm used in that section relies on a certain
“proximity map”
P
:
H
∩
V
+
→
V
+
B,C
r
which associates a curvilinear grid point
s
p,q
=
P
(
z
i,j
)
∈
V
+
B,C
r
in the “proximity” of each given Cartesian grid point
z
i,j
. The proximity function we use is obtained by
first associating to each curvilinear discretization point
s
p,q
the nearest Cartesian point, a procedure that
results in a set
P
0
⊆
(
H
∩
V
+
)
×
V
+
B,C
r
of pairs of points, one in the Cartesian grid and the other in the
curvilinear grid. (The initial set
P
0
can easily be obtained by using the “integer part”
floor
(
b
.
c
)
and the
ceil
(
d
.
e
)
operators.) The set
P
0
is then modified by removing multiple associations for a given Cartesian
point, and, if necessary, by adding a “next-nearest” curvilinear neighbor to Cartesian points that previously
remained un-associated. The resulting set
P
defines the desired function.
3.4 FC Values on the Cartesian Grid
Once Fourier continuation values on
V
+
B,C
r
have been obtained, per the procedure presented in Section 3.2,
the two-dimensional FC scheme can be completed by (a) Interpolation onto the set
H
∩
V
+
of outer
Cartesian grid points; and, (b) Subsequent evaluation of the corresponding Fourier coefficients in equa-
tion Equation (3.1) by means of an FFT. (Note that since the continuation function
f
c
is a smooth function
which vanishes outside
Ω
∪
V
+
, this function can be viewed as the restriction of a smooth and bi-periodic
function with periodicity rectangle
R
—whose Fourier series approximates
f
c
, and therefore
f
, accurately.)
The efficiency of the interpolation scheme is of the utmost importance in this context—since interpolation
to a relatively large set
H
∩
V
+
of Cartesian points is necessary. An accurate and efficient interpolation
strategy is obtained by combining two one-dimensional (local) interpolation procedures based on nearby
normal directions. The first interpolation procedure produces the parameter value
θ
of the foot of the
normal to
Γ
passing through a given Cartesian point; the second procedure then approximates the contin-
uation function value utilizing the parameter value
θ
just mentioned and the continuation function values
at the points in
V
+
B,C
r
around the given Cartesian point. A detailed description of the combined interpola-
tion methodology is presented in what follows. Specifically, we describe the strategy we use to interpolate
the continuation function onto each point
Q
=
z
i,j
∈
H
∩
V
+
and, to do this, we first obtain the foot
F
(
Q
)
of this point. Using the proximity map
P
described in Section 3.3, the algorithm utilizes the curvilinear
discretization point
s
p,q
=
P
(
z
i,j
)
∈
V
+
B,C
r
as well as the corresponding boundary discretization parameter
value
θ
p
; according to equation (3.6), the point
q
(
θ
p
)
equals the foot of the normal passing through
s
p,q
:
q
(
θ
p
) =
F
(
s
p,q
)
. The algorithm then seeks approximation of the foot
F
(
Q
)
and the corresponding parame-
ter value
θ
=
θ
Q
via a preliminary interpolation step, as indicated in what follows. The foot
F
(
Q
)
and the
corresponding parameter value
θ
=
θ
Q
are then used by the algorithm to produce the desired interpolated
continuation value at
Q
.
In order to obtain
F
(
Q
)
the algorithm uses the
M
boundary parameter values in the set
S
θ
p
=
{
θ
p
−
K
`
,θ
p
−
K
`
+1
,...,θ
p
,θ
p
+1
,...,θ
p
+
K
r
}⊂
I
B
(3.8)
around
θ
p
(where
K
r
+
K
`
+ 1 =
M
, and where
K
r
=
K
`
if
M
is odd and
K
r
=
K
`
+ 1
if
M
is even.
Parameter values
θ
k
with negative values of
k
, which may arise in Equation (3.8), are interpreted by
periodicity:
θ
k
=
θ
B
+
k
).
The algorithm then utilizes the line
L
⊥
Q
passing through
Q
that is orthogonal to the normal vector
n
(
θ
p
)
(see left image in Figure 4), together with the parametrization
`
tr
Q
(
τ
)
of
L
⊥
Q
, where the parameter
τ
represents the signed distance of the points on
L
⊥
Q
from the point
Q
. Clearly, then,
`
tr
Q
(0) =
Q
. Each
point of intersection of
L
⊥
Q
with the normals
n
(
θ
j
)
(
θ
j
∈
S
θ
p
), on the other hand, equals
`
tr
Q
(
τ
j
)
where
τ
j
denotes the signed distance between
Q
and the corresponding intersection point. Thus, defining the
9
function
θ
=
T
(
τ
)
, where
T
(
τ
)
gives the parameter value of the foot of the normal through the point
`
tr
Q
(
τ
)
, we clearly have
θ
j
=
T
(
τ
j
);
p
−
K
`
≤
j
≤
p
+
K
r
.
(3.9)
It follows that a 1D interpolation procedure on the function
T
(
τ
)
can be used to obtain the desired
approximation of the value
θ
Q
=
T
(0)
of the parameter corresponding to the foot of the point
Q
=
z
i,j
:
F
(
Q
) =
q
(
θ
Q
) =
q
(
T
(0))
.
Once we have the corresponding foot parameter value
θ
Q
for the given Cartesian point
Q
, the distance
η
Q
of the point
Q
to the boundary
Γ
is easily computed. Let
S
θ
Q
⊂
I
B
be a set of
M
boundary parameter
values, similar to the set
S
θ
p
defined in ( 3.8), but with
S
θ
Q
“re-centered” around
θ
Q
. In order to obtain
the continuation function value at the point
Q
using the continuation function values on
V
+
B,C
r
, we employ
a local two-dimensional polynomial interpolation scheme based on the set
S
θ
Q
and the distance
η
Q
, as
indicated in what follows and illustrated in the right image of Figure 4. First, the continuation values are
obtained at each point (marked by blue asterisks in the figure) at a distance
η
Q
from the boundary
Γ
along
the normal grid lines in
V
+
B,C
r
that correspond to boundary parameter values in the set
S
θ
Q
. Each one
of these values is obtained via one-dimensional interpolation of the continuation function values on
V
+
B,C
r
along the corresponding normal grid line in
V
+
B,C
r
. The desired continuation value at the point
Q
, then,
is obtained via a final one-dimensional degree-(
M
−
1
) interpolation step based on the parameter set
S
θ
Q
and values at the “blue-asterisk” points just obtained. Finally, by applying the two-dimensional FFT to
Figure 4:
Interpolation schemes utilized to obtain the continuation function values on
H
∩
V
+
on the basis of the continuation
values on
V
+
B,C
r
. Left: Evaluation of the boundary parameter value for the foot of the normal line passing through
Q
, depicted
as a finely dotted line passing through that point. The left image also displays the set of red-star interpolation points along the
dashed-orange line
L
⊥
Q
. Right: Interpolation of continuation values from the curvilinear mesh to a point
Q
on the Cartesian
mesh.
the continuation function values computed above we then obtain the desired Fourier series expression in
(3.1) for the continuation function.
Remark 3.1 (Function values on
Γ
).
I. For definiteness, in this paper we have assumed that the bound-
ary data is provided in the form of values of the given function—which corresponds to the the Dirichlet
boundary data in the PDE context. But the approach is also applicable in cases for which the boundary
data is given as the normal derivative of the function, (Neumann boundary data), or even a combination
of function and normal derivative values (Robin data) by relying on a slightly modified blending-to-zero
procedure of the type presented in [4]. II. If no boundary data available, the two-dimensional Fourier
10
continuation method can still be utilized on the basis of interior data only, albeit with a certain reduction
in accuracy near the boundary.
Remark 3.2 (Extra vanishing values in 2D).
As in the 1D case, prior to the FFT procedure the grid
H
can be enlarged, with vanishing function values assigned to the added discretization points to obtain a
discretization containing a number of discretization points equal to a power of two (or a product of powers
of small prime numbers) along each Cartesian direction, which leads to specially fast evaluations by means
of the fast Fourier transform.
Figure 5:
Numerical errors in
log
-
log
scale (left graph) and computing times required (right graph) in the 2D-FC approxima-
tion of the function
f
in (3.10) in the setting of Example 3.1. The interpolating polynomial degree
M
=
d
+ 3
was used in all
cases. The integer
N
Ω
equals the number of spatial grid points used over the diameter of the disc. Times reported correspond
to averages over
10
runs.
3.5 Summary of the 2D-FC procedure
This section presents a summary of the 2D-FC procedure described in the Sections 3.1 through 3.4 for a
function
f
given on a uniform Cartesian grid
H
∩
Ω
within the domain of definition
Ω
, where
H
is a Cartesian
mesh over the rectangle
R
containing both
Ω
and the near-boundary outer region
V
+
; see Section 3.1 and,
in particular, Figure 2. The construction of the continuation function
f
c
for the given function
f
relies
on use of three main parameters associated with the 1D blending-to-zero approach presented in Section 2,
namely
d
(number of points in the set
D
),
C
(number of unrefined discrete continuation points), and
n
os
(oversampling factor for the 1D blending-to-zero FC procedure), together with the parameters
n
r
(refinement factor for the discrete continuation points, Remark 2.2 and Section 3.1), and,
M
−
1
(degree
of the interpolating polynomials, Sections 3.2 and 3.4). Additionally, the 2D-FC procedure utilizes the
precomputed matrices
A
r
and
Q
, which, with reference to Section 2.2, are obtained as per the description
provided in Remark 2.2.
Using the aforementioned parameters and matrices, the algorithm proceeds in two main steps, namely
step (a) A
“Geometrical Setup”
precomputation procedure (comprising points 1. through 4. below); and step
(b) A
“Cartesian Evaluation”
procedure (comprising points 5. through 7. below). Part (a) only concerns
geometry, and, for a given domain and configuration, could be produced once and used for evaluation
of Fourier continuations for many different functions, as is often necessary in practice. The full 2D-FC
algorithm thus proceeds according to the following seven-steps:
11
1. Discretize the boundary
Γ
using a smooth parametrization
{
q
(
θ
) = (
x
(
θ
)
,y
(
θ
)) : 0
≤
θ
≤
2
π
}
of
Γ
and the uniform discretization
I
B
=
{
0 =
θ
0
< θ
1
,...,< θ
B
−
1
<
2
π
}
of the interval
[0
,
2
π
]
(Section 3.1).
2. Using the discretization
I
B
, construct two curvilinear meshes
V
−
B,d
and
V
+
B,C
r
in the near-boundary
regions
V
−
(within
Ω
) and
V
+
(outside
Ω
), respectively (equations (3.5) and (3.6)). Note that the
discrete boundary points
q
(
θ
j
)
with
θ
j
∈
I
B
are common to both
V
−
B,d
and
V
+
B,C
r
.
3. Determine the set
H
∩
V
+
of Cartesian grid points and construct the proximity map
P
:
H
∩
V
+
→
V
+
B,C
r
(Section 3.3).
4. For all
Q
∈
H
∩
V
+
obtain the the parameter value
θ
Q
∈
[0
,
1]
of the foot
F
(
Q
)
of the normal through
Q
(Section 3.4 and the left image in Figure 4).
5. For each normal grid line (inherent in
V
−
B,d
and
V
+
B,C
r
) given by the discretization
I
B
, compute the
blending-to-zero function values along that normal (Section 3.2).
6. For all the points
Q
∈
H
∩
V
+
, obtain the continuation function value at
Q
by local 2D interpolation
(Section 3.4 and the right image in Figure 4).
7. Apply the two-dimensional FFT once to the continuation function values to obtain the desired Fourier
series in (3.1).
3.6 2D-FC approximation: Numerical Results
This section demonstrates the accuracy and efficiency of the proposed 2D-FC method. Use of the 2D-
FC method requires selection of specific values for each one of the following parameters (all of which are
introduced in Sections 2 and 3):
•
d
: number of points in the boundary section (Section 2.2).
•
C
: number of continuation points (Section 2.2).
•
Z
: number of zero matching points (Section 2.2).
•
n
os
: oversampling factor used in the oversampled matching procedure (Section 2.2).
•
n
r
: refinement factor along the normal directions in
V
+
B,C
r
(Remark 2.2).
•
R
: the smallest rectangle containing
Ω
∪
V
+
(Section 3).
•
N
=
N
x
×
N
y
: number of points in the uniform spatial grid
H
(Section 3).
•
B
: number of points in the boundary discretization (Section 3).
•
M
−
1
: interpolating polynomial degree (Sections 3.2 and 3.4).
All the errors reported in this section were computed on a Cartesian grid of step size
h/
2
within
Ω
. In
all of the numerical examples considered in this article the parameter selections were made in accordance
with Remark 3.3. The computer system used, in turn, is described in Remark 3.4.
Remark 3.3 (Parameter selections).
For a given step-size
h
in the two-dimensional Cartesian grid
H
,
the normal and the boundary step-sizes
k
1
and
k
2
(Section 3) were taken to coincide with
h
:
k
1
=
k
2
=
h
.
The parameter values
C
= 27
,
n
os
= 20
,
Z
= 12
and
n
r
= 6
were used in the evaluation of the matrices
A
r
and
Q
(see Section 2.2 and Remark 2.2). And, finally, with exception of the interpolation-degree
experiments presented in Example 3.2 (Table 2) and Example 4.2 (Table 3), the interpolating-polynomial
degree
(
M
−
1) = (
d
+ 2)
was used for the various matching-point numbers
d
considered.
Remark 3.4 (Computer system).
All of the numerical results reported in this paper were run on a
single core of a 3.40 GHz Intel Core i7-6700 processor with 15.4Gb of 2133 MHz memory.
Example 3.1 (Performance and efficiency of the 2D-FC method).
In our first example we consider
a problem of FC approximation of the function
f
: Ω
→
R
given by
f
(
x,y
) =
−
sin(5
πx
) sin(5
πy
)
(3.10)
12