Module 5 :
Lecture 14One - Dimensional Finite Element Code
 


Introduction

By now, we have completely developed the one - dimensional finite element formulation for the problem of axially loaded bar. We have the required mathematical expressions for the shape functions needed to approximate the primary variable, i.e., the axial displacement. We also have the expressions for the coefficient matrix (i.e., the stiffness matrix) and the right side vector (i.e., the force vector) of the algebraic equations that arise after the approximation is substituted in the integral form of the governing equation. For convenience, these quantities are calculated element by element and then assembled to the global size. We have the expressions for the element stiffness matrix and the element force vector and also the algorithm for assembling them into the global stiffness matrix and the global force vector. Finally, we have the algorithm for applying the boundary conditions : Dirichlet type (i.e., specification of the axial displacement), Neumann type (i.e., specification of the axial force) or spring type (i.e., bar end connected by a spring). But, so for, we have not discussed how to solve these algebraic equations. This is really not a part of finite element formulation. Nevertheless, it will be discussed, but at a later stage.

Presently, we shall discuss how to write a computer code for this one - dimensional problem. We have already discussed the algorithm for numerical evaluation of the integrals of the element stiffness matrix and the element force vector. We also have created small computer codes (in the form of subroutines) for the generation of the data for numerical integration, evaluation of the shape functions and their derivatives and calculation of the element stiffness matrix and the element force vector. Now, we shall develop subroutines for the remaining part of the formulation and then integrate all of them into a single computer code. No background material on how to write computer codes will be provided in this course. The readers are advised to read standard texts on computer programming like those by Rajaraman ( ).

It would be quite complex if the code is to be developed for the most general case of geometry, loading etc. Therefore to simplify the coding, we restrict ourselves to certain simple specifications. These specifications are discussed in the next sub-section.