Image Gallery









Stuff About Me

San Le



SLFFEA Source Example

Updated 7/20/99

Please go to SLFFEA HOME, which has a complete FEA package I developed and released under the GNU license. This page is no longer relevant.
This page used to be the source code page for my simple truss program, but now I use it so you can see an example of the code I have written.
This is the Makefile : It links the individual modules together.
There are 10 program modules:
  1. femtruss.c : This is the main program. It does the memory allocation, variable definition, user request, and function calling.
  2. tsreader.c This program reads in the data for the problem.
  3. tsidlm.c This program assembles the id and lm arrays. The id array assigns the degrees of freedom per node. The lm array assigns degrees of freedom per element.
  4. dotx.c This program takes the dot product of 2 vectors.
  5. tsidiag.c This program assembles the idiag array. This array is used for keeping track of the column heights of a global stiffness matrix stored in skyline form.
  6. tskasmbl.c This program assembles the stiffness matrix in skyline form. It also will be called after the analysis is completed for calculation of the reaction forces.
  7. matx.c This program does matrix multiplication.
  8. matxt.c This program does matrix multiplication after transposing the first matrix.
  9. sky.c This program performs LU decomposition on a skylined matrix. It also has a subroutine to solve the skylined system.
  10. tswriter.c This program writes out the data to a file *.ots after analysis is complete.

There are 2 include files:

  1. tsconst.h This is the include file that defines all the constants of the program.
  2. tsstruct.h This is the include file which defines all the structures used for the program.

This is an example of a truss input file:

ts3_6.txt This file is taken from example 3.6 on page 77 in the book, A First Course in the Finite Element Method 2nd Ed. by Daryl L. Logan, published in 1992 by PWS-KENT.

You are visitor number Counter