Skip to main content

Finite Element Analysis

Project description

FElupe - Finite Element Analysis

PyPI version shields.io Documentation Status License: GPL v3 Made with love in Graz (Austria) codecov DOI Codestyle black GitHub Repo stars PyPI - Downloads

FElupe is a Python 3.7+ finite element analysis package focussing on the formulation and numerical solution of nonlinear problems in continuum mechanics of solid bodies. Its name is a combination of FE (finite element) and the german word Lupe (magnifying glass) as a synonym for getting an insight how a finite element analysis code looks like under the hood.

Installation

Install Python, fire up a terminal and run

pip install felupe[all]

where [all] installs all optional dependencies. By default, FElupe only depends on numpy and scipy. In order to make use of all features of FElupe, it is suggested to install all optional dependencies (einsumt, h5py, meshio, numba, sparse and tensortrax).

Getting Started

A quarter model of a solid cube with hyperelastic material behaviour is subjected to a uniaxial elongation applied at a clamped end-face. This involves the creation of a mesh, a region as well as a displacement field (encapsulated in a field container). Furthermore, the boundary conditions are created by a template for a uniaxial loadcase. An isotropic pseudo-elastic Ogden-Roxburgh Mullins-softening model formulation in combination with an isotropic hyperelastic Neo-Hookean material formulation is applied on a nearly-incompressible solid body. A step generates the consecutive substep-movements of a given boundary condition. The step is further added to a list of steps of a job (here, a characteristic-curve job is used). During evaluation, each substep of each step is solved by an iterative Newton-Rhapson procedure. The solution is exported after each completed substep as a time-series XDMF file. For more details beside this high-level code snippet, please have a look at the documentation.

import felupe as fem

# create a hexahedron-region on a cube
mesh = fem.Cube(n=11)
region = fem.RegionHexahedron(mesh)

# add a field container (with a vector-valued displacement field)
field = fem.FieldContainer([fem.Field(region, dim=3)])

# apply a uniaxial elongation on the cube
boundaries = fem.dof.uniaxial(field, clamped=True)[0]

# define the constitutive material behaviour 
# and create a nearly-incompressible (u,p,J - formulation) solid body
umat = fem.OgdenRoxburgh(material=fem.NeoHooke(mu=1), r=3, m=1, beta=0)
solid = fem.SolidBodyNearlyIncompressible(umat, field, bulk=5000)

# prepare a step with substeps
move = fem.math.linsteps([0, 2, 0], num=10)
step = fem.Step(
    items=[solid], 
    ramp={boundaries["move"]: move}, 
    boundaries=boundaries
)

# add the step to a job, evaluate all substeps and create a plot
job = fem.CharacteristicCurve(steps=[step], boundary=boundaries["move"])
job.evaluate(filename="result.xdmf")
fig, ax = job.plot(
    xlabel="Displacement $u$ in mm $\longrightarrow$",
    ylabel="Normal Force $F$ in N $\longrightarrow$",
)

https://user-images.githubusercontent.com/5793153/200951381-ea310e54-7623-4dd1-a55f-a28f9055063f.mp4

Documentation

The documentation is located here.

Extension Packages

The capabilities of FElupe may be enhanced with extension packages created by the community.

Package Description Link
tensortrax Math on (Hyper-Dual) Tensors with Trailing Axes https://github.com/adtzlr/tensortrax
matADi Material Definition with Automatic Differentiation (AD) https://github.com/adtzlr/matadi
FEplot A visualization tool for FElupe https://github.com/ZAARAOUI999/feplot

Changelog

All notable changes to this project will be documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

License

FElupe - finite element analysis (C) 2022 Andreas Dutzler, Graz (Austria).

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Project details


Release history Release notifications | RSS feed

This version

6.2.5

Download files

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

Source Distribution

felupe-6.2.5.tar.gz (103.7 kB view details)

Uploaded Source

Built Distribution

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

felupe-6.2.5-py3-none-any.whl (145.2 kB view details)

Uploaded Python 3

File details

Details for the file felupe-6.2.5.tar.gz.

File metadata

  • Download URL: felupe-6.2.5.tar.gz
  • Upload date:
  • Size: 103.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for felupe-6.2.5.tar.gz
Algorithm Hash digest
SHA256 e0823d118c36ccb3b02f77f888796833f9a646e0cda521c2abeb0404f7487bb8
MD5 da7742fc826c49b9f14bcc9feac66bf9
BLAKE2b-256 96b7fb66e529c7022964f1cc4d52385efab657510d8a98c4eaf6069a5a7e9592

See more details on using hashes here.

File details

Details for the file felupe-6.2.5-py3-none-any.whl.

File metadata

  • Download URL: felupe-6.2.5-py3-none-any.whl
  • Upload date:
  • Size: 145.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for felupe-6.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9089d8b330ff8c60523dcac5f7076b9bb3205f09cddaa496e6bf35277389d68b
MD5 a8f0e4f10fe490d22f26533c02204049
BLAKE2b-256 a4b95dc655553acdacdac49327ce1dc04f749879b5eb50898d85adb00a0ae78f

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