The famous mathematician B. Galerkin has proposed (circa 1916) the finite element method long ago, but the finite difference method became more popular with the development of computers to solve systems of PDEs.
The finite-difference method is much simpler to implement, but the structured grid makes it not as efficient as the finite-element method. If I wake up with a new way to solve an ODE in mind, I can usually have it fully implemented in less than one hour with the finite-difference method. That includes formulation, code development, etc. It would take me considerably longer to do the same with the finite element method. It is possible to implement the finite-difference method on an unstructured grid as well, but that is rare. At that point, I am not sure about the differences. Perhaps one leads to better conditioned matrices or is more easily parallelized. If you want to get a feel for the simplicity of the finite-difference method, check out Lecture 9 here:
Dear Dr. Rumpf, thank you very much. I always felt that the finite-difference method is much simpler to implement, and now you confirm it. So it's not only my subjective feeling.
Geometrically complex domains will be the only case when I use it.
Moreover in finite difference method you are directly dealing with the governing differential equation. However in Galerkin finite element method you are dealing with the weak form. In this regard the domain of test functions that can be used in finite element is much larger than the domain of test functions in finite difference. Automatic satisfaction of force boundary conditions (Neumann boundary conditions) is another property that is granted by Galerkin finite element method. This means that test functions in finite element method should only satisfy the displacement boundary conditions (Dirichlet boundary conditions) while those in finite difference method should satisfy both the force and the displacement boundary conditions. These constraints usually make it hard to select admissible test functions for finite difference method.
I should also add that there is no difference between FD and FEM in terms of what they are able to simulation, sources they can inject, boundary conditions they can handle, etc. They are equivalent in that regard.
Summarizing: the Galerkin finite element method puts more work on the scientist, whereas the finite-difference method puts it on the computer. No wonder, though Boris Galerkin proposed it before 1916, it was not as popular even with the development of computers.
I have always been curious to develop equivalent models (FD vs FEM) and compare things like matrix conditioning. It would be easy enough to do, I just have not done it.
Long ago my science adviser was trying to "push" me into using FEM for solving the boundary value problem for the biharmonic equation with the 2nd type boundary conditions (not splitting), and I was intuitively resisting because the domain was just a rectangle.
Having written code for both FD and FEM, the issue of which is better better for a given problem comes down to practical application for problems in the real world. That eliminates simple geometries. With more complex geometries, however, grid generation used to be a large part of the effort for analysts. Thanks to the combination of higher order elements, memory-conserving explicit solvers and modified Delaunay algorithms for grid generation, the winner is clearly FEM. The looming danger is that the inexperienced user can very quickly obtain impressive results with beautiful graphics that are precisely wrong.
Finite element methods are better on irregular domains, especially when boundary conditions involve derivatives (natural BC's). They also outperform FDM when your problem needs local mesh refinement. When your region is a rectangle or a union of rectangles and you don't expect boundary layers, you just don't bother and use finite differences for all the reasons others have mentioned.
It depends on your problem to be solved. For example, if you want to simulate mechanic problems, it is better to use FEM so that you can use Gaussian points to obtain precise stress and deformation fields. But if you want to solve reactive transport problem including solute transport, then the FDM or FVM (finite volume method) are more suitable because of the local mass conservation.
The main advantage of the Finite Element Method over the Finite Difference Method is its ability to deal with complex 2D or 3D domains. From my point of view, for elliptic problems, I think also that the FEM is more suited to take boundary conditions into account because natural boundary conditions (heat flux conditions for thermal analyses) are included in the weak form of the equations. In addition, the FEM is more suited to solve complex non linear problems such as for example heat transfer with phase changes or large displacements and large strains elastoplastic analyses. For parabolic problems such as transient heat equation, both methods are usually coupled. The FEM is used for the problem in space while the FDM is used to integrate the equation in time. I completely agree with Mingliang Xie that the FDM or FVM is more suited for convection-diffusion problems.
The main advantage of the Finite Element Method over the Finite Difference Method is its ability to deal with complex 2D or 3D domains. From my point of view, for elliptic problems, I think also that the FEM is more suited to take boundary conditions into account because natural boundary conditions (heat flux conditions for thermal analyses) are included in the weak form of the equations. In addition, the FEM is more suited to solve complex non linear problems such as for example heat transfer with phase changes or large displacements and large strains elastoplastic analyses. For parabolic problems such as transient heat equation, both methods are usually coupled. The FEM is used for the problem in space while the FDM is used to integrate the equation in time. I completely agree with Mingliang Xie that the FDM or FVM is more suited for convection-diffusion problems.
Thank you very much for your opinion. For me in a rectangular domain the FDM worked better to solve complex nonlinear problems such as the heat transfer problem with phase changes.