fem2d_poisson_rectangle_linear, a Fortran90 code which solves the 2D Poisson equation using the finite element method (FEM) over a rectangular region using a uniform mesh of linear triangular elements.
The computational region is a rectangle, with Dirichlet boundary conditions applied along the boundary. The state variable U(X,Y) is then constrained by:
- ( Uxx + Uyy ) = F(x,y) in the region U(x,y) = G(x,y) on the region boundary
The computational region is first covered with an NX by NY rectangular array of points, creating (NX-1)*(NY-1) subrectangles. Each subrectangle is divided into two triangles, creating a total of 2*(NX-1)*(NY-1) geometric "elements".
We now assume that the unknown function U(x,y) can be represented as a linear combination of the basis functions associated with each node. For each node I, we determine a basis function PHI(I)(x,y), and evaluate the following finite element integral:
Integral ( Ux(x,y) * PHIx(I)(x,y) + Uy(x,y) * PHIy(I)(x,y) ) = Integral ( F(x,y) * PHI(I)(x,y)The set of all such equations yields a linear system for the coefficients of the representation of U.
The information on this web page is distributed under the MIT license.
fem2d_poisson_rectangle_linear is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version.
fem2d_poisson_rectangle_linear_test
fem2d, a data directory which contains examples of 2D FEM files, text files that describe a 2D finite element geometry and associated nodal values;
fem2d_heat_rectangle, a Fortran90 code which solves the 2D time dependent heat equation on the unit square.
fem2d_poisson_rectangle, a Fortran90 code which solves the 2D Poisson equation on a rectangle, using the finite element method, and piecewise quadratic triangular elements.