This repository contains a Finite Element Method (FEM) solver written in Fortran, designed for classical FEM analysis of 2D frames. The main program main.py reads an input file that defines the nodes, elements, materials, loads, and boundary conditions, and outputs the results of the FEM analysis.
The input file must follow this structured format with the following sections:
-
2D FRAME Header Specifies the problem type and units:
2D FRAME [m], [kN] -
NODES Section Defines the number of nodes and their coordinates:
NODES <NNODES> <IDNODE, X, Y> -
SECTIONS Section Defines the cross-sectional properties for each section:
SECTIONS <NSEC> <IDSEC, AREA, INERTIA, DEPTH, SHEAR> -
MATERIALS Section Describes the material properties:
MATERIALS <NMAT> <IDMAT, YOUNG, POISSON, THERMAL, WEIGHT> -
ELEMENTS Section Specifies the connectivity of the elements:
ELEMENTS <NELE> <IDELE, NODE1, NODE2, IDSEC, IDMAT> -
RESTRAINTS Section Defines the boundary conditions (restraints) at specific nodes:
RESTRAINTS <NRES> <NODE, DIRECTION> -
ELEMENT LOADS Section Specifies the loads applied to elements:
ELEMENT LOADS <NLOADS> <ELEMENT, PX, PY1, PY2, DTTOP, DTBOT>
-
Compile the Fortran Code:
Ensure you have a Fortran compiler installed. You can usegfortranto compile the code:gfortran -o fem_solver main.f90
-
Run the Code:
After compiling, you can run the program with your input file:./fem_solver <input_file_path>
The program will process the input, perform the FEM analysis, and output the results.
- Add support for 3D frame analysis.
- Implement advanced material models.
- Improve visualization of results.
This project was developed during my studies in mechanical engineering, using Fortran to solve complex structural problems with FEM. Feel free to explore and contribute to the project!