solve 3 equation dependency variables by c++ : i tried to solve 3 pde equations by using FD method in c++, but i do not know why i got half of the exact answer at all time. these equations are dependency variable.

              
    if(g[i][k][j]!=g[k][i][j] && i!=k)
          
         u[i][k][j+1]=u[i][k][j]*(1.0 - 2.0*dt)
             +(dt/(dx*dx))*(g[i+1][k][j]-  2.0*g[i][k][j]+g[i-1][k][j])
             +(dt/(dx*dx))*(g[k+1][i][j]-  2.0*g[k][i][j]+g[k-1][i][j])
             +(dt/(dy*dy))*(g[i][k+1][j]-2.0*g[i][k][j]+g[i][k-1][j])
             +(dt/(dy*dy))*(g[k][i+1][j]-2.0*g[k][i][j]+g[k][i-1][j]);
		  
                       

		  g[i][k][j+1]=g[i][k][j]*(1 - dt)
                +dt*u[i][k][j]
                +(dt/(dy*dy))*(v[i][k+1][j]-2*v[i][k][j]+v[i][k-1][j])
                +(dt/(dx*dx))*(v[i+1][k][j]-2*v[i][k][j]+v[i-1][k][j]);
		

		 v[i][k][j+1]=v[i][k][j]+(g[k][i][j] + g[i][k][j])*dt;
       

