finiteelement
A structural Finite Element Method MATLAB program taking in standard format input and boundary_conditions files. Output is the displacement vector.
Version 1.0
1. Prepare the input.txt file
The structure of the input file is as follows:
a. There are 15 columns separated by spaces and (No. of Elements + 1) rows.
b. The first two columns of the first row have the number of elements (NEL) and the no of nodes (No_Nodes) followed by thirteen zeros
c. Every row that follows has the following format:
- Element Number (Elno)
- The smaller node number (i)
- The bigger node number (j)
- x component of the consistent nodal force vector on the first node (Fxi)
- y component of the consistent nodal force vector on the first node (Fyi)
- Moment on the first node (NOT USED BY THE PROGRAM in v1.0) (Mi)
- x component of the consistent nodal force vector on the second node (Fxj)
- y component of the consistent nodal force vector on the second node (Fyj)
- Moment on the second node (NOT USED BY THE PROGRAM in v1.0) (Mj)
- Elastic modulus of the element (E)
- Cross-sectional area of the element (A)
- Moment of Inertia of the bar element (NOT USED BY THE PROGRAM in v1.0) (I)
- Length of the element (L)
- Height of the element (NOT USED BY THE PROGRAM in v1.0)(h)
- Orientation of the element (α)
NEL No_Nodes 0 0 0 0 0 0 0 0 0 0 0 0 0
ELno i j Fxi Fyi Mi Fxj Fyj Mj E A I L h α
…
…
2. Prepare the input_geometry.txt file
This file isn't used in in v1.0 The structure of the input file is as follows:
a. There are 7 columns separated by spaces and (No. of Elements + 1) rows.
b. The first two columns of the first row have the number of elements (NEL) and the no of nodes (No_Nodes) followed by five zeros
c. Every row that follows has the following format:
- Element Number (Elno)
- The smaller node number (i)
- The bigger node number (j)
- global x-coordinate of first node (xi)
- global y-coordinate of first node (yi)
- global x-coordinate of second node (xj)
- global y-coordinate of second node (yj)
NEL NNodes 0 0 0 0 0
Elno i j xi yi xj yj
…
…
3. Prepare the boundary_conditions.txt file
The structure of the input file is as follows:
a. There are 7 columns separated by spaces and (No. of Boundary conditions + 1) rows.
b. The first two columns of the first row have the number of boundary conditions (NBC) followed by two zeros
c. Every row that follows has the following format:
- Global Node Number (Node)
- The degree of freedom that is being constrained: 1 for x-direction, 2 for y-direction and 3 for angle (angle isn't used in v1.0) (BC_DOF)
- The magnitude of the constraint (BC_magnitude)
NBC 0 0
Node BC_dof BC_magnitude
… … …
4. Run the program in MATLAB
Make sure all the txt files are in the same folder as the fem.m
file and run the fem.m
matlab program