
Iterative Stencil Loops (ISLs) or Stencil computations are a class of numerical data processing solution
[
Roth, Gerald et al. (1997)
Proceedings of SC'97: High Performance Networking and Computing.
]
Compiling Stencils in High Performance Fortran.
'
which update
array elements according to some fixed pattern, called a stencil.
[
Sloot, Peter M.A. et al. (May 28, 2002)
]
Computational Science – ICCS 2002: International Conference, Amsterdam, the Netherlands, April 21–24, 2002. Proceedings, Part I.
'
Page 843. Publisher: Springer. .
They are most commonly found in
computer simulation
Computer simulation is the running of a mathematical model on a computer, the model being designed to represent the behaviour of, or the outcome of, a real-world or physical system. The reliability of some mathematical models can be determin ...
s, e.g. for
computational fluid dynamics
Computational fluid dynamics (CFD) is a branch of fluid mechanics that uses numerical analysis and data structures to analyze and solve problems that involve fluid dynamics, fluid flows. Computers are used to perform the calculations required ...
in the context of scientific and engineering applications.
Other notable examples include solving
partial differential equations
In mathematics, a partial differential equation (PDE) is an equation which involves a multivariable function and one or more of its partial derivatives.
The function is often thought of as an "unknown" that solves the equation, similar to how ...
,
the
Jacobi kernel, the
Gauss–Seidel method,
image processing
An image or picture is a visual representation. An image can be two-dimensional, such as a drawing, painting, or photograph, or three-dimensional, such as a carving or sculpture. Images may be displayed through other media, including a pr ...
and
cellular automata.
[
Fey, Dietmar et al. (2010)
]
Grid-Computing: Eine Basistechnologie für Computational Science
'.
Page 439. Publisher: Springer.
The regular structure of the arrays sets stencil techniques apart from other modeling methods such as the
Finite element method
Finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat tran ...
. Most
finite difference codes which operate on regular grids can be formulated as ISLs.
Definition
ISLs perform a sequence of sweeps (called timesteps) through a given array.
Generally this is a 2- or 3-dimensional regular grid.
The elements of the arrays are often referred to as cells. In each timestep, all array elements are updated.
Using neighboring array elements in a fixed pattern (the stencil), each cell's new value is computed. In most cases boundary values are left unchanged, but in some cases (e.g.
LBM codes) those need to be adjusted during the computation as well. Since the stencil is the same for each element, the pattern of data accesses is repeated.
More formally, we may define ISLs as a
5-tuple with the following meaning:
*