fem2d_project


fem2d_project, a MATLAB code which projects a finite element function.

Let us suppose we have a region R and a triangulation of R, that is, a set of nodes N1 and triangles T1 whose union is R. Let P1(I)(X,Y) be the finite element basis function associated with node N1(I). Now let us suppose that we have a finite element function V1, that is a scalar- or vector-valued function V1(X,Y) defined over R, with the formula

V1(X,Y) = sum ( I ) V1(I) * P1(I)(X,Y)

Now suppose we have a second triangulation of R comprising a set of nodes N2 and triangles T2. Can we determine an appropriate set of finite element coefficients V2(I) which best approximate V1 in the finite element space defined by N2 and T2? The finite element coefficient vector V2 is defined by the following relationship:

Integral Sum ( I ) V2(I) P2(I)(X,Y) P2(J)(X,Y) dx dy = Integral V1(X,Y) P2(J)(X,Y) dx dy
Thus, in particular, the function V1(X,Y), which is defined on the first finite element space, must be evaluated in a computation that uses the second finite element space.

This procedure can be used to determine the least squares approximant to data (actually, to the piecewise linear interpolant of that data) or to determine the finite element coefficients appropriate when recomputing a finite element solution from a fine mesh to a coarse mesh.

The sample data is given as three tables, each stored in a file:

The finite element mesh is given as two tables, each stored in a file:

The program produces a new table FEM_VALUES, of the same dimensionality as SAMPLE_VALUES. The vector FEM_VALUES can be used in conjunction with the finite element mesh data to produce a finite element function that is an approximant to the SAMPLE_VALUES data.

Usage:

fem2d_project ( 'sample_prefix', 'fem_prefix' )
where sample_prefix is the common prefix for the SAMPLE files: and fem_prefix is the common prefix for the FEM files:

The file fem_prefix_values.txt is created by the program, and contains the projections of the sample data values onto the finite element space, that is, these may be regarded as coefficients of finite element functions representing the projections of the sample data. Note that we may also regard this operation as the refinement or coarsening of a finite element function, in that we are transferring information from the ``sample'' space to the ``fem'' space.

Licensing:

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

Languages:

fem2d_project is available in a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

fem1d_project, a MATLAB code which projects data into a finite element space, including the least squares approximation of data, or the projection of a finite element solution from one mesh to another.

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_pack, a MATLAB code which is useful for 2D finite element calculations.

fem2d_project, a MATLAB code which projects a function f(x,y), given as data, into a given space associated with the finite element method (FEM) for piecewise linear triangular elements.

fem2d_project_test

fem2d_project_function, a MATLAB code which projects a function F(X,Y), given as a formula, into a given finite element space of piecewise linear triangular elements.

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

fem3d_project, a MATLAB code which projects a function F(X,Y,Z), given as a data, into a given finite element space of piecewise linear tetrahedral elements.

Reference:

  1. Hans Rudolf Schwarz,
    Finite Element Methods,
    Academic Press, 1988,
    ISBN: 0126330107,
    LC: TA347.F5.S3313.
  2. Gilbert Strang, George Fix,
    An Analysis of the Finite Element Method,
    Cambridge, 1973,
    ISBN: 096140888X,
    LC: TA335.S77.
  3. Olgierd Zienkiewicz,
    The Finite Element Method,
    Sixth Edition,
    Butterworth-Heinemann, 2005,
    ISBN: 0750663200,
    LC: TA640.2.Z54.

Source Code:


Last revised on 04 May 2019.