Mathematical Physics - Volume II - Numerical Methods

Chapter 3. Comparison of finite element method and finite difference method

90

------------------------------------------------------------ Test primer br. 3: Odredjivanje strujne funkcije. ------------------------------------------------------------ 9 1 5 1 8. 0. 16. 0. 6 5 1 7.761 1.941 16. 4. 11 5 1 7.155 3.578 16. 8. 16 5 1 6.4 4.8 16. 12. 21 5 1 5.656 5.656 16. 16. 26 5 1 4.8 6.4 12. 16. 31 5 1 3.578 7.155 8. 16. 36 5 1 1.941 7.761 4. 16. 41 5 1 0. 8. 0. 16. ------------------------------------------------------------ 2 4 10 9 1 1 3 13 11 2 8 12 6 7 4 10 9 1 3 5 15 13 4 10 14 8 9 ------------------------------------------------------------ 1 -1. 0. 0. ------------------------------------------------------------ 0 ------------------------------------------------------------ 3 1 5 1 0. 6 8 5 0. 25 5 5 10. ------------------------------------------------------------ 2 5 2 1 2 0. 0. 4 2 4 4 0. 0. ------------------------------------------------------------ end ------------------------------------------------------------ Finally, let us show the Fortran text for the whole FEM program. PROGRAM fem PARAMETER (maxn=400,maxe=100,maxm=5,maxbce=70,maxbcn=40,maxpt=10, & maxband=25) CHARACTER title*80 COMMON /ctitl / title COMMON /ccon / nnode , nelem , nmat , nbce , nbcn , npoint , & nband COMMON /cnode / x(2,maxn) , u(maxn) COMMON /celem / ne(maxe) , mat(maxe) , nodes(9,maxe) COMMON /cmatl / prop(3,maxm) COMMON /cbc / nodbc(maxbce) , vbce(maxbce) , nelbc(maxbcn) , & nside(maxbcn) , vbcn(2,maxbcn) , npt(maxpt) , & vpt(maxpt)

Made with FlippingBook flipbook maker