Skip to main content

User-friendly Python library that simplifies finite element analysis.

Project description

EasyFEA_banner

PyPI version shields.io PyPI - Python Version License: GPL v3 Codestyle black PyPI - Downloads Tests

Overview

EasyFEA is a user-friendly Python library that simplifies finite element analysis. It is flexible and supports different types of simulations without requiring users to handle complex PDE formulations. The library currently supports five specific simulation types:

  1. Linear Elastostatic and Elastodynamics simulations
  2. Nonlinear Hyperelastic Static simulations
  3. Euler-Bernoulli beam simulations
  4. Thermal simulations
  5. PhaseField damage simulations for quasi-static brittle fracture

All examples are available in this gallery.

For each simulation, users create a mesh and a model. Once the simulation has been set up, defining the boundary conditions, solving the problem and visualizing the results are straightforward.

Numerous examples of mesh creation are available in Mesh examples.

The simplest and quickest introduction is shown below and is available in the Beginner’s Guide.

from EasyFEA import Display, Mesher, ElemType, Materials, Simulations
from EasyFEA.Geoms import Point, Domain

# ----------------------------------------------
# Mesh
# ----------------------------------------------
L = 120  # mm
h = 13

domain = Domain(Point(), Point(L, h), h / 3)
mesh = Mesher().Mesh_2D(domain, [], ElemType.QUAD9, isOrganised=True)

# ----------------------------------------------
# Simulation
# ----------------------------------------------
E = 210000  # MPa
v = 0.3
F = -800  # N

mat = Materials.ElasIsot(2, E, v, planeStress=True, thickness=h)

simu = Simulations.ElasticSimu(mesh, mat)

nodesX0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0)
nodesXL = mesh.Nodes_Conditions(lambda x, y, z: x == L)

simu.add_dirichlet(nodesX0, [0, 0], ["x", "y"])
simu.add_surfLoad(nodesXL, [F / h / h], ["y"])

simu.Solve()

# ----------------------------------------------
# Results
# ----------------------------------------------
Display.Plot_Mesh(simu, deformFactor=10)
Display.Plot_Result(simu, "uy", plotMesh=True)
Display.Plot_Result(simu, "Svm", plotMesh=True, ncolors=11)
Display.Plot_BoundaryConditions(simu)

Display.plt.show()

License

Copyright (C) 2021-2025 Université Gustave Eiffel.

EasyFEA is distributed under the terms of the GNU General Public License v3.0 only, see LICENSE.txt and CREDITS.md for more information.

Documentation

Refer to the documentation for detailed installation and usage details.

Installation

EasyFEA can be easily installed from PyPI using pip, compatible with Python versions 3.9 through 3.12:

pip install EasyFEA

You can also install EasyFEA with the source code using the pip install . command in the downloaded or cloned EasyFEA folder.

Dependencies

EasyFEA uses several libraries, such as NumPy and Gmsh - as such, the following projects are required dependencies of EasyFEA:

  • numpy - Fundamental package for scientific computing with Python.
  • gmsh (>= 4.12) - Three-dimensional finite element mesh generator.
  • scipy - Fundamental package for scientific computing in Python.
  • matplotlib - Plotting package.
  • pyvista - Plotting package.
  • numba - Compiling Python code using LLVM.
  • pandas (3.9 <= Python <= 3.12) - Powerful data structures for data analysis.
  • imageio and imageio[ffmpeg] - Library for reading and writing a wide range of image, video, scientific, and volumetric data formats.
  • meshio - I/O for many mesh formats.

Optional Dependencies

EasyFEA includes a few optional dependencies for reducing resolution time or for performing DIC:

  • pypardiso (Python > 3.8 & Intel oneAPI) - Library for solving large systems of sparse linear equations.
  • petsc and petsc4py - Python bindings for PETSc.
  • opencv-python - Computer Vision package.

Naming conventions

EasyFEA uses Object-Oriented Programming (OOP) with the following naming conventions:

  • PascalCasing for classes
  • camelCasing for properties
  • Snake_Casing or Snake_casing for functions/methods

In this library, objects can contain both public and private properties or functions.

Private parameters or functions are designated by a double underscore, such as __privateParam. In addition, parameters or functions beginning with an underscore, such as _My_Function are accessible to advanced users, but should be used with caution.

Citing EasyFEA

If you are using EasyFEA as part of your scientific research, please contribute to the scientific visibility of the project by citing it as follows.

Matthieu Noel. EasyFEA: a user-friendly Python library that simplifies finite element analysis. 2024, https://hal.science/hal-04571962

Bibtex:

@softwareversion{noel:hal-04571962v1,
  TITLE = {{EasyFEA: a user-friendly Python library that simplifies finite element analysis}},
  AUTHOR = {Noel, Matthieu},
  URL = {https://hal.science/hal-04571962},
  NOTE = {},
  INSTITUTION = {{Universit{\'e} Gustave Eiffel}},
  YEAR = {2024},
  MONTH = Apr,
  SWHID = {swh:1:dir:ffb0e56fe2ce8a344ed27df7baf8f5f1b58700b5;origin=https://github.com/matnoel/EasyFEA;visit=swh:1:snp:88527adbdb363d97ebaee858943a02d98fc5c23c;anchor=swh:1:rev:ee2a09258bfd7fd60886ad9334b0893f4989cf35},
  REPOSITORY = {https://github.com/matnoel/EasyFEA},
  LICENSE = {GNU General Public License v3.0},
  KEYWORDS = {Finite element analyses ; Computational Mechanics ; Numerical Simulation ; Phase field modeling of brittle fracture ; Linear elasticity ; Euler-Bernoulli beam ; DIC - Digital Image Correlation ; User friendly ; Object oriented programming ; Mesh Generation},
  HAL_ID = {hal-04571962},
  HAL_VERSION = {v1},
}

Contributing

EasyFEA is an emerging project with a strong commitment to growth and improvement. Your input and ideas are invaluable to me. I welcome your comments and advice with open arms, encouraging a culture of respect and kindness in our collaborative journey towards improvement.

To learn more about contributing to EasyFEA, please consult the Contributing Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyfea-1.4.3.tar.gz (223.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easyfea-1.4.3-py3-none-any.whl (244.4 kB view details)

Uploaded Python 3

File details

Details for the file easyfea-1.4.3.tar.gz.

File metadata

  • Download URL: easyfea-1.4.3.tar.gz
  • Upload date:
  • Size: 223.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for easyfea-1.4.3.tar.gz
Algorithm Hash digest
SHA256 a7810f77bcff70328a268368731fbe34cbde3565061a1977b6dc1bc8c211b5b0
MD5 9db350f9681e5ed3d9b581fe82650891
BLAKE2b-256 7dd58f3315d17832f5e4a933df7e05982d024f0019c3c13c60ac2db11d691163

See more details on using hashes here.

File details

Details for the file easyfea-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: easyfea-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 244.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for easyfea-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0f27c68c0becf3affa633c077d74e1847be5193d4c106eaf18e518e998d188f2
MD5 6b73e101f4d09cdf7f04c0466e45ba2f
BLAKE2b-256 984bc5eaabb1de98549433fa5dc50dcc1cab918ca3a51190b639eefb677330cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page