I'm working on a 2-D planar finite difference code. My differencing scheme at the boundary nodes involves introducing ghost nodes in the computation. My code also involves a multi-dimensional derivative:$$\frac{d^2u}{dxdy} \approx \frac{u_{i+1,j+1} - u_{i+1,j-1} - u_{i-1, j+1} + u_{i-1,j-1}}{4\Delta x\Delta y}$$This scheme becomes an issue at a corner node. Let me illustrate:$$g1\  \ g2 \ \ g3 \\g4\ \  d1 \ \  d2 \\g5\ \  d3 \ \ d4 \\$$the g's represent the ghost codes and the d's represent the real domain nodes that I'm solving for. x-direction is horizontal; y-direction is vertical. Dirichlet boundary conditions are specified for both the top and left boundaries. Let's say $u=u_1$ at the top boundary and $u=u_2$ at the left boundary. What should be the boundary condition at ghost node g1, which lies along both the x and y boundaries?
boundary condition in 2-D planar finite difference problem
finite difference;boundary conditions