Skip to content

alexmacastro/FEM_PYTHON

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2D-Finite Element Analysis with Python

This repo contains a simple finite element analysis code for 2D elasticity problems. The code uses as input data simple-to-create text files containing nodal, element, material and load data.

The repo contains 3 folders:

  1. MAIN/ stores the python scripts divided in
  • solids_ISO.py (the main program),
  • preprocesor.py (model input subroutines),
  • assemutil.py (assembly subroutines), FEMUTIL.py(general finite element method subroutines),
  • uelutil.py (local matrix subroutines for different elements), and
  • postprocesor.py (results handling subroutines);
  1. MESHES/ contains input files and meshes in .msh format corresponding to different examples; and

  2. MESHUTILS/ stores programs to conduct pre-processing and post-processing from and to GMESH. Since the code has been created for academic purposes it gives as main results the displacement vector corresponding to the nodal points of the domain. These vectors are used, together with the Python function griddata to interpolate and plot the displacement solution all over the domain. Post-processing to compute strain and stress values is left for students projects.

Authors

Instructions

The code is written in Python 2 dialect (we believe that it will work in Python 3 but we have not tested yet) and it depends on numpy, scipy and sympy. To use it clone the repo with

git clone https://github.com/jgomezc1/FEM_PYTHON.git

uncompress the zip folder an run the main file in the Python console of your preference.

If you want to run the examples with GUI input you will need to install easygui. And, you will need meshio to automatically read GMSH mesh files. These two can be installed with

pip install easygui
pip install meshio

To run the files in MESHUTILS you will need to have gfortran and run the following make instructions

make --file="CONTOUR Makefile"
make --file="MESHER Makefile"

License

This project is licensed under the MIT license.

About

2D-Finite Element Analysis with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 56.0%
  • Fortran 34.4%
  • GLSL 9.2%
  • Makefile 0.4%