FEM2D_POISSON is a FORTRAN77 program which solves the 2D Poisson equation using the finite element method.
The computational region is a rectangle, with homogenous Dirichlet boundary conditions applied along the boundary. The state variable U(X,Y) is then constrained by:
- ( Uxx + Uyy ) = F(x,y) in the box
U(x,y) = G(x,y) on the box 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". Because quadratic basis functions are to be used, each triangle will be associated not only with the three corner nodes that defined it, but with three extra midside nodes. If we include these additional nodes, there are now a total of (2*NX-1)*(2*NY-1) nodes in the region.
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. The value of U at the boundary nodes is obvious, so we concentrate on the NUNK interior nodes where U(x,y) is unknown. 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 program allows the user to supply two routines:
There are a few variables that are easy to manipulate. In particular, the user can change the variables NX and NY in the main program, to change the number of nodes and elements. The variables (XL,YB) and (XR,YT) define the location of the lower left and upper right corners of the rectangular region, and these can also be changed in a single place in the main program.
The program writes out a file containing an Encapsulated PostScript image of the nodes and elements, with numbers. Unfortunately, for values of NX and NY over 10, the plot is too cluttered to read. For lower values, however, it is a valuable map of what is going on in the geometry.
The program is also able to write out a file containing the solution value at every node. This file may be used to create contour plots of the solution
The original version of this code comes from Professor Janet Peterson.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
BETIS is a FORTRAN77 program which solves Laplace's equation in a 2D region using the boundary element method.
FEM is a data directory which contains a description of the data files that can be used to describe a finite element model.
FEM_50 is a MATLAB program which solves Laplace's equation in an arbitrary region using the finite element method.
FEM_50_HEAT is a modified version of FEM_50 suitable for solving the heat equation.
FEM_IO is a MATLAB library which reads or writes the node, element and data files that define a finite element model.
FEM_TO_TEC is a MATLAB program that can convert an FEM model into a TEC graphics file.
FEM1D, is a FORTRAN77 program which applies the finite element method, with piecewise linear basis functions, to a linear two point boundary value problem in 1D;
FEM1D_ADAPTIVE is a FORTRAN77 program that applies the finite element method to a linear two point boundary value problem in a 1D region, using adaptive refinement to improve the solution.
FEM1D_NONLINEAR is a FORTRAN77 program that applies the finite element method to a nonlinear two point boundary value problem in a 1D region.
FEM1D_PMETHOD is a FORTRAN77 program that applies the p-method version of the finite element method to a linear two point boundary value problem in a 1D region.
FEM2D_POISSON is available in a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version.
FEMPACK is a FORTRAN90 library of routines for various tasks associated with a finite element calculation.
FISHPACK is a FORTRAN77 library which solves Poisson, Laplace or Helmholtz equations in a variety of 2D and 3D geometries, using the finite difference method.
FREE_FEM_NAVIER_STOKES is a MATLAB program for solving the steady incompressible Navier Stokes equations on an arbitrary triangulated region, using the finite element method.
FREE_FEM_POISSON is a FORTRAN90 program which solves Poisson's equation in an arbitrary triangulated region using the finite element method.
FREE_FEM_STOKES is a FORTRAN90 program for solving the Stokes equations on a triangulated region, using the finite element method.
HOT_PIPE is a MATLAB program that can be run with the FEM_50_HEAT MATLAB script.
HOT_POINT is a MATLAB program that can be run with the FEM_50_HEAT MATLAB script.
PLTMG_SINGLE is a FORTRAN77 library which solves elliptic partial differential equations using the finite element method with piecewise linear triangles and the multigrid approach.
SERBA is a FORTRAN77 program which solves problems in planar elasticity using the boundary element method.
TRIANGULATION_ORDER3 is a data directory which contains a description and examples of how an order 3 (linear) triangulation is defined by a node and element file.
TRIANGULATION_ORDER6 is a data directory which contains a description and examples of how an order 6 (quadratic) triangulation is defined by a node and element file.
TRIANGULATION_ORDER6_CONTOUR is a MATLAB program which can make contours of the solution.
You can go up one level to the FORTRAN77 source codes.