Mathematical Physics - Volume II - Numerical Methods
Chapter 3. Comparison of finite element method and finite difference method
84
• RNODE reads data from the input file (“fem.in”), which are related to nodes used to “cover” the region Ω . Based on data containing the initial and final point coordinates and the number of nodes, the subprogram generates data about all of the nodes located between them. In all preprocessor subprograms, generated data are written in the output database “fem.out”. • RELEM reads the data based on which series of elements that cover the approximation of region Ω are automatically generated. Since the elements used are isoparametric and the base functions are bi-quadratic, these elements can be both curvilinear rectangular and triangular. • RMAT reads the values k , b and f for each subregion within Ω . • RBC reads the data about function f singularities and about essential and natural boundary conditions. • PROC is the processor subprogram. • FORMKF generates terms of matrix K and vector F without taking boundary conditions into account. • ELEM calculates elements of matrix K e (with dimensions of 9 × 9 or 6 × 6) and vector F e which are obtained from element e . • SHAPE2 calculates the values of all base functions in the parametric plane and their partial derivatives with respect to ξ and η . • GETMAT returns the value of constants k , b and ¯ f based on the number of the subregion within Ω . • ASSMB sums the elements of matrix K e and vector F e with corresponding elements in K and F . • APLYBC changes the elements of matrix K and vector F in accordance with singularity data for function f , as well as essential and natural boundary conditions. Let us mention that essential boundary conditions are imposed not by changing the matrix K dimensions, but by using the “penalising” method. • BCINT calculates integrals along the boundary where natural boundary conditions are defined. • SHAPE1 gives the value of one-dimensional base functions and their derivatives. • SOLVE solves the equation system Ku = F . • TRIB triangulates the symmetrical square matrix defined its non-zero elements which are located at the diagonal and above it. • RHSB determines the element of the unknown vector u , based on the triangulated matrix K and vector F . • POST writes data about the nodes and obtained approximate values of function u in them into the output database. We will now describe the format of the input database “fem.in”, In order to better distinct between groups of data, each of them must start with a single line filled with random signs (such as ’-’ or ’*’). Apart from the first, all data groups start with a line that contains a single integer which denotes the number of data rows that the group contains. All data are defined in free format. The input database can contain data for several different problems. 1. A data group is a text (maximum length of 80 signs) which briefly identifies a problem that needs to be solved, in one way or the other. The final problem in the database always contains the “end” or “END” in it. 2. A data group consists of a number of lines equal to the number of nodes which we would like to generate. Each line contains the following seven data: • The serial number of the first node (integer) • Number of nodes (integer) • Difference between each subsequent and previous node in the series (integer) • x coordinate of the first node (float)
Made with FlippingBook flipbook maker