Information Technology Reference
In-Depth Information
The most prominent reason for adopting parallel computing is the need to finish
a large computational task more quickly. To illustrate this point, let us consider a
simplified three-dimensional diffusion equation:
@
2
u
@x
2
@
2
u
@y
2
C
@
2
u
@
u
@t
D
C
@
z
2
;
(10.1)
for which a more general form was introduced in Sect. 7.2.
We want to develop an explicit numerical scheme that is based on finite differ-
ences for the above 3D equation. This will be done in the same fashion as for the 1D
version described in Sect. 7.4. Suppose superscript
`
denotes a discrete time level,
subscripts
i; j; k
denote a spatial grid point,
t
denotes the time step size, and
x
,
y
,and
z
denote the spatial grid spacing. Then, the temporal derivative term in
(
10.1
) is discretized as
u
`C1
i;j;k
u
i;j;k
t
@
u
@t
:
For the spatial derivative term in the
x
-direction, the finite difference approximation
is
u
i 1;j;k
2
u
i;j;k
C
u
i C1;j;k
@
2
u
@x
2
:
x
2
The other two spatial derivative terms
@
2
u
=@y
2
and
@
2
u
=@
z
2
can be discretized
similarly.
Combining all the finite differences together, the explicit numerical scheme for
the 3D diffusion equation (
10.1
)arisesas
u
`C1
i;j;k
u
i;j;k
t
u
i 1;j;k
2
u
i;j;k
C
u
i C1;j;k
D
x
2
u
i;j1;k
2
u
i;j;k
C
u
i;jC1;k
C
y
2
u
i;j;k1
2
u
i;j;k
C
u
i;j;kC1
C
:
(10.2)
z
2
For simplicity we assume that the solution domain is the unit cube with a
Dirichlet boundary condition, e.g.,
u
D 0
. The values of
u
i;j;k
are prescribed by
some initial condition
u
.x; y;
z
;0/ D I.x; y;
z
/
. If the spatial grid spacing is the
same in all three directions, i.e.,
x D y D
z
D h D 1=n
, the explicit numer-
ical scheme will have the following formula representing the main computational
work per time step: