Monday, April 18, 2011

Tutorial : How To Implement Finite Element Method

In the previous post I discussed some of the concepts in finite element method. It is important to note that although the case that we have taken up is that of longitudinal deformation of a bar, the findings and discussions are equally applicable to any problem which can be solved by finite element method. Examples of application will be presented later, this post, however deals with the general steps in implementing the method.

Meshing
The first step is to discretize the physical domain into smaller elements. For a one dimensional problem the discretization is very simple, and is shown with the help of Fig. 1 below:
Fig. 1
The discretization is done by cutting the bar into smaller linear elements. These elements are labelled as $I_{i}$ and the subscript $i$ denotes the element number. Just like the bar, these smaller elements also have end points which are called nodes of the elements. These are labelled as $x_{i}$ where the subscript $i$ denotes the node number. The nodes are shown with big dots and they mark the start and end of different elements. Note that the number of elements is one less than the number of nodes. The elements are linear, of course, because the system under consideration is one dimensional. This process of breaking up of the physical domain into smaller pieces is known as meshing.

Basis Functions
You may notice that there are coloured triangles over each of the nodes with the exception of the boundary nodes which do not have complete triangles. Moreover, these triangles are labelled as $\phi_{i}$ where $i$ corresponds to the node number. What are these triangles? These triangles are nothing but interpolation functions also called Lagrangian basis functions. Their job is to provide a linear approximation of the original solution $u(x)$. This approximation is given as: $$u_{FE}(x)= \sum_{i}u_{i}\phi_{i}(x)$$, where $u_{i}$ is the nodal amplitude.The writing of this equation implies that we are looking for a series solution for the original function $u(x)$.

Let us see through Fig. 2 below, how these basis functions which are also known as hat functions are defined.
Fig. 2
A certain basis function $\phi_{i}$ is depicted in Fig. 2. At the nodal coordinate $x_{i}$ to which this basis function belongs, its value should be 1. It can be confirmed from the figure that at $x=x_{i}$ the value of $\phi_{i}$ is 1. Basis functions are defined separately for different segments, as shown in Fig. 2. These functions (hat functions) are non-zero only in the two adjacent elements connecting the node on which they are defined. They are zero everywhere else in the domain.

The topic is continued till the next post.

3 comments:

  1. keep on writing these it will be helpful for me when i will read engineer.

    ReplyDelete
  2. Thanks Sudeep. Keep coming back for more. I will shortly upload some interesting stuff.

    ReplyDelete
  3. This was really helpful, thank you!

    ReplyDelete

Follow Husnain_Inayat on Twitter View Husnain Inayat Hussain's LinkedIn profile