# FEM2D_BVP_SERENE Finite Element Method, 2D, Boundary Value Problem, Serendipity Elements

FEM2D_BVP_SERENE is a C program which applies the finite element method, with serendipity elements, to a 2D boundary value problem over a rectangle.

The boundary value problem (BVP) that is to be solved has the form:

```        - d/dx ( a(x,y) * du/dx ) - d/dy ( a(x,y) * du/dy ) + c(x,y) * u(x,y) = f(x,y)
```
This equation holds in the interior of some rectangle R. The functions a(x,y), c(x,y), and f(x,y) are given.

Zero boundary conditions are imposed on the boundary of R.

The MATLAB "gallery()" command can produce a copy of the Wathen matrix, which arises as a weighted sum of elementary mass matrices associated with a grid of serendipity elements.

### Languages:

FEM2D_BVP_SERENE is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

FEM2D_BVP_LINEAR, a C program which applies the finite element method (FEM), with piecewise linear elements, to a 2D boundary value problem (BVP) over a rectangle, and compares the computed and exact solutions with the L2 and seminorm errors.

FEM2D_BVP_QUADRATIC, a C program which applies the finite element method (FEM), with piecewise quadratic elements, to a 2D boundary value problem (BVP) over a rectangle, and compares the computed and exact solutions with the L2 and seminorm errors.

WATHEN, a C library which compares storage schemes (full, banded, sparse triplet, sparse) and solution strategies (A\x, Linpack, conjugate gradient (CG)) for linear systems involving the Wathen matrix, which can arise when solving a problem using the finite element method (FEM).

### List of Routines:

• BASIS_SERENE evaluates the serendipity basis functions.
• BASIS_DX_SERENE differentiates the serendipity basis functions.
• BASIS_DY_SERENE differentiates the serendipity basis functions.
• FEM2D_BVP_SERENE solves boundary value problem on a rectangle.
• FEM2D_BVP_SERENE_NODE_NUM counts the number of nodes.
• FEM2D_H1S_ERROR_SERENE: seminorm error of a finite element solution.
• FEM2D_L1_ERROR_SERENE: l1 error norm of a finite element solution.
• FEM2D_L2_ERROR_SERENE: L2 error norm of a finite element solution.
• NOT1 evaluates a factor for serendipity basis functions.
• NOT1D differentiates a factor for serendipity basis functions.
• NOT2 evaluates a factor for serendipity basis functions.
• NOT2DX evaluates a factor for serendipity basis functions.
• NOT2DY evaluates a factor for serendipity basis functions.
• R8MAT_PRINT prints an R8MAT.
• R8MAT_PRINT_SOME prints some of an R8MAT.
• R8MAT_SOLVE2 computes the solution of an N by N linear system.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the C source codes.

Last revised on 07 July 2014.