Mat-1.174 Computational Partial Differential Equations, spring 1999
13-Apr-1999

Suggestions for final projects

Various options

See here for more details.

Why FEM-solver - isn't it enough to have toolbox

Fem-solver for elliptic problems

Here is a slightly edited version of the "FEM-solver assignment for 1997" including pointers to useful PDEtool tools and some codes written by Jan v. Pfaler . We don't need to be quite so ambitious, especially concerning the implementation. I suggest you start with a problem, like

Problem 3.16 pp. 175-176 in Celia-Grey (These 2 pages are not needed, all is here): Write a Matlab-code for Poisson's equation given the boundary conditions of Fig. 3.15 (handouts) and f(x,y)=0. Create the triangular mesh with PDEtool.

The flow of the program

The flow of the program should be the following.

Set up of the differential equation

We consider here only equations in two dimensions. Set up the differential equation in a relatively parametrized form. For example you may consider

div( c grad u) + d u = f

Here c,d ja f are matlab functions (R2 -> R), of type

function f=foo(x,y)

Give the names of the functions as parameters to the assemby part. Use the feval function, to evaluate functions.

Elements

Please restrict the solver to elements based on triangularization of the domain. This way you may work with some of the pde-toolbox functions. Use if possible the same datastructures of points (p), triangles (t) and boundaries (e) as created by toolbox. Note that these can be used in passive way, in the sense that they can be created by the pde-toolbox functions. I.e. you need not understand all the data in (t) -matrix.

For the start, we recommed you to start with linear and quadratic elements. See the handouts.

Rectangular elements In spite of the above recommendation we will give some hints on working with rectangular elements. In this case you can't use the toolbox-data structures directly. On the other hand the data structures are simpler. Also, you might consider using the "poi"- "rectangular triangulation" functions.

Boundaries and boundary conditions

You may want to study the example file for boundaries /p/edu/mat-1.174/source/boundariesex.m to see one way of defining the boudaries.

Fix (initial) sections of the boundary name them. Give them a parametrization (approximatively the curve length). Pdetool updates the E-matrix accordingly automatically. It even evaluates this right if given to initmesh.m

Write a separate file for evaluation of the boundary-conditions, pass the relative position on that edge as a parameter. (From this the corresponding parameter value can be computed.) The values of the function $u$ and the orthogonal derivative $u_n$ has to be passed. This way you deserve the maximal freedom of writing different boundary conditions. Also many of the difficulties of the parameter passing are circumvented.

See also pdedemo3.m demo.

Assembling the system

It is suggested that you create separate assembly functions for different types of elements. The functions should be very alike, and thus easily created, once one, say linear, case is done.

It is important to note that there are three different types of basis functions, classified on their continuity properties over the triangles:

It is natural to consider these cases separately. (Why?)

An example: the traditional linear elements form an 'pyramid' like element around a node. For quadratic elements a degree of freedom corresponding to the value of function on an edge is of second kind. For every degree of freedom the is one linear equation.

Note that the boundary nodes should be treated here as well, although, they are releveant only in the first two cases.

Integration

Normally the calculation of the innerproducts is done analytically for a basic element. Do this with a Maple or Mathematica (see /p/edu/mat-1.174/ex3/elemstiff.mws ). The formulas for a canonical triangle are then stored in a matlab file. In using them you still have to convert the integral corresponding to the area of the integral. The numerical integration of the linear functionals use some appropriate Gaussian quadrature described in the handouts.

The integration of the basis elements should be done for only one type of triangle. Use canonical coordinates (see handouts??) and transform the results afterwards. (see codes below).

Helpful Matlab functions

I have created some matlab code for you in /p/edu/mat-1.174/source. If there are any suggestions for codes to be included here, please notify me. There should be a viewing code added later.

Also following functions in the toolbox directory file:/p/appl/math/matlab/toolbox/pde/ might turn out helpful. E.g.


This page originally created by <Jan.von.Pfaler@hut.fi>.
Last update 13th April 1999 by Heikki.Apiola@hut.fi