Display a Q4 Finite Element Basis Function

FEM_BASIS_Q4_DISPLAY is a MATLAB program which reads data defining a bilinear quadrilateral ("Q4") finite element mesh and displays the basis function associated with any node in the mesh.

The entire mesh is shown (which could be a problem for large meshes!). However, a finite element basis function is nonzero over only a relatively small number of elements. Over each one of these elements, the basis function is bilinear, and it is simple to represent such a shape graphically.

The best part of the presentation is that MATLAB allows the user to turn the plot or zoom in and out, which makes it much easier to understand the information that is being presented.

The quadrilateral mesh is defined by a node file containing the coordinates of nodes, and an element file containing sets of the nodes that make up each element.


fem_basis_q4_display ( 'prefix' )
where The user is then queried for node numbers, so that the program can display the basis function corresponding to that node. Entering a node number of '0' terminates the program.


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


FEM_BASIS_Q4_DISPLAY is available in a MATLAB version.

Related Programs:

BEZIER_SURFACE_DISPLAY, a MATLAB program which displays a Bezier surface.

FEM_50, a MATLAB program which implements the finite element method in just 50 lines of code.

FEM_50_HEAT, a MATLAB program which is a modified version of FEM_50 suitable for solving the heat equation.

FEM_BASIS_T3_DISPLAY, a MATLAB program which displays a basis function associated with a 3-node triangle "T3" mesh.

FEM_BASIS_T4_DISPLAY, a MATLAB program which displays a basis function associated with a 4-node triangle "T4" mesh.

FEM_BASIS_T6_DISPLAY, a MATLAB program which displays a basis function associated with a quadratic triangle ("T6") mesh.

FEM_IO, a MATLAB library which reads and writes the node, element and data files that define a finite element model.

FEM2D_HEAT, a MATLAB program which solves the time dependent heat equation in the unit square.

FEM2D_PACK, a MATLAB library which is useful for 2D finite element calculations.

FEM2D_POISSON, a MATLAB program which solves Poisson's equation on a square, using the finite element method.

FEM2D_SAMPLE, a MATLAB library which evaluates a finite element function defined on an order 3 or order 6 triangulation.

POLYGONAL_SURFACE_DISPLAY, a MATLAB program which reads two files defining a polygonal surface and displays it within MATLAB.

QUAD_SURFACE_DISPLAY, a MATLAB program which reads files defining a 3D quadrilateral mesh surface and displays it within MATLAB.

TRI_SURFACE_DISPLAY, a MATLAB program which reads data defining a triangular mesh of a 3D surface and displays it.

TRIANGLE, a C program which computes a triangulation of a geometric region.

TRIANGULATION_DISPLAY_OPENGL, a C++ program which reads files defining a triangulation and displays an image using Open GL.

TRIANGULATION_ORDER6, a directory which contains a description and examples of order 6 triangulations.

TRIANGULATION_ORDER6_CONTOUR, a MATLAB program which can make contours of a scalar quantity defined on the nodes of an order 6 triangulation.

TRIANGULATION_PLOT, a MATLAB program which creates an EPS image of a triangulation.


  1. Klaus-Juergen Bathe,
    Finite Element Procedures,
    Prentice Hall, 1996.
  2. Eric Becker, Graham Carey, John Oden,
    Finite Elements, An Introduction, Volume I,
    Prentice-Hall, 1981.
  3. Herbert Edelsbrunner,
    Geometry and Topology for Mesh Generation,
    Cambridge, 2001,
    LC: QA377.E36,
    ISBN: 0-521-79309-2.
  4. Max Gunzburger,
    Finite Element Methods for Viscous Incompressible Flows,
    A Guide to Theory, Practice, and Algorithms,
    Academic Press, 1989,
    LC: TA357.G86.
  5. Gilbert Strang, George Fix,
    An Analysis of the Finite Element Method,
    Prentice Hall, 1973,
    LC: TA335.S77.

Source code

Tests and Examples





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

Last revised on 12 March 2010.