by
In: Handbook of Fluid Dynamics and Fluid Machinery, J. A. Schetz and A. E. Fuhs,
eds., John Wiley & Sons, New York, NY, 1996.
ABSTRACT
I. Introduction
Here we will review these methods and note that further details can be found in
[2] and [13]. In what follows, we will determine an approximate solution to
Poisson’s equation in Cartesian coordinates; namely,
_∂___ _∂___
2 2
u u
+ = f (x ,y ) . (1)
∂x 2
∂y 2
To solve Poisson’s equation, one must specify the region as well as the
appropriate conditions on the solution on the boundaries of the region.
Although fast, direct methods can be used to facilitate the solution on irregular
regions, [3], [6], here, for exposition, we assume a rectangle a ≤ x ≤ b and
c ≤ y ≤ d . The region is assumed rectangular in the coordinate system but not
necessarily in physical space. For example, in cylindrical coordinates, a fast
solution can be obtained on the region a ≤ r ≤ b and c ≤ z ≤ d . In fluid
models, one of the following boundary conditions can be specified on each of
the four boundaries of the rectangle.
∫ ∫
b d
f (x ,y ) dy dx = 0 , (2)
a c
Second, if a solution to this problem exists then it is not unique. That is, if u
is a solution, then u + c is also a solution for any constant c . This is usually
not a problem for fluid models because the gradient of u is used in the time-
dependent equations that describe the motion of the fluid. This situation is not
uncommon in fluid models and is the subject of section V.
In the remaining sections we develop the large linear system of equations that
arise from the second-order, central finite difference approximation to equation
(1). We also present two algorithms that provide reliable and fast solutions, dis-
cuss extensions to more general problems, and describe software that can be
used to solve Poisson’s equation subject to the boundary conditions listed
above. In section VII we discuss the implementation on multiprocessor comput-
ers.
-4-
1 1
____ (vi −1,j − 2vi ,j + vi +1,j ) + ____ (vi ,j −1 − 2vi ,j + vi ,j +1) = f i ,j , (3)
∆x 2
∆y 2
Av 0 + v1 + vN −1 = g0 , (5a)
v j −1 + Av j + v j +1 = g j for j = 1, . . . , N −2 , (5b)
v0 + vN −2 + AvN −1 = gN −1 , (5c)
where
and
−2α 1 1
1
−2α 1
1 .
A = ρ2 . (6)
. 1
1 1 −2α
-5-
Here we will use the Fourier method to solve the finite difference equations
and note only that the Fourier method can also be used to solve Poisson’s
equation directly. The latter approach is called the spectral method [5] which is
more accurate; however, the treatment of nonhomogeneous boundary conditions
is somewhat more complicated.
The Fourier method for solving the finite difference equations comes under the
more general heading of matrix decomposition for reasons that will become
evident. The matrix decomposition method can be applied to problems with
nonzero boundary conditions. The resulting solution has the accuracy of the
finite difference method, which is usually consistent with the accuracy of the
other approximations in the fluid model but it is not as accurate as the spectral
method. In this section, we will describe the matrix decomposition method for
solving the large sparse system of equations (5a-c).
1. Derive a new system of equations that is easy to solve and whose vari-
ables are the Fourier coefficients of the solution. This step includes the
-6-
ĝ j = QT g j j = 0, . . . , N −1 .
Further, define
v̂ j = QT v j j = 0, . . . , N −1 . (8)
v̂ j −1 + QT AQv̂ j + v̂ j +1 = ĝ j (9)
for k = 0, . . . , M −1 .
The Fourier coefficients v̂k ,j can easily be determined by solving these systems
and the solution can then be computed from the inverse of (8). Using the
results we can now summarize the matrix decomposition method:
1. Given the tabulation of the right-hand side g j , then, using the fast Fourier
transform (FFT), [4], [12], we first compute
ĝ j = QT g j . (11)
v j = Qv̂ j . (12)
The FFT is the key to the efficiency of this method. The matrix Q depends on
the form of the matrix A, which in turn depends on the boundary conditions.
For periodic boundary conditions the M ×M matrix A has the form given in
(6). For M even, the Fourier transform (11) is given by
M −1
2
ĝ 0,j = ___
M Σ gi ,j ,
i =0
M −1
2
ĝM −1,j = ___
M Σ (−1)i gi ,j
i =0
A similar formula can be given for the case when M is an odd integer. The
inverse Fourier transform (12) is given by
-8-
1 1
vi ,j = __ v̂ 0,j + __ (−1)i v̂M −1,j
2 2
M ⁄2−1
+ Σ (v̂ 2k −1,j cos ik 2π⁄M + v̂ 2k ,j sin ik 2π⁄M ) (14)
k =1
λ0 = −2
The second fast direct method we present is the cyclic reduction algorithm [2],
[9]. This algorithm is a recursive scheme that eliminates half of the unknowns
at each step until there remains a single equation that can be solved. The
remaining unknowns are computed easily by a back-substitution method.
Av0 + v1 + v7 = g0
v0 + Av1 + v2 = g1
v1 + Av2 + v3 = g2
v2 + Av3 + v4 = g3 (16)
v3 + Av4 + v5 = g4
v4 + Av5 + v6 = g5
v5 + Av6 + v7 = g6
v0 + v6 + Av7 = g7
Multiply the second equation by −A and add to it the first and third equations.
The result is the equation
Repeating this procedure on the sixth and eighth equation we obtain the
reduced system
A(1) v1 + v3 + v7 = g1(1)
v1 + A(1) v3 + v5 = g3(1)
v1 + v5 + A(1) v7 = g7(1)
where
System (17) has half the number of original unknowns. Furthermore, it has
exactly the same form as (16), so the process can be repeated and the
unknowns can be halved again. Multiply the second equation by −A(1) and add
to it the first and third equations. Multiply the fourth equation by −A(1) and
add to it the third and first equations to get the further reduced system
A(2)v3 + 2 v7 = g3(2)
where
where
Once we have solved equation (19) for v7 we can solve for v3 from the first
equation of system (18) and solve for v1 and v5 from the first and third equa-
tions of system (17); we obtain v0, v2, v4, and v6 from system (16). There
remains now the task of solving equation (19) for v7. Note that the auxiliary
matrices A(k ) that were created in the reduction process are polynomials of
degree 2k in the original matrix A. These polynomials have known real roots
λi(k ) so we can rewrite equation (19), using the factored form of the polynomial
for A(3), as
7
Π (A − λi(7)I) v7 = g7(3) , (20)
i =0
1. set z0 = g7(3)
2. for i = 1, . . . , 8 , solve
(A − λi(7)I)zi = zi −1 . (21)
The last vector obtained, z8, is the solution v7, of equation (9).
and developing recurrence relations for p j(k ) and q j(k ) which involve solving a
linear system of equations with coefficient matrix A(k −1).
We have illustrated the algorithm for the case N = 8 = 23. In general, for
N = 2p , p reduction steps are required to reduce the original system to a single
equation for the unknown vN . At each step of the reduction phase there are
N ⁄ 2 tridiagonal systems to be solved. Solving for vN requires the solution of
N periodic tridiagonal systems. Finally, there are p back-substitution steps to
find the remaining unknowns, at each step of which N ⁄ 2 periodic tridiagonal
systems are solved. The grand total number of tridiagonal systems to be solved
is, therefore, N (p +1) = N log2N + N . Each periodic tridiagonal system
requires 5M multiplications so the total operation count is about 5MN log2N .
This count is less than the count for the Fourier method, however, in practice,
the stable Buneman variant is about 25% slower than the Fourier method on a
vector computer. The relative speed of these two methods will vary depending
on the implementation and the computer.
Perhaps the most unique attribute of direct methods is the ability to determine
least squares solutions to Poisson’s equation. As mentioned earlier, it is rela-
tively common in fluid models to pose problems that do not have a computa-
tional solution. This difficulty results from computational and/or observational
errors and would not be a problem for the continuous fluid model with exact
data. That is, roundoff, truncation, and observational errors likely produce an
inconsistent system (5a-c) in which the constraint (7) is not satisfied even
though constraint (2) is satisfied with an exact right side f (x ,y ). In this sec-
tion, we show how to perturb the right side of Poisson’s equation so that either
the Fourier or cyclic reduction method can be used to compute a solution to the
perturbed system. Solutions to the perturbed system are least squares solutions
to the unperturbed system.
M −1 N −1
1
gi ,j = f i ,j − ____
MN Σ Σ f i ,j , (22)
i =0 j =0
- 12 -
then gi ,j satisfies the constraint (7). In [10] it is shown that system (5a-c) has a
solution if f i ,j is replaced with gi ,j . Further, it is shown that the solution is a
least squares solution to the unperturbed problem. That is, the solution minim-
izes the l 2 norm of the residual in equations (5a-c).
A slight modification of the direct methods is necessary for the doubly periodic
case under consideration. Using the Fourier method, the periodic tridiagonal
system (10a-c) is singular for k = 0. Using a fast variant of Gauss elimination, a
zero pivot is computed for j = N −1. However, because gi ,j satisfies the con-
straint (7), it can be shown that the right side of the zero pivot equation is also
zero yielding an equation of the form 0 . v̂ 0,N −1 = 0. Therefore v̂ 0,N −1 can be set
to any value which demonstrates that the solution is not unique. In practice, the
zeros in the pivot equation are not identically zero, but on the order of roundoff
error. Hence, proceeding with Gauss elimination will compute a v̂ 0,N −1 that is
on the order of one. Therefore, the only modification of the direct method is
an identically zero test in which case v̂ 0,N −1 can be set to any value, say,
v̂ 0,N −1 = 1.
The constraint (7) is valid only for the doubly periodic case considered here. It
will vary depending on the boundary conditions and the coordinate system
under consideration. The general form of the constraint is
if jf
0= Σ Σ wi w j f i ,j , (23)
i =is j =js
original problem. In this case, an effort should be made to understand why the
original problem did not have a solution.
VI. Software
The advent of fast direct methods has significantly reduced computation time
for fluid models. In addition, they have also reduced the development time
since the methods have been implemented in a public domain FORTRAN pack-
age called FISHPACK [10], [11]. This package automatically provides com-
plete second-order finite difference approximations to two-dimensional Poisson
equations in several frequently used coordinate systems (Cartesian, cylindrical,
and spherical), and the three-dimensional Poisson equation in Cartesian coordi-
nates. The software incorporates the given boundary data and calculates the
correct approximation at coordinate singularities; e.g., the origin r =0 in spheri-
cal coordinates. When the problem specified is singular, the software checks
the correct condition to determine whether a solution exists and, if it does not,
subtracts the appropriate constant from the data to guarantee that a weighted
least-squares solution to the original equation exists, and finds it.
In addition, the software includes subroutines for more general separable ellip-
tic equations that have the added capability of providing fourth-order accurate
solutions. The most general equation solved by the package is the separable
elliptic equation
∂2u _∂u
__ + c (x )u + d (y ) _∂___
2
u ∂u
a (x ) ____ + b (x ) + e (y ) ___ + f (y )u = g (x ,y ) (24)
∂x 2 ∂x ∂y 2 ∂y
that is solved with a software implementation of the generalized cyclic reduc-
tion algorithm given in [9]. Except for the three-dimensional Cartesian solver,
the codes are written for two space dimensions. Nevertheless, three-dimensional
versions are available in private domain software CRAYFISHPAK [16].
Software is also available for irregular regions [3], [7].
construction and running of various test problems. Finally, the Fourier method
described in section III. can be implemented directly with the assistance of
FFTPACK which includes sine, cosine, and the quarter wave transforms as well
as the traditional real and complex periodic transforms. Both FISHPACK and
FFTPACK are distributed by NCAR. Distribution information can be obtained
from either author.
There are several reasons why the transpose method is preferred. First, and
foremost, it requires less communication. Using current parallel transpose algo-
rithms, the communication complexity is proportional to the data complexity;
that is, the transposition of a P × N array can be performed in O (N ) time on P
processors. However, if the data are not reconfigured, then the communication
complexity of the FFTs in the longitudinal direction may be proportional to its
computational complexity. If N is the number of longitudinal points, the com-
putational (and communication) complexity of P distributed FFTs of length N
is O (N logN ). In general, where applicable, it is preferable to move the data
into a processor with a communication complexity proportional to the data
complexity, rather than implement a distributed algorithm in which the com-
munication complexity may be proportional to the computational complexity.
REFERENCES
[3] B. Buzbee, F. Dorr, J. George, and G. Golub, The direct solution of the
discrete Poisson equation on irregular regions, SIAM J. Numer. Anal. 8
(1971), 722-736.
[4] J. Cooley and J. Tukey, An algorithm for the machine calculation of com-
plex Fourier series, Math. Comp. 19 (1965), 297-301.
109, Nat. Ctr. for Atmospheric Res., Boulder, CO, 1975, available from
the Nat. Tech.Inform. Service as document PB263 498/AS.
[14] P. N. Swarztrauber and R. A. Sweet, Vector and parallel methods for the
direct solution of Poisson’s equation, J. Comp. Applied Math. 27 (1989)
241-263.