# FEM1D_CLASSES Classes for the 1D Finite Element Method

FEM1D_CLASSES is a Python library which defines classes useful for solving a boundary value problem (BVP) of the form u''+2u'+u=f in 1 spatial dimension, using the finite element method (FEM), by Mike Sussman.

FEM1D_CLASSES is written in a way that is intended to suggest how FENICS is used to define finite element problems.

FEM1D_CLASSES includes the following classes:

• class Mesh ( object ): which stores the number of nodes, the interval endpoints, the node coordinates, and the sets of nodes that define each element;
• class Shapefns ( object ): which defines the quadratic Lagrange shape functions and their derivatives;
• class FiniteElement ( object ): which takes a mesh and a set of shape functions, and the index of a particular element, and evaluates the integral over this element of a shape function or its derivative multiplied by zero, one, or two arbitrary functions.
• class FunctionSpace ( object ): which takes a mesh and a set of shape functions and evaluates the integral over the entire region of a product in which the first factor is a shape function, its derivative, or an arbitrary function, and the second factor is a shape function or its derivative.

### Languages:

FEM1D_CLASSES is available in a Python version.

### Related Data and Software:

DOLFIN, Python programs which are used with the DOLFIN library to set up and solve a wide variety of problems using the finite element method.

DOLFIN-CONVERT, a Python program which can convert a mesh file from a given format to an XML format suitable for use by DOLFIN or FENICS.

FEM1D_BVP_LINEAR, a Python program which applies the finite element method (FEM), with piecewise linear elements, to a two point boundary value problem (BVP) in one spatial dimension, and compares the computed and exact solutions with the L2 and seminorm errors.

FENICS, examples which illustrate the use of FENICS, a collection of free software with an extensive list of features for automated, efficient solution of differential equations.

### Author:

Mike Sussman, Mathematics Department, University of Pittsburgh, Pittsburgh, Pennsylvania.

### Reference:

• Anders Logg, Garth Wells,
DOLFIN: Automated finite element computing,
ACM Transactions on Mathematical Software,
Volume 37, Number 2, Article 20, April 2010.
• Anders Logg, Kent-Andre Mardal, Garth Wells,
Automated Solution of Differential Equations by the Finite Element Method: The FEniCS Book,
Lecture Notes in Computational Science and Engineering,
Springer, 2011,
ISBN13: 978-3642230981,
LC:
• http://www.fenics.org, the web site for the FEniCS project.

### Examples and Tests:

FEM1D_CLASSES_PRB sets up and solves problems of the form u''+2u'+u=f.

FEM1D_CLASSES_TEST sets up and solves problems of the form -u''=f.

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

Last revised on 21 August 2014.