![]() |
Blitz Support : |
From: Faheem Mitha (faheem_at_[hidden])
Date: 2005-05-30 17:40:06
On Mon, 30 May 2005, Faheem Mitha wrote:
>
> Hi,
>
> In the manual, consider the following section. I don't understand how the
> former expression
>
> P3(I,J,K) = (2-6*c(I,J,K)) * P2(I,J,K)
> + c(I,J,K)*(P2(I-1,J,K) + P2(I+1,J,K) + P2(I,J-1,K) + P2(I,J+1,K)
> + P2(I,J,K-1) + P2(I,J,K+1)) - P1(I,J,K);
>
> is equivalent to the latter
>
> applyStencil(acoustic3D_stencil(), P1, P2, P3, c);
>
> Should this perhaps be
>
> applyStencil(acoustic3D_stencil(), P1(I,J,K), P2(I,J,K), P3(I,J,K), c);
>
> instead? Otherwise, how does the stencil know how to restrict to the
> appropriate range?
Oh, I see that the stencil runs across all possible ranges, and in that
case is equivalent to retricting to I, J, K. Hmm. I'd prefer to give a
statement explicitly.
Ok, I see I can do this by using BZ_END_STENCIL_WITH_SHAPE but can I can
give arbitrary arguments to this, and can the arguments be passed in to
BZ_DECLARE_STENCIL? Otherwise, how can I call different values of shape as
necessary?
> Also, I'm unclear on the difference between BZ_DECLARE_STENCIL and
> BZ_DECLARE_STENCIL_OPERATOR. The latter is only defined for up to 3
> arguments, but I don't see any difference except in the way they are
> called. Perhaps only stencil operators can be called inside a stencil
> declaration?
Hmm. It looks like the former is a macro, and the latter a function. Still
figuring this out.
Faheem.