FEM2D_PACK
Finite Element Routines
FEM2D_PACK
is a C library which
implements the finite element method.
The emphasis is on simplicity and clarity.
Only the 2D case is handled, with a choice
of low order triangular and quadrilateral elements.
A few routines are included for computing a "sphere grid",
that is, a finite element mesh on the surface of a sphere.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
FEM2D_PACK is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
FEM_BASIS,
a C library which
can define basis functions for the finite element method (FEM)
for any degree in an M-dimensional simplex (1D interval, 2D triangle,
3D tetrahedron, and higher dimensional generalizations.)
FEM1D_PACK,
a C++ library which
contains utilities for 1D finite element calculations.
FEM2D,
a data directory which
contains examples of 2D FEM files,
three text files that describe a 2D finite element geometry;
FEM2D_HEAT,
a C++ program which
solves the
time dependent heat equation on the unit square.
FEM2D_POISSON,
a C++ program which
solves Poisson's equation
on a square, using the finite element method.
FEM2D_POISSON_RECTANGLE_LINEAR,
a C++ program which
solves the 2D Poisson equation on a rectangle, using the finite element method,
and piecewise linear triangular elements.
FEM2D_SAMPLE,
a C++ library which
evaluates a finite element function defined on an order 3 or order 6 triangulation.
Reference:
-
Milton Abramowitz, Irene Stegun,
Handbook of Mathematical Functions,
National Bureau of Standards, 1964,
ISBN: 0-486-61272-4,
LC: QA47.A34.
-
Jack Dongarra, Jim Bunch, Cleve Moler, Pete Stewart,
LINPACK User's Guide,
SIAM, 1979,
ISBN13: 978-0-898711-72-1.
-
Vladimir Krylov,
Approximate Calculation of Integrals,
Dover, 2006,
ISBN: 0486445798.
-
Hans Rudolf Schwarz,
Finite Element Methods,
Academic Press, 1988,
ISBN: 0126330107,
LC: TA347.F5.S3313..
-
Gilbert Strang, George Fix,
An Analysis of the Finite Element Method,
Cambridge, 1973,
ISBN: 096140888X,
LC: TA335.S77.
-
Arthur Stroud,
Approximate Calculation of Multiple Integrals,
Prentice Hall, 1971,
ISBN: 0130438936,
LC: QA311.S85.
-
Arthur Stroud, Don Secrest,
Gaussian Quadrature Formulas,
Prentice Hall, 1966,
LC: QA299.4G3S7.
-
Olgierd Zienkiewicz,
The Finite Element Method,
Sixth Edition,
Butterworth-Heinemann, 2005,
ISBN: 0750663200.
-
Daniel Zwillinger, editor,
CRC Standard Mathematical Tables and Formulae,
30th Edition,
CRC Press, 1996,
ISBN: 0-8493-2479-3.
Source Code:
Examples and Tests:
List of Routines:
-
BANDWIDTH_MESH determines the bandwidth of the coefficient matrix.
-
BANDWIDTH_VAR determines the bandwidth for finite element variables.
-
BASIS_11_T3: one basis at one point for a T3 element.
-
BASIS_11_T3_TEST verifies BASIS_11_T3.
-
BASIS_MN_T4: one basis at one point for a T4 element.
-
BASIS_11_T4_TEST verifies BASIS_11_T4.
-
BASIS_11_T6: one basis at one point for the T6 element.
-
BASIS_11_T6_TEST verifies BASIS_11_T6.
-
BASIS_MN_Q4: all bases at N points for a Q4 element.
-
BASIS_MN_Q4_TEST verifies BASIS_MN_Q4.
-
BASIS_MN_T3: all bases at N points for a T3 element.
-
BASIS_MN_T3_TEST verifies BASIS_MN_T3.
-
BASIS_MN_T4: all bases at N points for a T4 element.
-
BASIS_MN_T4_TEST verifies BASIS_MN_T4.
-
BASIS_MN_T6: all bases at N points for a T6 element.
-
BASIS_MN_T6_TEST verifies BASIS_MN_T6.
-
CH_CAP capitalizes a single character.
-
DEGREES_TO_RADIANS converts an angle from degrees to radians.
-
DERIVATIVE_AVERAGE_T3 averages derivatives at the nodes of a T3 mesh.
-
DIV_Q4 estimates the divergence and vorticity of a discrete field.
-
I4_MAX returns the maximum of two I4's.
-
I4_MIN returns the smaller of two I4's.
-
I4_MODP returns the nonnegative remainder of I4 division.
-
I4_WRAP forces an I4 to lie between given limits by wrapping.
-
I4MAT_TRANSPOSE_PRINT prints an I4MAT, transposed.
-
I4MAT_TRANSPOSE_PRINT_SOME prints some of an I4MAT, transposed.
-
I4MAT_WRITE writes an I4MAT file.
-
I4VEC_PRINT prints an I4VEC.
-
MASS_MATRIX_T3 computes the mass matrix, using 3-node triangles.
-
MASS_MATRIX_T6 computes the mass matrix, using 6-node triangles.
-
NEXT_BOUNDARY_NODE returns the next boundary node in any element.
-
NEXT_BOUNDARY_NODE_Q4 returns the next boundary node in a Q4 element.
-
NEXT_BOUNDARY_NODE_Q8 returns the next boundary node in a Q8 element.
-
NEXT_BOUNDARY_NODE_Q9 returns the next boundary node in a Q9 element.
-
NEXT_BOUNDARY_NODE_Q12 returns the next boundary node in a Q12 element.
-
NEXT_BOUNDARY_NODE_Q16 returns the next boundary node in a Q16 element.
-
NEXT_BOUNDARY_NODE_QL returns the next boundary node in a QL element.
-
NEXT_BOUNDARY_NODE_T3 returns the next boundary node in a T3 element.
-
NEXT_BOUNDARY_NODE_T4 returns the next boundary node in a T4 element.
-
NEXT_BOUNDARY_NODE_T6 returns the next boundary node in a T6 element.
-
NEXT_BOUNDARY_NODE_T10 returns the next boundary node in a T10 element.
-
NODE_REFERENCE returns the basis nodes for any available element.
-
NODE_REFERENCE_Q4 returns the basis nodes for a 4 node quadrilateral.
-
NODE_REFERENCE_Q8 returns the basis nodes for an 8 node quadrilateral.
-
NODE_REFERENCE_Q9 returns the basis nodes for a 9 node quadrilateral.
-
NODE_REFERENCE_Q12 returns the basis nodes for a 12 node quadrilateral.
-
NODE_REFERENCE_Q16 returns the basis nodes for a 16 node quadrilateral.
-
NODE_REFERENCE_QL returns the basis nodes for a quadratic/linear.
-
NODE_REFERENCE_T3 returns the basis nodes for the 3 node triangle.
-
NODE_REFERENCE_T4 returns the basis nodes for the 4 node triangle.
-
NODE_REFERENCE_T6 returns the basis nodes for a 6 node triangle.
-
NODE_REFERENCE_T10 returns the basis nodes for a 10 node triangle.
-
ORDER_CODE returns the order for each element.
-
PHYSICAL_TO_REFERENCE_T3 maps physical points to reference points.
-
R8_ABS returns the absolute value of an R8.
-
R8_EPSILON returns the R8 round off unit.
-
R8_HUGE returns a "huge" R8.
-
R8_NINT returns the nearest integer to an R8.
-
R8_POWER computes an integer power of an R8.
-
R8_UNIFORM_01 returns a pseudorandom R8 scaled to [0,1].
-
R8GE_FA performs a LINPACK-style PLU factorization of a R8GE matrix.
-
R8GE_INVERSE computes the inverse of a R8GE matrix factored by R8GE_FA.
-
R8MAT_MM multiplies two matrices.
-
R8MAT_PRINT prints an R8MAT.
-
R8MAT_PRINT_SOME prints some of an R8MAT.
-
R8MAT_WRITE writes an R8MAT file.
-
REFERENCE_TO_PHYSICAL_Q4 maps Q4 reference points to physical points.
-
REFERENCE_TO_PHYSICAL_T3 maps T3 reference points to physical points.
-
REFERENCE_TO_PHYSICAL_T6 maps T6 reference points to physical points.
-
S_EQI reports whether two strings are equal, ignoring case.
-
SHAPE evaluates shape functions for any available element.
-
SHAPE_Q4 evaluates shape functions for a 4 node quadrilateral.
-
SHAPE_Q8 evaluates shape functions for an 8 node quadrilateral.
-
SHAPE_Q9 evaluates shape functions for a 9 node quadrilateral.
-
SHAPE_Q12 evaluates shape functions for a 12 node quadrilateral.
-
SHAPE_Q16 evaluates shape functions for a 16 node quadrilateral.
-
SHAPE_QL evaluates shape functions for a 6 node quadratic/linear.
-
SHAPE_T3 evaluates shape functions for a 3 node triangle.
-
SHAPE_T4 evaluates shape functions for a T4 triangle.
-
SHAPE_T6 evaluates shape functions for a 6 node triangle.
-
SHAPE_T10 evaluates shape functions for a 10 node triangle.
-
SHAPE_TEST verifies the shape function values at the basis nodes.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TRIANGLE_UNIT_SET sets a quadrature rule in the unit triangle.
-
TRIANGLE_UNIT_SIZE returns the "size" of a unit triangle quadrature rule.
You can go up one level to
the C source codes.
Last revised on 16 January 2013.