Professional Documents
Culture Documents
Sarah Huber
MASTER OF SCIENCE
in
(Computer Science)
ii
Preface
This thesis is the result of work done by Chen Greif and myself. I was
responsible for the numerical results, analysis and writeup, with input from
my coauthor.
iii
Table of Contents
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Mathematical Tools . . . . . . . . . . . . . . . . . . . . . . . 2
iv
Table of Contents
6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
v
List of Tables
vi
List of Figures
vii
List of Figures
viii
Acknowledgements
My thanks to my supervisor, Chen Greif, who has given good advice and
much encouragement throughout my program. I am particularly thankful
for his well timed and practical feedback, which was often able to set me
back on the right track without feeling disheartened about having gone down
the wrong one. This work was supported financially by the Natural Sciences
and Engineering Research Council of Canada as well as the University of
British Columbia Affiliated Fellowships program.
I am also grateful for my undergraduate supervisors, Noham Weinberg
and Manfred Trummer, who gave me the chance to learn about the research
process and who encouraged me in my efforts.
I am thankful for the support, encouragement and graciousness of my
friends, family, and church family. In particular, my husband Liam has been
patient and supportive throughout this process. His curiosity and daring are
an inspiration for my own research.
Finally, I am grateful to all those who have taught me that the best way
to learn is to teach.
ix
Chapter 1
Introduction
Elliptic partial differential equations (PDEs), [20] such as the convection-
diffusion [16] and Poisson [20] equations, describe physical phenomena such
as the movement of a pollutant in a stream or electrostatic charge. Since the
analytical solution to these problems may be difficult or impossible to find,
they are generally solved numerically. A wide range of different solution
techniques exist, both in the discretization scheme for the differential equa-
tion and the solution technique for the resulting system of linear equations.
Our focus in this work will be on the choice of discretization scheme, and
on finite difference schemes [20] in particular.
These solution techniques are usually introduced in the context of an
idealized problem or domain, usually a square domain and a uniform mesh.
We are interested in the choice and complexity of the necessary changes in
the discretization scheme when the situation changes to a more complex
domain or mesh. We are also interested in the resulting changes in the
system of linear equations, and whether we can still perform analysis on the
operator as in the simplest of cases. As most real-world applications are for
non-trivial domains, this is an important topic. We consider starting from
a standard second order centred finite difference scheme [16] with a uniform
mesh on a square domain, and consider various adaptations.
In 1D, we investigate problems with boundary layers, which require an
area of fine resolution near the boundary for good resolution. In 2D, we
explore domains that are non-polymoino [8], that is, not made up of some
combination of squares. We also investigate solving an elliptic PDE on a
domain for which the exact solution contains a singularity; e.g., the Poisson
equation on an L-shaped domain.
These problems all require the use of a non-uniform grid. We explore
the use of bi-trees and quadtrees [7] (the reduction of an Octree to 1D and
2D respectively) for these problems and for those with non-trivial domains.
These meshes have all mesh sizes as a factor of a power of 2 of the smallest
mesh size. This allows for ease when performing adaptive mesh refinement,
as well as in storage and labelling.
When a grid in two dimensions or higher is non-uniform, the neighbour-
1
1.1. Mathematical Tools
ing points for a given finite difference scheme may not be present. In this
case, modifications must be made to the scheme, or a different scheme must
be chosen. We discuss the use of several discretization schemes with respect
to accuracy, ease of implementation, and the properties of the operator in
the resulting system of linear equations. In particular, one property of the
operator we are interested in is symmetry; we will investigate how to choose
a scheme to maintain this feature.
Symmetry is a desirable attribute for a matrix, as the solvers available for
a symmetric matrix are generally computationally stable, less computation-
ally costly, and require less storage than those for nonsymmetric matrices.
Furthermore, we are also interested in eigenvalue estimates, which may be
easier to obtain for a symmetric matrix.
2
Chapter 2
2.1 Introduction
Consider, for 0 < 1, the convection-diffusion problem in 1D
−u00 + σu0 = S u ∈ (0, 1),
(2.1)
u(0) = 0, u(1) = 1.
Problem (2.1) has an exact solution in the homogeneous case of S = 0, as
shown in 2.1,
eσx/ − 1
.
eσ/ − 1
For as above and σ = O(1), this problem has a boundary layer near 1.
Since this boundary layer is dependant on a potentially small value of , it
is called a singularly perturbed boundary value problem (BVP).
A uniform mesh with N + 1 points and origin x0 , as shown in Figure 2.2,
includes the uniformly spaced points xj = x0 + jh, where h = N1 . We define
Uj as our numerical approximation to u(xj ) on this grid. The standard
centred difference approximation to (2.1) is then:
Uj+1 − 2Uj + Uj−1 Uj+1 − Uj−1
LUj := − +σ = Sj , j = 1, ..., N − 1 (2.2)
h2 2h
with U0 = 0, UN = 1.
As −→ 0, the boundary layer grows thinner and more difficult to
resolve, and a fine mesh is increasingly necessary for the stability of the
discrete solution. A measure of the fineness of the mesh relative to the
problem is the Péclet number, defined as β = σh 2 . We require β < 1 for
stability [15]. Without this constraint, non-physical oscillations appear and
grow large as the Péclet number increases.
However, in the area away from the boundary layer, the solution is
smooth and a fine mesh is not so necessary. For this reason, we consider
3
2.1. Introduction
discretizing the problem with a piecewise uniform mesh, with all mesh sizes
2−k × h1 , where h1 is the largest mesh size and k some non-negative integer.
We call this discretization a “bi-tree”, in relation to the quadtree in 2D and
the octree in 3D.
Specifically, we consider a mesh with two different mesh sizes; a coarse
mesh with spacing h1 outside of the boundary layer and a fine mesh with
spacing h2 = 2−k × h1 in the boundary layer. Each of the fine mesh and
coarse mesh contain N/2 grid points; we define the index of the N/2th
gridpoint as M .
We must also consider the choice of size for the two regions. Segal [19]
suggests dividing the interval into [0, 1−8], [1−8, 1], with an equal number
of points in each region. For the values of h1 ∈ [0.1, 0.001], ∈ [0.1, 0.01]
and σ ≈ 1 considered, however, this does not appear to be a large enough
region. In practice, oscillations were observable outside the boundary region
with this division. Heuristically we find the division [0, .9], [.9, 1] to work
well for the values of , σ and h1 considered. In order to accommodate the
mesh size restrictions of the bi-tree, we allow the size of the two regions to
4
2.2. Matrix Structure
vary slightly.
5
2.2. Matrix Structure
Figure 2.3: Non-uniform mesh with N +1 mesh points, two distinct spacings
h1 , h2 .
β1 − 1 β2 + 1 β1 − 1 β2 + 1 h1 + h2
Uj+1 + − Uj − Uj−1 = Sj , j = M; (2.4)
h2 h1 h2 h1
2
!
h2
(β2 − 1) Uj+1 + 2Uj − (β2 + 1) Uj−1 = Sj , j = M + 1, ..., N − 1. (2.5)
2 −1 + β1
−1 + β1 2 −1 − β1
.. .. ..
. . .
−1 + β1 2 −1 − β1
A= (2.6)
−1+β2 β2 +1
− β1h−1 −β2 −1
h1 h1 2 h1
−1 + β2 −1 − β2
2
.. .. ..
. . .
−1 + β2 2
6
2.3. Discrete Solution for Uniform Mesh
Uj = ξ j ,
(β − 1) ξ j+1 + 2ξ j − (β + 1) ξ j−1 = 0.
(β − 1) ξ 2 + 2ξ − (β + 1) = 0,
by which we find
1+β
ξ− = 1, ξ+ = . (2.8)
1−β
This means our solution is
j j
Uj = aξ− + bξ+ .
7
2.4. Discrete Solution for Non-Uniform Mesh
j
By the definition in (2.8), when β > 1, ξ+ < 0, and terms of the form ξ+
will be oscillatory. These non-physical oscillations in the discrete solution
may be large and lead to a poor approximation of the exact solution. When
β ≤ 1 we have no such difficulties. If non-physical oscillations do occur, by
decreasing h we may decrease β to a value ≤ 1 and restore accuracy to the
numerical solution.
with solution
1 + β1
ξ1− = 1, ξ1+ = , j = 1, 2, ..., M − 1;
1 − β1
h2 (1 + β2 )
ξM − = 1, ξM + = , j = M;
h1 (1 − β1 )
1 + β2
ξ2− = 1, ξ2+ = , j = M + 1, ..., N − 1.
1 − β2
Thus, our solution is
j j
Uj = aξ1+ + bξ1− , j = 1, .., M − 1;
j j
Uj = cξM + + dξM − , j = M;
j j
Uj = eξ2+ + f ξ2− , j = M + 1, .., N − 1.
When continuity of the solution is enforced at the transition point, the
equation for j = M is unnecessary and we have
j j
Uj = aξ1+ + bξ1− , j = 1, .., M ; (2.12)
j j
Uj = eξ2+ + f ξ2− , j = M + 1, .., N − 1. (2.13)
8
2.4. Discrete Solution for Non-Uniform Mesh
1
e= M M + ξN
;
α(ξ1+ − 1) − ξ2+ 2+
N
ξ2+
f =1− M − 1) − ξ M + ξ N
;
α(ξ1+ 2+ 2+
As in the case of the uniform mesh, a value of βi > 1 on any area of the
mesh means that ξi+ < 0. This corresponds to a solution where the terms
j
ξi+ give rise to non-physical oscillations.
We now consider again the case of a piecewise uniform mesh with two
distinct mesh sizes, as in Figure 2.3. Suppose that β2 < 1, meaning that
no oscillations are present inside the boundary layer. We would hope that
oscillations outside of the boundary layer would be reduced even if β1 > 1.
9
2.4. Discrete Solution for Non-Uniform Mesh
Figure 2.4: Discrete solution for uniform and non-uniform mesh of (2.1)
with = .01, N = 22, σ = 1.
10
2.4. Discrete Solution for Non-Uniform Mesh
point moves right, less of the overall mesh is finely resolved. It follows that
a transition point of t = 1 corresponds to a uniform coarse mesh. The
coefficients a and e generally decrease as more and more of the mesh is finely
resolved. In particular, e will always decrease, since as the transition point
t −→ 0.5, the two terms in the denominator, α and −ξ2+ M +ξ N , both increase.
2+
The coefficient a may increase or decrease. As t −→ 1, −ξ2M + ξ2N −→ 0 and
a −→ α(ξMα −1) . Whether a increases or decreases depends on whether the
1+
numerator α or the denominator α(ξ1+ M − 1) − ξ M + ξ N is approaching 0
2+ 2+
more quickly. Regardless of its change in size, however, a will be very small
for the choices of N and we investigate. For some choices of M , N , and
, the coefficients a and e are below machine precision, visually removing
the oscillatory part of the solution. In summary, the small values of the
coefficients a and e such as those shown in Figure 2.5 will control the size of
non-physical oscillations arising from large powers of ξ+ < 0 in the solution.
11
Chapter 3
On the Eigenvalues of a
Finite Difference Operator
on a Non-Uniform Mesh
3.1 Matrix Transformation
Consider the (N − 1) × (N − 1) operator A corresponding to the centred
difference approximation on a uniform mesh in (2.2). A is a tridiagonal
Toepliz matrix so its eigenvalues are known analytically. A general tridiag-
onal Toeplitz matrix with entries [b, a, c] will have eigenvalues as shown in
[4]:
√
πj
λj = a + sign(c)2 bc cos , j = 1, ...N − 1. (3.1)
N
p πj
2 − sign(β + 1)2 (β − 1)(−1 − β) cos , j = 1, ...N − 1. (3.2)
N
12
3.1. Matrix Transformation
a1 c1
b1 a1 c1
.. .. ..
. . .
b1 a1 c1
A=
b2 a2 c2 .
b3 a3 c3
.. .. ..
. . .
b3 a3 c3
b3 a3
The entries b2 and c2 limit this from being a block diagonal matrix with
Toeplitz submatrices, for which a closed form solution for the eigenvalues
exists. We attempt to regain a closed form solution.
This matrix can be transformed by the orthogonal similarity transfor-
mation shown in [4] into a symmetric matrix.
α1 γ1,1
γ1,1 α1 γ1,1
.. .. ..
. . .
γ 1,1 α 1 γ2,1
à =
γ2,1 α2 γ3,2 .
γ3,2 α3 γ3,3
.. .. ..
. . .
γ3,3 α3 γ3,3
γ3,3 α3
p
where γi,j = bi cj and αi = ai .
à has form
Ã1 γ2,1 0
à = γ2,1 α2 γ3,2 , (3.3)
0 γ3,2 Ã3
13
3.2. Finding the Secular Equation
Q1 D1 QT1 γ2,1 ek
0
à = γ2,1 eTk α2 γ3,2 eT1 ,
0 γ3,2 e1 Q3 D3 QT3
= QHQT ,
where l1T is the last row of Q1 and f2T is the first row of Q2 . Since they
are related by an orthogonal similarity transformation, H has the same
eigenvalues as Ã.
H is a symmetric arrowhead matrix (SAM). A closed form solution for
irreducible symmetric arrowhead matrices exists [17]; that is, a SAM where
all elements of the first column z = [γ2,1 l1 , γ3,2 f2 ]T are non-zero, and the
diagonal elements di obey d2 >, . . . , > dN −1 .
A symmetric arrowhead matrix may also be transformed into an irre-
ducible symmetric arrowhead matrix. Suppose an entry zi = 0. Since the
column corresponding to di is a scalar multiple of the unit vector ei , (di , ei )
is an eigenvalue eigenvector pair for H. We can therefore remove row and
column i of H and solve the reduced problem to find the remaining eigen-
values of H.
Furthermore, we know that the diagonal entries di are the distinct eigen-
values of Ã1 , Ã3 given by (3.1). If the entries are not ordered d2 >, . . . , >
dN −1 , the matrix may be symmetrically permuted to order them without
affecting the spectral decomposition.
By the Cauchy interlacing theorem, [22], we know that the sorted eigen-
values of H, λi interlace the sorted di :
λ1 ≥ d2 ≥ λ2 ≥ d3 ≥ · · · ≥ λN −2 ≥ dN −1 ≥ λN −1 . (3.4)
14
3.2. Finding the Secular Equation
N −1
c1 c2 X zj2
+ + c3 = h(λ) ≈ f (λ) = λ − α2 + .
di − λ di+1 − λ dj − λ
j=2
We consider
i N −1
X zj2 X zj2
f (λ) = λ − α2 + + ,
dj − λ dj − λ
j=2 j=i+1
= λ − α2 + φ1 (λ) + φ2 (λ).
15
3.2. Finding the Secular Equation
Figure 3.1: Eigenvalues of finite difference operator for (2.1) with uniform
and non-uniform mesh. A1 and A3 are the submatrices of A defined in (3.3).
16
3.2. Finding the Secular Equation
For λ ∈ (di , di+1 ), φ1 (λ) is a sum of positive terms, and φ2 (λ) a sum of
negative terms. Each of φ1 (λ), φ2 (λ) can therefore be computed without
fear of cancellation error. We choose c1 , ĉ1 to satisfy h1 (λk ) = φ1 (λk ),
h01 (λk ) = φ01 (λk ), where
c1
h1 (λ) = ĉ1 + .
di − λ
These conditions are the same as in Newton’s method, except that we
specify a hyperbolic approximation to the graph of φ1 (λ) at λ = λk instead
of a tangent line approximation.
This specification gives us c1 = φ01 (λk )(di − λk )2 and ĉ1 = φ1 (λk ) −
φ01 (λk )(di − λk ).
We similarly choose c2 , ĉ2 to satisfy h2 (λk ) = φ2 (λk ), h02 (λk ) = φ02 (λk ),
where
c2
h2 (λ) = ĉ2 + .
di − λ
This gives us c2 = φ02 (λk )(di+1 −λk )2 and ĉ2 = φ2 (λk )−φ01 (λk )(di+1 −λk ).
We then set
0.1659 0.0371
h(λ) = −0.7499 + λ + 0.4708−λ + 0.6678−λ = 0, which we solve to obtain
λ̄1 = 0.6348. This is within 10−2 of the exact value of λ4 , 0.6438181494679.
0.1690
At the next iteration, we use λ̄1 to construct h(λ) = −0.4349+λ+ 0.4708−λ +
0.0186
0.6678−λ = 0, and solve the equation for a value of λ̄2 = 0.6436, which has
error |λ̄2 − λ4 | < 10−3 . A third iteration has error |λ̄3 − λ4 | < 10−6 .
17
3.2. Finding the Secular Equation
Figure 3.2: Graph of f (λ) and h(λ) for N = 20, = 0.1, σ = 1 and k = 4.
18
Chapter 4
Finite Differences on a
Non-Square Domain
4.1 Convection-Diffusion on Non-Square Domain
Consider the convection-diffusion equation in two dimensions on some do-
main Ω with Dirichlet boundary conditions:
The problem, for small values of σ and τ , is well posed. The simplest case
to consider is when Ω is a polyomino [8], that is, made up of a combination
of orthogonal squares. This property implies that (4.1) can be solved numer-
ically using the second order centered finite difference (FD) method illus-
1
trated below with a uniform grid. A grid with mesh size h = n+1 and origin
(x0 , y0 ) is made up of the uniformly spaced points (xi , yj ) = (x0 +ih, y0 +jh)
for 1 ≤ i, j, ≤ n. We will define Ui,j as our numerical approximation to
u(xi , yj ). Similar notation may be used to refer to other functions defined
on the grid, such as f or u. A representation of a subset of the grid is shown
in Figure 4.1. We also assume that our grid points are labelled lexicograph-
ically, which for Figure 4.1 would result in the labelling shown in Figure
4.2.
Given a uniform grid with mesh size h and points as shown in Figure
4.1, we will use the following centred finite difference discretizations in our
finite difference scheme.
Ui+1,j − Ui−1,j
Dx0 Ui,j = , (4.2)
2h
0 Ui+1,j − 2Ui,j + Ui−1,j
Dxx Ui,j = , (4.3)
h2
with analogous definitions of Dy0 , Dyy
0 . These definitions give us the following
19
4.2. Motivating Problems
20
4.3. Computational Schemes
21
4.3. Computational Schemes
l ± 1.
When the grid is non-uniform and non square, the adjacent grid points
are no longer labelled ±n or ±1. An example of this can be seen in Figure
4.3.
Since we no longer have consistent spacing of labels, we must use an
alternate scheme to find the neighbours of each grid point. We find the row
and column index, i, j of each grid point, then add or subtract 1 from these
indices to find the respective neighbour. For example, to find the northern
neighbour of the point 15 in Figure 4.3, we find its row and column indices
of (3, 3) , as shown in Figure 4.4. We then find the lexicographic label (14)
of the grid point with row and column indices of (2, 3). The lexicographic
labels are stored in an array to allow the described indexing.
22
4.4. Domain with a Curved Boundary
Figure 4.3: Lexicographic indices for a locally refined grid. Spaces corre-
sponding to a missing index are in yellow, and grid points affected by the
missing indices are in green.
23
4.4. Domain with a Curved Boundary
Figure 4.4: Row and column indices for a locally refined grid. Spaces cor-
responding to a missing index are in yellow, and grid points affected by the
missing indices are in green.
24
4.4. Domain with a Curved Boundary
Figure 4.5: Grid points on (4.6) with h = 0.0625, N = 176. Grid points
lying on a uniform mesh are shown in blue, and additional grid points on
the boundary of the domain shown as red circles.
25
4.4. Domain with a Curved Boundary
Now that we have finite difference equations for all grid points, we can
construct and solve the full linear system Ax = b for the discretized problem.
We do so for the problem with exact solution:
26
4.5. Reentrant Corner
1
uexact (x, y) = exy y(1 − y)x(1 − x)(s(x − 0.5)2 + (y − 0.5)2 − r2 ) + 1. (4.11)
s
The 90◦ angle formed by this domain at the origin is called a “reentrant
corner”.
27
4.5. Reentrant Corner
28
4.5. Reentrant Corner
29
4.5. Reentrant Corner
30
4.6. Alternative Discretizations
thogonal neighbours required for the centred finite difference scheme (4.16).
Even if a grid point does have all four neighbors, they may not be uni-
formly distanced from the central point. We will now discuss the necessary
alterations to the finite difference scheme to accommodate these difficulties.
31
4.6. Alternative Discretizations
Table 4.2: Convergence of FD scheme for (5.2) on (4.12). E2 = ||U −uexact ||2
and E∞ = ||U − uexact ||∞ .
where
2 2
a=− − ,
h1 (h1 + h2 ) h2 (h1 + h2 )
2
b= ,
h1 (h1 + h2 )
2
c= .
h2 (h1 + h2 )
32
4.6. Alternative Discretizations
Figure 4.12: Locally refined grid for (4.12), hmax = 0.0625, k = 64.
t h22 h2
Dyy u ≈au + b(u + h2 ux + h3 uy + uxx + h2 h3 uxy + 3 uyy )
2 2
h21 h2
+ c(u + h1 ux − h3 uy + uxx − h1 h3 uxy + 3 uyy )
2 2
h21 h2
+ d(u − h1 ux + uxx ) + e(u + h2 ux + 2 uxx )
2 2
h24
+ f (u − h4 uy + uyy )
2
33
4.6. Alternative Discretizations
Figure 4.13: Locally refined grid for (4.12), hmax = 0.03125, k = 256.
(a + b + c + d + e + f )u = 0;
(h2 b − h1 c)ux = 0;
(h3 b + h3 c − h4 f )uy = 0;
We have six equations and six unknowns. We solve the resulting system
34
4.6. Alternative Discretizations
36
4.6. Alternative Discretizations
Figure 4.16: FD operator for (5.2) on L-shaped domain with locally refined
grid, N = 205. Grid points are labelled lexicographically.
where
h3
a= ;
h24 + h3 h4
h1 h4
b= ;
h3 (h1 + h2 )(h3 + h4 )
h2 h4
c= ;
h3 (h1 + h2 )(h3 + h4 )
h2 h4
d=− ;
h3 (h1 + h2 )(h3 + h4 )
h1 h4
e=− ;
h3 (h1 + h2 )(h3 + h4 )
h3
f =− .
h24 + h3 h4
37
4.6. Alternative Discretizations
38
Chapter 5
39
5.2. Data Structure
40
5.3. Domain Definition and Refinement Strategies
Figure 5.2: Entries in the Depth Map array before and after the cell in left
hand corner is refined. Cells undergoing refinement are in yellow.
√
min |φ(v)| ≤ 2hc , (5.1)
v∈vertices(c)
41
5.4. The Discretization Scheme
42
5.4. The Discretization Scheme
−uxx − uyy = f u ∈ Ω,
(5.2)
u=g u ∈ δΩ.
∇ · ∇u = f, u∈Ω (5.3)
u=g u ∈ δΩ (5.4)
We now turn our attention to the discretized problem. Our grid is made
up of square cells but is not necessarily uniform; these cells may be of dif-
ferent sizes. Recall, however, that the grid is graded; a cell’s size must be
at most a factor of 2 different from any adjacent neighbour.
x+ x−
As in [5], we define wi,j , wi,j as approximations of the flux across the
x+ x− y+ y−
sides of the cell si,j and si,j respectively. Similarly, we define wi,j , wi,j as
y+ y−
approximations of the flux across si,j and si,j .
43
5.4. The Discretization Scheme
Consider a cell, ci,j , with volume vi,j , as shown in Figure 5.4. By a mass
balance approach, we get the divergence equation, as in [10, 11],
ZZ
1 x+ x− y+ y− 1
(wi,j − wi,j + wi,j − wi,j )= f (x, y)dxdy (5.5)
vi,j vi,j ci,j
We need to define the fluxes wi,j in terms of Ui,j , the discrete solution
value at the cell center. We define the gradient operator on the cell faces.
For regular cells, the simple difference:
x− 1
wi,j = (Ui,j − Ui−1,j ) (5.6)
hi,j
is a second order approximation. A similar definition exists for the three
other cell faces.
At non-regular points, many different possible discretizations exist. As
stated previously, we wish to use a symmetric discretization. As proposed
44
5.4. The Discretization Scheme
in [5] and implemented in [10, 11], we use the same two point difference
as in the regular cell case, (5.6). This scheme has the advantage of being
symmetric. More accurate schemes exist, but they are more expensive with
respect to the number of neighbouring points required, and may not be
symmetric.
Mass conservation gives us that
x+ x− x−
wi,j = wi+1,j+1 + wi+1,j−1 ,
x+ 1 1
wi,j = (Ui+1,j+l − Ui,j ) + (Ui+1,j−1 − Ui,j ),
hi+1,j+1 hi+1,j−1
x+ 2 2
wi,j = (Ui+1,j+l − Ui,j ) + (Ui+1,j−1 − Ui,j ).
hi,j hi,j
45
5.5. Numerical Results
point inside ci,j . Note that the boundary of the domain might not pass
exactly through the center of a cell; we extend the value of u(xi , yj ) at the
boundary over the cell.
Cells in the domain where φ(x, y) < 0 are set to have a solution value
of 0. Then, since all points in Ω− have a defined value, we can remove
equations corresponding to these points from the system of linear equations.
We modify the rows corresponding to points inside the operator that contain
boundary terms such that the matrix entry is replaced by subtracting the
boundary value at that point from the right hand side of the equation.
Therefore, our operator contains equations corresponding only to points
inside Ω+ .
To summarize, we have found a symmetric scheme that allows for adap-
tive domain refinement. This scheme may be used for non-polyomino do-
mains and for non-uniform (graded) quadtree meshes. However, it should be
noted that the price we have paid for symmetry is a less accurate operator;
O(h) instead of the O(h2 ) accurate scheme considered in Chapter 4.
• A cross shape,
• a circle,
• an L-shape,
46
5.5. Numerical Results
Figure 5.6: Domains considered in Section 5.5. Boundary points for the
domain are red circles, and point inside the domain green diamonds.
• a star,
47
5.5. Numerical Results
Table 5.1: Convergence of FD scheme for (5.2) with (5.14) on circle shaped
domain (5.9). E2 = ||U2h − Uh ||2 and E∞ = ||U2h − Uh ||∞ . k is the largest
factor of refinement.
48
5.5. Numerical Results
We expect that we can return to the first order accuracy of the Div-
Grad scheme by refining near a reentrant corner, as in Chapter 4. We wish
to refine in such a way that when the mesh size is halved everywhere, the
error is reduced by a factor of 2. In Chapter 4, an additional two layers of
refinement were necessary to regain O(h2 ) accuracy; here one layer should
2
be sufficient to return to O(h) accuracy. Since we expect O(h 3 ) accuracty
near the origin, an additional layer of refinement will mean that the mesh
size is reduced by a factor of 4 there. We would then expect the error to be
2
reduced by a factor of ( 14 ) 3 < 12 . This error reduction is sufficient for O(h)
accuracy. This refinement scheme is shown in Figure 5.8 for the L-shaped
domain (5.10). We see that the error converges at the expected rate.
We consider the conditioning of the operators for the two different dis-
cretization schemes that have been used in Chapters 4 and 5 to solve (5.2) on
an L-shaped mesh (5.10). In both schemes, the mesh is refined strategically
near the origin. Recall that for the FD scheme of Chapter 4, we add two ad-
ditional refinement layers near the origin to return to O(h2 ) accuracy, and for
the Div-Grad scheme, only one layer to return to O(h) accuracy. In Figure
5.9, we observe the condition numbers of the operators in the two different
schemes. We see that κ(R) grows approximately at a rate κ(R) ∝ h0−2.0019
49
5.5. Numerical Results
for the Finite Difference scheme, and at a rate κ(R) ∝ h−1.1775 0 for the
Div-Grad scheme. We can currently only observe these values; drawing ex-
tensive conclusions may be unwise as the discretization schemes they are the
product of have different orders of accuracy.
We also consider the structure of the Div-Grad operator, as shown in
Figure 5.10. In comparison with the FD operator of Chapter 4, this op-
erator is much more compact. In particular, we note that the long trains
of connectivity of the FD operator are not present here; instead we have
only the occasional entry outside of a roughly banded operator. However,
the operator is still far from being perfectly banded. This relative lack of
structure would make an extension of the eigenvalue decomposition scheme
in Chapter 3 quite difficult. In 1D, an operator for a piecewise uniform mesh
remains symmetric, though it may no longer be Toeplitz as in the case of
the uniform mesh. However, the loss of a uniform mesh results in no loss of
structure in 1D; the operator is still tridiagonal and structurally symmetric,
50
5.5. Numerical Results
and therefore symmetrizable. In 2D, the loss of a uniform mesh means the
resulting operator is no longer pentadiagonal, and may no longer be even
structurally symmetric. This is the case for the operator shown in Chapter
4. Structural symmetry may be regained, as shown here, but the matrix is
still not banded. As the banded nature of the operator was critical in finding
the secular equation in Chapter 3, the lack of structure in these operators
is troubling. Approximation of the eigenvalues may still be possible, for ex-
ample based on a decomposition of the operator approximated by its closest
51
5.5. Numerical Results
banded counterpart, but these experiments have not yet proved fruitful.
52
Chapter 6
Conclusions
We have discussed and compared various discretization schemes for the solu-
tion of elliptic equations on a non-square domain. We explored two strategies
for dealing with boundaries that did not pass through grid points. A modi-
fied discretization scheme can be used, as in Chapter 4, or the value at the
boundary can be extended to the grid point, as in Chapter 5. In the former
case, a suitable choice of discretization may not affect the overall accuracy of
the scheme, even if the truncation error appears to suggest lower accuracy,
as discussed in Chapter 4.
We also encounter potential accuracy loss for the case of a reentrant
corner. Here, the loss in accuracy is due to the problem itself and not the
discretization scheme. We can restore the scheme to its expected accuracy
by refining strategically near the reentrant corner.
Alongside our pursuit of accuracy we have sought symmetry for our oper-
ator. In 1D, a non-uniform mesh still results in an operator that is at least
structurally symmetric and thus symmetrizable. However, in 2D the two
goals of accuracy and symmetry seem somewhat at odds with one another.
For a given “cost” for example, the number of points in a given scheme, one
can “purchase” either a symmetric and less accurate or nonsymmetric and
more accurate scheme. We have considered both a first order accurate, sym-
metric scheme and a second order accurate nonsymmetric scheme. Future
work could include pursuing a second order symmetric scheme.
A significant reason for pursuing a symmetric, or at least symmetrizable
scheme is the goal of finding a generalized form or approximation for the
eigenvalues of the operator in the system of linear equations. In 1D, this
has proven achievable, as discussed in Chapter 3. A significant feature of
the 1D operator in finding an approximation of its eigenvalues is its banded
structure, even for a non-uniform mesh. This banded structure allows us to
decompose our matrix and obtain the secular equation. In higher dimensions
however the loss of a uniform, square mesh also means the loss of structure
in our matrix. Approximation of the eigenvalues may still be possible, but
has not yet been successfully attempted.
We also consider the different finite difference schemes from a computa-
53
Chapter 6. Conclusions
54
Bibliography
[1]
[7] R. A. Finkel and J. L. Bentley. Quad trees a data structure for retrieval
on composite keys. Acta informatica, 4(1):1–9, 1974.
55
Bibliography
[14] MATLAB. version 8.3 (R2014a). The MathWorks Inc., Natick, Mas-
sachusetts, 2014.
[18] Y. Saad. Iterative methods for sparse linear systems. Siam, 2003.
56