Theory of The Finite Element Method
Theory of The Finite Element Method
GIKI logo
The unknown displacement components will be determined by minimizing the potential energy of the solid with respect to the nodal displacements.
To calculate the potential energy, we need to be able to compute the displacements within each element. This is done by interpolation. Consider a triangular element, with nodes a, b, c at its corners. Let denote the coordinates of the corners. Define the element interpolation functions (also known as shape functions) as follows
These shape functions are constructed so that They vary linearly with position within the element Each shape function has a value of one at one of the nodes, and is zero at the other two. We then write
file:///E|/calisma/FEM/Downloads%20-%20FEM/Theory%20of%20the%20Finite%20Element%20Method.htm (3 of 20)22.01.2006 17:42:08
One can readily verify that this expression gives the correct values for triangle.
The factor of 2 multiplying the shear strains in the strain vector has been introduced for convenience. is constant. It Note that, for linear triangular elements, the matrix of shape function derivatives depends only on the coordinates of the corners of the element, and does not vary with position within the element. This is not the case for most elements for example, you may recall from Homework 2 that varies with position for a square element.
Now, we can compute the strain energy density within the element. Begin by computing the stresses within the element. For plane strain deformation, we have that
Now, express these results in terms of the nodal displacements for the element
We can now compute the total strain energy stored within the element. Because is constant, we merely need to multiply the strain energy density by the area of the element. Recall that the area of the triangle can be computed from the coordinates of its corners as follows
so that
Observe that, because the material property matrix also symmetric. To see this, note that
displacements, rather than using for each element to describe the displacements. This is because several elements may share the same node. We will illustrate how this is done by considering the simplest possible finite element mesh, shown below
If we wanted to, we could add the missing terms to each element displacement vector:
We can now collect together corresponding terms in the two element stiffness matrices to express this as
where
is known as the Global stiffness matrix. It is the sum of all the element stiffness matrices.
Because the element stiffness matrix is symmetric, the global stiffness matrix must also be symmetric. To assemble the global stiffness matrix for a plane strain or plane stress mesh with N nodes, we use the following procedure. 1. Note that for nodes, there will be unknown displacement components (2 at each global stiffness matrix,
node). Therefore, we start by setting up storage for a and set each term in the matrix to zero. 2. Next, begin a loop over the elements. 3. For the current element, assemble the element stiffness matrix
4. Add the element stiffness matrix to the global stiffness matrix, using the following procedure. Let a, b, c denote the numbers of the nodes on the 3 corners of the element. Let for
i=16, j=16 denote the terms in the the element stiffness matrix. Let for n=12N, m=12N denote the terms in the global stiffness matrix. Then,
Here, the symbol += means that the term on the left is incremented by the term on the right, following standard C syntax. 5. Proceed to the next element.
1. The element on which the loading acts 2. The face of the element which is loaded 3. The traction vector t (force per unit area) that acts on the face of the element. The traction is assumed to be constant on the face of any one element.
Now, we compute the contribution to the potential energy due to the traction acting on the face of one element.
For the element shown, the contribution to the potential energy would be
Recall that the displacements vary linearly within a 3 noded triangle. Therefore, we can write
Abbreviate this as
The vector r is referred to as the `residual force vector Body Forces The same approach may be used to include the effects of external body forces. The details are left as an exercise.
where is the global residual force vector. The global residual force vector for a mesh with N nodes is assembled as follows. 1. The residual force vector has length 2N (2 entries per node). Reserve storage for a vector of length 2N and initialize to zero 2. Loop over elements 3. Determine which face of the element is loaded. Let a, b denote the node numbers attached to this face. Determine the residual force vector for the element face. Let the terms in the element face residual vector. Let , n=12N denote the terms in the global residual force vector. Then , i=14 denote
Now, minimize V
is symmetric
This is a system of 2N simultaneous linear equations for the 2N unknown nodal displacements. Standard computational techniques such as Gaussian elimination, Cholesky factorization or conjugate gradient methods may be used to solve the system of equations.
To prescribe displacements for any node, we simply replace the equation for the appropriate degrees of freedom with the constraint. For example, to force equations to , we could modify the finite element
This procedure works, but has the disadvantage that the modified stiffness matrix is no longer symmetric. It is preferable to modify the stiffness and residual further, to retain symmetry. To do so, we eliminate the constrained degrees of freedom from all rows of the stiffness matrix. This is best illustrated by example. Suppose our modified stiffness matrix has the form
Now, we wish to set each entry in the second column (apart from the diagonal) to zero, so that the stiffness is symmetric. Recall that we can add and subtract equations in the system from one another without affecting the solution. Therefore, to symmetrize the stiffness matrix in our example, we can subtract appropriate multiples of the second row so as to set each entry in the second column to zero.
Node#, coordinate, coordinate, Number of elements M, Element#, Node number for 1st node, 2nd node,3rd node Element#, Node number for 1st node, 2nd node,3rd node Number of prescribed displacements L, Node number of 1st prescribed displacement, component (1 or 2), value of the displacement, Node number of 2nd prescribed displacement, component (1 or 2), value of the displacement, Node number of Lth prescribed displacement, component (1 or 2), value of the displacement, Number of loaded element faces K,
, traction , traction
, ,
Number of second loaded element, face number (1,2,or3), traction Number of Kth loaded element, face number (1,2,or3), traction
, traction
The code produces an output file, which lists all the nodal displacements, as well as the stresses and strains within each element. As an example, we will solve the simple 2 element, 4 node problem shown below
The input file for this problem is listed below: Test 10. 0.33 4 1 0.0 0.0 2 1.0 0.0 3 1.0 1.0 4 0.0 1.0 2 1123 2134 3 1 1 0.0 1 2 0.0 2 2 0.0
file:///E|/calisma/FEM/Downloads%20-%20FEM/Theory%20of%20the%20Finite%20Element%20Method.htm (17 of 20)22.01.2006 17:42:08
1 2 2 0.0 2.0 The output file produced after running the program looks like this: Test ********************************* Number of Nodes and Elements: 4 2 Young's Modulus 10.0000 Poisson's Ratio .3300 ********* Nodal Coordinates *********** Node# x1 x2 1 0.0000 0.0000 2 1.0000 0.0000 3 1.0000 1.0000 4 0.0000 1.0000 ********* Element Connectivity ********** Element Node 1 Node 2 Node3 1123 2134 ********* Presecribed Displacements *********** Node# Component Value 1 1 0.0000 1 2 0.0000 2 2 0.0000 ********* Presecribed Loads *********** Element Side# Node 1 Node 2 P1 P2 2 2 3 4 0.0000 2.0000 ******** Computed Nodal Displacements ********* Node u1 u2 1 0.0000 0.0000 2 -.0660 0.0000 3 -.0660 .2000 4 -.0000 .2000 ******** Element Strains and Stresses *********
Element e_11 e_22 e_12 s_11 s_22 s_12 1 -.0660 .2000 -.0000 .0000 2.0000 -.0000 2 -.0660 .2000 0.0000 .0000 2.0000 0.0000 Now, well take a detailed look at the FEM code. It is divided into 7 main sections: 1. Read the input file and set up data structures to store nodal coordinates, element connectivity and boundary conditions 2. Print the input data and plot the mesh on the screen 3. Define the element stiffness matrix 4. Define the element residual vector 5. Assemble the global stiffness matrix 6. Assemble the residual force vector 7. Modify the stiffness to account for constrained degrees of freedom 8. Solve the FEM equations 9. Plot the deformed mesh on the screen 10. Write results to a file. A listing of the MAPLE program, with comments, is given here. Dowload by right clicking here and using 'Save as...'; call the file FEM.mws. You can download a copy of the input file for the simple example above file by right clicking here. You should use "save target as..." to save the file as FEM.txt. You can load it into MAPLE by starting MAPLE, then using the fileopen(specify file name) to read the Maple file. It should appear within a MAPLE window. You will need to change two lines of the file to make it run properly. First, find the line that reads
s
infilename :=`D:/JABfiles/classes/en175_2001/FEM_prog/femdat.txt`:
and change the path to the full path of a directory on your filespace, i.e. infile := fopen(`your directory/fem.dat`,READ): Note that you must use forward slashes / to denote directory roots, even on an NT system. The results will be printed in an outfile called fem dat.out.txt. You can click here to download the sample input file for the 2 element problem described earlier (make sure you save the file to your directory/fem.dat so that MAPLE can read it). And here is the input file for this mesh:
You can try a number of tests to understand how the program works. You can add print() commands to print out any intermediate variables you like for example, you could examine each element stiffness matrix as it is added to the global stiffness. You can also do tests like computing the determinant of the global stiffness (The determinant should be zero before the boundary constraints are added. Can you see why?)