>
>Thanks a lot for such a lucid explanation. The note which you mentioned at the 
>end is very important for me, as my code contains loops going from both 1 to N 
>and 0 to N+1.
>

You're welcome.

Just to avoid any potential misunderstanding: the note at the end was if you 
have loops over your "real" (non-ghost) variables going from 0 to N-1, i.e. 
zero indexing as in C, where the first index of your "real" values is 0, ghost 
values are at -1 and below and at N and above. 

On the other hand, if you have some loops from 1 to N and some loops from 0 to 
N+1, it means you have some loops over just the "real" variables (1 to N) and 
some loops over "real" + ghost variables (0 to N+1). In this case, you do not 
need to change the code. Just set the stencil width to 1 (or to 2 if your 
"widest" loop goes from -1 to N+2, etc.).

(When I say "real", I don't mean as in real vs. complex numbers, but as in the 
grid point values that are not boundary conditions.)

Regards,
Åsmund

Reply via email to