Download - Chapter 7
![Page 1: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/1.jpg)
Chapter 7
Finite element programming
May 17, 2011
![Page 2: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/2.jpg)
Brief introduction
• Until Chapter 6, there are FEM (Finite Element Method) and solution of simultaneous linear equations.
• Chapter 7 focuses to 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.
![Page 3: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/3.jpg)
7.1 Input data
I. Node numbers II. Element numbers
•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 = 9Total of elements: NELMT = 8
I. Node numbers II. Element numbers
1
2
3
4
5
6
7
8
9
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
Fig. 7.1 FEM mesh division
![Page 4: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/4.jpg)
7.2 Element coefficient matrix creating
• 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:
20/ onnu
3
1
),(3
),(j
jjeyxg
Sdxdyyxg Given :),( yxg
e i
ei dxdyyxLyxff ),(),()(
(7.1)
(7.2)
(7.3)
(7.4)
ijjjjjijjjj yxfyxLyxfyxg ),(),(),(),(
3/),()(ii
ei yxSff
![Page 5: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/5.jpg)
7.3Creating the whole coefficient matrix and solving linear equations
• 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.
Elem.
Global
1 32
1 54
Table 7.2
![Page 6: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/6.jpg)
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.
![Page 7: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/7.jpg)
7.5 Program examples• Program’s structure:1. Main program: the whole subprogram call
2. Input : input data’s reading
3. Assembling : getting the global matrix and the vector, and collecting element stiffness matrixes and element vectors
4. ECM: element matrix and element vector calculation
5. Solve: solving the linear equations by the Gauss elimination method
6. Output : showing obtained values.
7. Function: preparation of function f(x, y)
(MAIN)
INPUT ASSEM
ECM
F
SOLVE OUTPUT
Fig.7.2 Relationship of each function
![Page 8: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/8.jpg)
7.6 Examples of program use (1/3)
• Using the given program, let’s solve several problems.
Figures 7.3 and 7.4
![Page 9: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/9.jpg)
7.6 Examples of program use (2/3)
1 u number of nodes 36 number of nodes 121 m =5 m =10 number of elements 50 number of elements 200
The domain Ω is a unit square (0<x, y<1).The Poisson equation is given as follows:
Fig.7.5 A mesh division example
in Ω
on Γ
![Page 10: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/10.jpg)
7.6 Examples of program use (3/3)Table 7.3 Results of Example 7.5
Fig.7.7 and distributions along the centerline lineu
u
Exact solution
Fig.7.6 Error estimates Exact solution
even number
odd number
gradient -2 line
![Page 11: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/11.jpg)
7.7 An example program using a symmetric band matrix
• The big change in a symmetric band matrix is subroutines SOLVE and BAND.
• Some modification is needed in ASSEM• For half band , input data should be + 1 .Am Am
![Page 12: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/12.jpg)
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.
![Page 13: Chapter 7](https://reader036.vdocuments.mx/reader036/viewer/2022062718/56812c68550346895d910057/html5/thumbnails/13.jpg)
Appendix B
• Source of a C language program example is given as follows:
http://www.s.kyushu-u.ac.jp/~z7kh03in/full_FEM.c