Implementation, verification, and documentation of a large-strain finite element solver for hyperelastic solids, with an Abaqus user element (UEL) in Fortran and reference implementations in MATLAB, Python, and Julia.
This repository contains the source code, the models, the report, and the reference material for the project. The table that follows gives the primary directories.
| Directory | Contents |
|---|---|
402report/ |
The project report in LaTeX (report.tex), the figures, the bibliography, and the Fortran source of the user element. |
F/ |
The Abaqus models and the job directories for the user element. |
P&N/ |
The presentation, the Bonet–Wood Chapter 8 derivations, and the related notes. |
CODE_ACTUAL/ |
The primary implementation: the MATLAB solver (FLagSHyP) and the Python port (pyimp). |
CODES_TRY/ |
Experimental implementations: the arc-length method, the Chapter 3 codes, and the tutorial codes. |
books_codes/ |
The reference codes that accompany the textbooks (FLagSHyP MATLAB, FLagSHyP F90, and others). |
A/, A2/, AV/ |
The LaTeX derivations of the kinematics chapters (polar decomposition, distortional decomposition). |
SMA_UM_User_Material_Subroutine_for_Thermomechanic/ |
The user material (UMAT) for shape memory alloys and the related jobs. |
books/, fortran_books/ |
The reference documents. |
The solver obeys the theory of nonlinear continuum mechanics. The primary steps are as follows:
- Kinematics — The deformation gradient, the strain measures, and the polar decomposition.
- Stress measures — The Cauchy stress, the first and the second Piola–Kirchhoff stress.
- Constitutive laws — Isotropic hyperelasticity, and specifically the compressible neo-Hookean model. The derivations include the stress expression and the spatial material tangent.
- Virtual work — The integral form of the balance equation, and its linearization.
- Discretization — The element formulation and the Newton–Raphson solution algorithm.
- Verification — The case studies that compare the results of the user element with the results of the standard Abaqus element.
The report in 402report/report.pdf gives the full theory and the results.
The Fortran source is in 402report/F/src/:
src/
├── main.for # The UEL entry point
├── brick_element.for # The 8-node hexahedral element
├── material_laws.for # The constitutive models
└── UVARM.for # The output variables
The models are in 402report/F/:
modelUEL.inp— The model that uses the user element.modelABQ.inp— The equivalent model that uses the standard C3D8 element.includes/— The node data and the element data.
Compilation and analysis in one step:
abaqus job=modelUEL user=src/main.for interactiveThe reference analysis:
abaqus job=modelABQ interactiveCAUTION: BEFORE YOU START THE ANALYSIS, MAKE SURE THAT THE FORTRAN COMPILER IS COMPATIBLE WITH THE ABAQUS VERSION. IF THE VERSIONS ARE NOT COMPATIBLE, THE COMPILATION WILL STOP AND THE JOB WILL FAIL.
The solver is in CODE_ACTUAL/code/. The entry point is FLagSHyP.m. The modules
are as follows:
| Module | Function |
|---|---|
input_reading/ |
Reads the input file and the mesh. |
initialisation/ |
Prepares the data structures and the boundary conditions. |
FEM_shape_functions/ |
Gives the shape functions and their derivatives. |
kinematics/ |
Calculates the deformation gradient and the strain measures. |
constitutive laws/ |
Calculates the stress and the tangent modulus. |
element_calculations/ |
Calculates the element residual and the element stiffness. |
global_assembly/ |
Assembles the global system. |
solution_equations/ |
Solves the linear system. |
solution_update/ |
Updates the displacements and the internal variables. |
convergence_check/ |
Makes sure that the solution converged. |
solution_write/ |
Writes the results. |
cd CODE_ACTUAL/code
FLagSHyPThen, give the name of the job when the program asks for it.
The Python port is in CODE_ACTUAL/pyimp/. It gives the same results as the MATLAB
solver, but it is easier to read and to modify.
cd CODE_ACTUAL/pyimp
python -m pip install -r requirements.txt # If the file is available
python main.py <job_name>For more information, refer to CODE_ACTUAL/pyimp/DOCUMENTATION.md and to
CODE_ACTUAL/pyimp/README.md. For the plots, refer to README_plotting.md.
The report is written in LaTeX. To make the PDF, do the steps that follow:
cd 402report
latexmk -pdf report.texThe output is report.pdf. The bibliography is in references.bib. The figures are
in figures/.
The directory SMA_UM_User_Material_Subroutine_for_Thermomechanic/ contains a user
material subroutine (UMAT) for the thermomechanical behavior of shape memory alloys.
The subroutine uses the Lagoudas model. The job directories contain the test cases:
- The shape memory effect (SME).
- The isothermal and the non-isothermal tension.
- The multi-load cases.
The solver output binaries are not in this repository. The .gitignore file
excludes:
- The Abaqus databases (
*.odb) and the status files (*.stt). - The compiled artefacts (
*.so,*.pyc,*.o,*.mod). - The bundled Julia installation in
CODES_TRY/CH3_CODE/julia/. - The LaTeX intermediate files.
These files are large and you can make them again from the sources.
| Software | Use |
|---|---|
| Abaqus 2021 or later | The user element and the user material. |
| A Fortran compiler (Intel oneAPI) | The compilation of the subroutines. |
| MATLAB R2020a or later | The primary solver. |
| Python 3.9 or later (NumPy, SciPy, Matplotlib) | The Python port and the plots. |
| A LaTeX distribution (TeX Live or MiKTeX) | The report and the presentation. |
| Julia 1.12 | Some of the experimental codes in CODES_TRY/. |
The primary references for the theory are:
- Bonet, J. and Wood, R.D. — Nonlinear Continuum Mechanics for Finite Element Analysis, 2nd edition.
- Crisfield, M.A. — Non-linear Finite Element Analysis of Solids and Structures, Volumes 1 and 2.
- Lagoudas, D.C. — Shape Memory Alloys: Modeling and Engineering Applications.
The full list is in 402report/references.bib.