Skip to main content

A python FEM solver for educational purposes.

Project description

PyFEMP Python Finite Element Program

PyFEMP (Python Finite Element Program) is a simple Finite Element program written in python. Its focus is on simplicity not on performance.

Canti

It should be easy to use, to understand and as portable as possible to be used in teaching. We aim to void overhead w.r.t. environmental setup (compiler, libraries, e.t.c. ...) or dealing with complex structures, to focus on the essense of the FEM.

Therefore PyFEMP is written completely in python with the only required modules are numpy and matplotlib. Furthermore the program provides lsess than 30 commands, including postprocessing and meshing. Python code is really easy to read and write. This holds especially when performance is not critical. In PyFEMP we emprace python loops (easy to read/write but weak in performance), leading to acceptable runtime (<20s) up to ~2000 Elements.

What it can do:

  • static/dynamic FE analysis
  • 1D, 2D analysis (3D is techniqually possible but visualisation is not supported via matplotlib)
  • implementing user specific elements
  • arbitrary number of nodal degrees of freedom e.g. for coupled FEM
  • nonlinear analysisi via implemented Newton-Raphson
  • visualsiation of element specific postprocessing fields
  • access to all variables e.g. element matrices during the simulation or the linear equation system
  • generation of simple regular meshes in 1D/2D using triangl- and quadrilateral elements (external meshes can be used)

Install

Requirements

Using PyFEMP requires a python (3.x) installation with numpy and matplotlib.

We recomend installing Anaconda. Its a free python distribution that comes with poth numpy and matplotlib installed by default and is available for all major computing platforms. This should result in the works out of the box experience:

https://www.anaconda.com/products/individual

Installation

Once downloaded this project you just need to execute the setup script and should be ready to run:

python setup.py

Remark: For updating PyFEMP just download the new project and run the setup script again. It always overwrites!

More information will follow in the documentation.

Usage

Once succesfully installed you can start by surveying and running the examples, e.g.

python cook.py

Canti

Function Reference

  • functions of PyFEMP:
    • PyFEMP.FEM_Simulation(ELEMENT) Used to start a FEM Simlation by returnig the simulation object. The input is an element, providing the nessercary functions.

    • PyFEMP.msh_line(X0, X1, N, type='U1') -> XI, ELEM Used to generate a regular mesh in 1D. Returns a list of nodal coordinatex and a matrix of element connectivity.

    • PyFEMP.msh_rec(X0, X1, N, type='Q1') -> XI, ELEM Used to generate a regular mesh in 2D for a rectangle, specified by the lower left corner X0 and upper right X1. Returns a list of nodal coordinatex and a matrix of element connectivity.

    • PyFEMP.msh_conv_quad(X1, X2, X3, X4, N, type='Q1') -> XI, ELEM Same as msh_rec but for an arbitrary convex quadrilateral, specified by vertices X1, X2, X3, X4.

The PyFEMP.FEM_Simulation object

The PyFEMP.FEM_Simulation object represents your FEM Simulation. It provides the methods to e.g. introduce the mesh and boundary conditions i.e the discretized boundary value problem, but also to perform solution procedures on it.

properties

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

PyFEMP-0.0.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

PyFEMP-0.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file PyFEMP-0.0.2.tar.gz.

File metadata

  • Download URL: PyFEMP-0.0.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for PyFEMP-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8ba7f235b6040fc39dc0f4f281c37421f37f47e851dade3b2a632f9ff6341b0a
MD5 21e578a8daea870f4fbabf5f35ad57eb
BLAKE2b-256 a4428a65539d9e672fdf0fa34e35c586b0c334ec5f2a8c30d0f906b6e464d523

See more details on using hashes here.

File details

Details for the file PyFEMP-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: PyFEMP-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for PyFEMP-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3def0b12bf50ca92f5f4f30e037891bfcf8d2c671ac2a019470e1ca327a936
MD5 826550e25003e0422344c78901946a81
BLAKE2b-256 a166b4b1d3ac1322c50b7f7dac89f6d832fc9b0984f94ab1d048af11635b1475

See more details on using hashes here.

Supported by

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