130 likes | 212 Views
Chapter 7. Finite element programming May 17, 2011. Brief introduction. Until C hapter 6, there are FEM (Finite E lement Method ) and solution of simultaneous linear equation s . Chapter 7 focus es to expla in how to make basic FEM program s .
E N D
Chapter 7 Finite element programming May 17, 2011
Brief introduction • Until Chapter 6, there are FEM(Finite Element Method) and solution of simultaneous linear equations. • Chapter 7 focusesto explain how to make basic FEM programs. • Some easy Fortran technique is needed in some program examples. • In Appendix B, a C language program example appears.
7.1 Input data • First, consider the element division . Node numbers and node coordinates • are necessary. • Don’t confuse global node numbers with element node numbers. • Total of nodes: NNODE = 9 • Total of elements: NELMT = 8 3 6 9 [4] [8] [4] [8] [3] [7] [3] [7] 2 5 8 [2] [6] [2] [6] [1] [5] [1] [5] 1 4 7 I. Node numbers I. Node numbers II. Element numbers II. Element numbers Fig.7.1 FEM mesh division
7.2 Element coefficient matrix creating Given : (7.1) (7.2) (7.3) (7.4) • Consider the boundary value problem of the 2-dimensional Poisson equation in Chapter 5. • The natural boundary condition is • From (5.29) and (5.30) , the element rhs vector is as follows:
7.3Creating the whole coefficient matrix and solving linear equations Table 7.2 Elem. 1 2 3 Global 1 4 5 The direct stiffness method produces all coefficient matrixes and the rhs vectors. As explained in Chapter 5, element node numbers and global node numbers must be consistent.
7.4Output and important points • Don’t forget that input data have close relation to output data. • Element numbers, node numbers, boundary conditions, and node coordinates are indispensable for input data checking.
7.5 Program examples (MAIN) INPUT ASSEM SOLVE OUTPUT ECM F Fig.7.2 Relationshipofeach function Program’s structure: Main program: the whole subprogram call Input : input data’s reading Assembling : getting the global matrix and the vector, and collectingelement stiffness matrixes and element vectors ECM: element matrix and element vector calculation Solve: solving the linear equations by the Gauss elimination method Output : showing obtained values. Function: preparation of function f(x, y)
7.6 Examples of program use (1/3) Figures 7.3 and 7.4 Using the given program, let’s solve several problems.
7.6 Examples of program use (2/3) The domain Ωis a unit square (0<x, y<1). The Poisson equation is given as follows: in Ω on Γ number of nodes 36 number of nodes 121 m =5 m =10 number of elements 50 number of elements 200 Fig.7.5 A mesh division example
7.6 Examples of program use (3/3) Table 7.3 Results of Example 7.5 Exact solution even number odd number gradient -2 line Exact solution Fig.7.6 Error estimates Fig.7.7 and distributions along the centerline line
7.7 An example program using a symmetric band matrix The big change in a symmetric band matrix is subroutines SOLVE and BAND. Some modificationis needed in ASSEM For half band , input data should be + 1 .
7.8 Ending The things described in above sections have told us how to use and understand FEM problems using an easy model. This program has been separated to several parts , good for beginners.
Appendix B • Source of a C language program example is given as follows: http://www.s.kyushu-u.ac.jp/~z7kh03in/full_FEM.c