Finite element programming and C

  • Authors:
  • Z. Sanal

  • Affiliations:
  • -

  • Venue:
  • Computers and Structures
  • Year:
  • 1994

Quantified Score

Hi-index 0.00

Visualization

Abstract

In finite element programming, data have to be dealt with which are of different types but belong together in a logical sense. It would be very effective, with respect to program readability and maintainability, to store these data as a single unit. Effcient software design requires that all parts of information, which belong together logically, are stored as a single data unit. This can be accomplished utilizing structured data types. Dynamic memory allocation allows the definition of dynamic variables which can be created and destroyed during run-time. Dynamic memory management is handled in C by pointers. In other conventional languages, e.g. Fortran 77, the programmer has the responsibility to select adequate array sizes for the largest problem to be solved. This often leads in engineering practice to array oversizing and to memory wasting. By allocating memory dynamically during program execution according to actual problem size, wasting can be avoided. The combination of structured data and pointers along with the dynamic memory allocation capabilities of C allows the creation of linked lists. Utilizing these concepts, an effective and easy-to-read C program has been written for finite element analysis. The C program presented demonstrates the use of these techniques for interactive finite mesh generation. The strengths of C are compared to that of Fortran 77 and Fortran 90. It has been found that for finite element programming C is in many aspects superior to Fortran 77. However, it has some disadvantages in comparison with Fortran 90 concerning array processing.