<s>
which	O
update	O
array	B-Data_Structure
elements	I-Data_Structure
according	O
to	O
some	O
fixed	O
pattern	O
,	O
called	O
a	O
stencil	B-Algorithm
.	O
</s>
<s>
They	O
are	O
most	O
commonly	O
found	O
in	O
computer	B-Application
simulations	I-Application
,	O
e.g.	O
</s>
<s>
Other	O
notable	O
examples	O
include	O
solving	O
partial	O
differential	O
equations	O
,	O
the	O
Jacobi	B-Algorithm
kernel	O
,	O
the	O
Gauss	B-Algorithm
–	I-Algorithm
Seidel	I-Algorithm
method	I-Algorithm
,	O
image	B-Algorithm
processing	I-Algorithm
and	O
cellular	O
automata	O
.	O
</s>
<s>
The	O
regular	O
structure	O
of	O
the	O
arrays	O
sets	O
stencil	B-Algorithm
techniques	O
apart	O
from	O
other	O
modeling	O
methods	O
such	O
as	O
the	O
Finite	B-Application
element	I-Application
method	I-Application
.	O
</s>
<s>
Most	O
finite	B-Algorithm
difference	I-Algorithm
codes	I-Algorithm
which	O
operate	O
on	O
regular	O
grids	O
can	O
be	O
formulated	O
as	O
ISLs	O
.	O
</s>
<s>
In	O
each	O
timestep	O
,	O
all	O
array	B-Data_Structure
elements	I-Data_Structure
are	O
updated	O
.	O
</s>
<s>
Using	O
neighboring	O
array	B-Data_Structure
elements	I-Data_Structure
in	O
a	O
fixed	O
pattern	O
(	O
the	O
stencil	B-Algorithm
)	O
,	O
each	O
cell	O
's	O
new	O
value	O
is	O
computed	O
.	O
</s>
<s>
LBM	B-Algorithm
codes	I-Algorithm
)	O
those	O
need	O
to	O
be	O
adjusted	O
during	O
the	O
computation	O
as	O
well	O
.	O
</s>
<s>
Since	O
the	O
stencil	B-Algorithm
is	O
the	O
same	O
for	O
each	O
element	O
,	O
the	O
pattern	O
of	O
data	O
accesses	O
is	O
repeated	O
.	O
</s>
<s>
is	O
the	O
stencil	B-Algorithm
itself	O
and	O
describes	O
the	O
actual	O
shape	O
of	O
the	O
neighborhood	O
.	O
</s>
<s>
There	O
are	O
elements	O
in	O
the	O
stencil	B-Algorithm
.	O
</s>
<s>
The	O
stencil	B-Algorithm
is	O
an	O
ordered	O
set	O
of	O
relative	O
coordinates	O
.	O
</s>
<s>
This	O
may	O
be	O
useful	O
for	O
implementing	O
periodic	B-Algorithm
boundary	I-Algorithm
conditions	I-Algorithm
,	O
which	O
simplifies	O
certain	O
physical	O
models	O
.	O
</s>
<s>
To	O
illustrate	O
the	O
formal	O
definition	O
,	O
we	O
'll	O
have	O
a	O
look	O
at	O
how	O
a	O
two	O
dimensional	O
Jacobi	B-Algorithm
iteration	I-Algorithm
can	O
be	O
defined	O
.	O
</s>
<s>
The	O
most	O
common	O
stencils	B-Algorithm
are	O
the	O
2D	O
or	O
3D	O
versions	O
of	O
the	O
von	O
Neumann	O
neighborhood	O
and	O
Moore	O
neighborhood	O
.	O
</s>
<s>
The	O
example	O
above	O
uses	O
a	O
2D	O
von	O
Neumann	O
stencil	B-Algorithm
while	O
LBM	B-Algorithm
codes	I-Algorithm
generally	O
use	O
its	O
3D	O
variant	O
.	O
</s>
<s>
That	O
said	O
,	O
other	O
stencils	B-Algorithm
such	O
as	O
a	O
25-point	O
stencil	B-Algorithm
for	O
seismic	O
wave	O
propagation	O
can	O
be	O
found	O
,	O
too	O
.	O
</s>
<s>
Since	O
computing	O
time	O
and	O
memory	O
consumption	O
grow	O
linearly	O
with	O
the	O
number	O
of	O
array	B-Data_Structure
elements	I-Data_Structure
,	O
parallel	O
implementations	O
of	O
ISLs	O
are	O
of	O
paramount	O
importance	O
to	O
research	O
.	O
</s>
<s>
at	O
the	O
moment	O
GPGPUs	B-Architecture
have	O
proven	O
to	O
be	O
most	O
efficient	O
.	O
</s>
<s>
Due	O
to	O
both	O
the	O
importance	O
of	O
ISLs	O
to	O
computer	B-Application
simulations	I-Application
and	O
their	O
high	O
computational	O
requirements	O
,	O
there	O
are	O
a	O
number	O
of	O
efforts	O
which	O
aim	O
at	O
creating	O
reusable	O
libraries	O
to	O
support	O
scientists	O
in	O
performing	O
stencil-based	O
computations	O
.	O
</s>
<s>
The	O
libraries	O
are	O
mostly	O
concerned	O
with	O
the	O
parallelization	O
,	O
but	O
may	O
also	O
tackle	O
other	O
challenges	O
,	O
such	O
as	O
IO	O
,	O
steering	B-Application
and	O
checkpointing	B-General_Concept
.	O
</s>
<s>
This	O
is	O
only	O
feasible	O
with	O
techniques	O
such	O
as	O
class	B-Application
templates	I-Application
or	O
metaprogramming	B-Application
,	O
which	O
is	O
also	O
the	O
reason	O
why	O
this	O
design	O
is	O
only	O
found	O
in	O
newer	O
libraries	O
.	O
</s>
