Computational Science Asked by Nankin on January 19, 2021
I have been unable to find the equivalent of the 5-point stencil finite differences for the Laplacian operator.
In 2 dimensions for me it is clear that, using the finite difference method: $$
nabla_{2D}^2u = frac{1}{h^2} left( u_{1,0} + u_{-1,0} + u_{0,1} + u_{0,-1} -4 u_{0,0} right)
$$
(h being the size grid/step)
But I am not sure if it is completely symmetric for the 3-dimensional case. Can I just add the terms referring to the 3rd dimension?
$$
nabla_{3D}^2u = frac{1}{h^2} left( u_{1,0,0} + u_{-1,0,0} + u_{0,1,0} + u_{0,-1,0} + u_{0,0,1} + u_{0,0,-1} -6 u_{0,0,0} right)
$$
A source where I could find the different accuracy terms for the 3D Laplacian would be also helpful.
Yes, that finite difference is correct. You can obtain it using a finite difference in each direction for the Laplace operator in each coordinate.
begin{align} nabla^2 u =& frac{partial^2 u}{partial x^2} + frac{partial^2 u}{partial y^2} + frac{partial^2 u}{partial z^2}\ approx& frac{1}{h^2}[u(x + h, y, z) - 2u(x, y, z) + u(x -h, y, z)]\ &+ frac{1}{h^2}[u(x, y + h, z) - 2u(x, y, z) + u(x, y - h, z)]\ &+ frac{1}{h^2}[u(x, y, z + h) - 2u(x, y, z) + u(x, y, z - h)]\ =& frac{1}{h^2}[u(x + h, y, z) + u(x -h, y, z) + u(x, y + h, z) + u(x, y - h, z)\ &+ u(x, y, z + h) + u(x, y, z - h) - 6u(x, y, z)], . end{align}
Alternatively, you could interpolate a polynomial that passes through the points in your stencil and then compute its Laplacian and evaluate it at $(x, y, z)$.
Correct answer by nicoguaro on January 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP