# Finite Element Method (FEM)

## Introduction

The Finite Element Method is a numerical method for solving differential equations and integrals, and it is primarily used for problem solving in applied engineering and science. The Finite Element Method is a generalization of the well-established variation approach. The Finite Element Method is based on

 the idea that the solution u of a differential equation can be approximated by a linear combination of the parameter cj and appropriate functions

as shown in Eq. 3-1 [*1].

In Eq. 3-1, u stands for the exact and uN for the (with FEM) approximated solution. Where u stands for the vector of the unknown, in our case for the waterlevel and the flow velocity.

The parameters cj are generally determined with the help of a weighted integral, so that they are a solution of the differential equation of the problem. When

 selection the functions , also called approximation or interpolation functions, it is important that they meet the boundary conditions. There are different

methods for the variation approach like for example the Rayleigh-Ritz method or the method of weighted residuals, while the latter can further be distinguished into the Galerkin method, the least square method, and so on.

 The mentioned methods mainly differ in the choice of the weighting function and the approximation function . The Galerkin method for example,

which is used in "2D depth-integrated flow" in the finite element form of the depth-averaged shallow water equation, requires the weighting function to be equal to the

 approximation function This is the reason why the introduction emphasizes this method.

More detailed explanations about the principles of the variation approach and the corresponding methods can be found in [*2] and [*3].