<s>
In	O
mathematics	O
,	O
especially	O
the	O
areas	O
of	O
numerical	B-General_Concept
analysis	I-General_Concept
concentrating	O
on	O
the	O
numerical	B-Algorithm
solution	I-Algorithm
of	I-Algorithm
partial	I-Algorithm
differential	I-Algorithm
equations	I-Algorithm
,	O
a	O
stencil	B-Algorithm
is	O
a	O
geometric	O
arrangement	O
of	O
a	O
nodal	O
group	O
that	O
relate	O
to	O
the	O
point	O
of	O
interest	O
by	O
using	O
a	O
numerical	B-General_Concept
approximation	I-General_Concept
routine	O
.	O
</s>
<s>
Stencils	B-Algorithm
are	O
the	O
basis	O
for	O
many	O
algorithms	O
to	O
numerically	B-General_Concept
solve	O
partial	O
differential	O
equations	O
(	O
PDE	O
)	O
.	O
</s>
<s>
Two	O
examples	O
of	O
stencils	B-Algorithm
are	O
the	O
five-point	B-Algorithm
stencil	I-Algorithm
and	O
the	O
Crank	B-Algorithm
–	I-Algorithm
Nicolson	I-Algorithm
method	I-Algorithm
stencil	B-Algorithm
.	O
</s>
<s>
Stencils	B-Algorithm
are	O
classified	O
into	O
two	O
categories	O
:	O
compact	B-Algorithm
and	O
non-compact	B-Algorithm
,	O
the	O
difference	O
being	O
the	O
layers	O
from	O
the	O
point	O
of	O
interest	O
that	O
are	O
also	O
used	O
for	O
calculation	O
.	O
</s>
<s>
In	O
the	O
notation	O
used	O
for	O
one-dimensional	O
stencils	B-Algorithm
n-1	O
,	O
n	O
,	O
n+1	O
indicate	O
the	O
time	O
steps	O
where	O
timestep	O
n	O
and	O
n-1	O
have	O
known	O
solutions	O
and	O
time	O
step	O
n+1	O
is	O
to	O
be	O
calculated	O
.	O
</s>
<s>
The	O
term	O
"	O
stencil	B-Algorithm
"	O
was	O
coined	O
for	O
such	O
patterns	O
to	O
reflect	O
the	O
concept	O
of	O
laying	O
out	O
a	O
stencil	B-Algorithm
in	O
the	O
usual	O
sense	O
over	O
a	O
computational	O
grid	O
to	O
reveal	O
just	O
the	O
numbers	O
needed	O
at	O
a	O
particular	O
step	O
.	O
</s>
<s>
The	O
finite	B-Algorithm
difference	I-Algorithm
coefficients	I-Algorithm
for	O
a	O
given	O
stencil	B-Algorithm
are	O
fixed	O
by	O
the	O
choice	O
of	O
node	O
points	O
.	O
</s>
<s>
The	O
coefficients	O
may	O
be	O
calculated	O
by	O
taking	O
the	O
derivative	O
of	O
the	O
Lagrange	O
polynomial	O
interpolating	O
between	O
the	O
node	O
points	O
,	O
by	O
computing	O
the	O
Taylor	O
expansion	O
around	O
each	O
node	O
point	O
and	O
solving	O
a	O
linear	O
system	O
,	O
or	O
by	O
enforcing	O
that	O
the	O
stencil	B-Algorithm
is	O
exact	O
for	O
monomials	O
up	O
to	O
the	O
degree	O
of	O
the	O
stencil	B-Algorithm
.	O
</s>
<s>
For	O
equi-spaced	O
nodes	O
,	O
they	O
may	O
be	O
calculated	O
efficiently	O
as	O
the	O
Padé	O
approximant	O
of	O
,	O
where	O
is	O
the	O
order	O
of	O
the	O
stencil	B-Algorithm
and	O
is	O
the	O
ratio	O
of	O
the	O
distance	O
between	O
the	O
leftmost	O
derivative	O
and	O
the	O
left	O
function	O
entries	O
divided	O
by	O
the	O
grid	O
spacing	O
.	O
</s>
