<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:18pt"><div><span class="Apple-style-span" style="font-family: Times; font-size: medium; "><pre><i>Thanks Barry. It works fine. Another question, I have a Periodic Boundary</i></pre><pre><i>condition along x and y. So I want to use the two commented out line below.</i></pre><pre><i> for (j=ys; j<ys+ym; j++) {
</i><i> for (i=xs; i<xs+xm; i++) {
</i><i> if (i<(mx-1))
</i><i> {
</i><i> Cx=u_localptr[k][j][i+1]-u_localptr[k][j][i];
</i><i> }
</i><i> else
</i><i> {
</i><i>// Cx=u_localptr[k][j][i]-u_localptr[k][j][0];
</i><i> }
</i><i> if (j<(my-1))
</i><i> {
</i><i> Cy=v_localptr[k][j+1][i]-v_localptr[k][j][i];
</i><i> }
</i><i> else
</i><i> {</i></pre><pre><i></i><i> // Cy=v_localptr[k][j][i]-v_localptr[k][0][i];
</i><i> }
</i><i><br></i></pre><pre><i>Is it possible to include these non-local points [k][j][0] or [k][0][i]. Or I have to </i></pre><pre><i>include the boundary points in the grid ? The same question when forming the A matrix with </i></pre><pre><i>PBC. How to include the non-neighbour elements within the if statement. </i></pre><pre><i><br></i></pre><pre><i>Thanks.</i></pre><pre><i><br></i></pre><pre><i>Khalid</i></pre></span></div><div style="position:fixed"></div>
</div><br>
</body></html>